The Good Life... a weblog about life, technology, and the Opera Web browser

Posts from the “Opera” Category

Fruitful New Endeavors

And now for something almost completely different. Yesterday, March 31st, was my last day as an Opera Software employee. It's been a great six years and it saddens me that I won't be working with the great folks at Opera any longer. Opera Software truly employees some of the best and brightest developers and QA in the world and I was extremely lucky to be a part of such a talented team of individuals so early in my professional life.

Opera makes great software and deserves much more respect than it gets in the USA. The company has many obstacles to overcome in order to increase their desktop market share in the USA and I hope that they rise to the challenge. I will be watching and contributing as I can to the effort and I encourage all Opera fans to do the same.

What's next for me? On Sunday, my wife, daughter, and I arrived in Cupertino, CA where I'll be working for a certain consumer-oriented hardware and software maker. How do you like them Apples?

Running Multiple Versions of Opera on OS X

Unlike its brethren on Windows and UNIX/Linux, it has not been possible to specify the profile directory for Opera on OS X, making it difficult to maintain multiple installations. This is particularly problematic if snapshots are not set to use the correct profile directories (which happens from time to time) or when trying to migrate from a snapshot to a final release. Discussed below are two ways to circumvent these problems.

The PrefsSuffix File

To force snapshots to use a different profile for snapshots, a single file is added to the Opera.app package: PrefsSuffix (with no file extension). This file should be located in the Opera.app/Contents/Resources/ directory and contains a string to append to the default profile directories. For instance, the Opera 10.0 snapshots' PrefsSuffix file contains "10" (sans quotes), which makes the profile directory ~/Library/Preferences/Opera Preferences 10/ instead of the default ~/Library/Preferences/Opera Preferences/. The PrefsSuffix is also appended to the default Application Support and Cache directories, making Opera use a completely unique profile.

Here's a step-by-step method for using a PrefsSuffix file:

  1. Create a text file named "PrefsSuffix" with no extension.
  2. Add the desired profile directories suffix in the text file. For instance, if you want Opera to use "Opera Preferences Peregrine Beta" for preferences, you'll put "Peregrine Beta" (sans quotes) in the text file.
  3. Right-click on the Opera.app and choose "Show Package Contents".
  4. Navigate to Contents/Resources/ and copy the "PrefsSuffix" file there.
  5. Optionally rename Opera.app.

The PrefsSuffix can contain alphanumeric characters (A-Za-z), spaces (" "), and/or dashes ("-").

It's important to remember to update the PrefsSuffix file any time the Opera.app package is changed, such as when installing a new snapshot or when auto-updating. If the PrefsSuffix file is missing, the default profile directories will be used.

All paths in Opera's preferences files must be updated before a profile can be copied from the default location to a new directory for use with a PrefsSuffix.

Setting the PrefsSuffix from the Command-Line

Since it's not always easy to remember to update the PrefsSuffix file, there's another method to set the PrefsSuffix from the command-line. Opera can be run from the command-line with the "-pd" switch followed by a string to append to the default profile directory locations. For instance, if Opera.app is in /Applications/, you would type "/Applications/Opera.app/Contents/MacOS/Opera -pd 10" to use the ~/Library/Preferences/Opera Preferences 10/ preferences directory. If the desired PrefsSuffix contains whitespace, the string should be quoted (e.g. '/Applications/Opera.app/Contents/MacOS/Opera -pd "Peregrine Beta"'.

Running Opera from the command-line using "-pd" will not override a PrefsSuffix file in Opera.app.

Tips and Tricks

Using the PrefsSuffix file, it's easy to have multiple versions of Opera running side-by-side. For instance, a user could have "Opera Kestrel.app" with a PrefsSuffix file containing "Kestrel" and "Opera Snapshot.app" with a PrefsSuffix containing "Snapshot" to keep the latest stable and snapshot versions separated. Using QuickSilver, you can easily run each version of Opera simultaneously.

Since running a snapshot without a PrefsSuffix can have unintended consequences, it's a good idea to always use a PrefsSuffix file with Opera. Thus, if an unstable build inadvertently doesn't use a PrefsSuffix, it can't cause problems with a users' primary Opera installation.

Web Mail Integration in Opera 10.0

Screenshot of E-mail Client Selection dialogThe Opera 10.0 snapshot released today includes a new feature that allows users to click on mailto links and have them open in web mail providers, such as Gmail, Yahoo! Mail, and Windows Live Hotmail. This is particularly useful for individuals that primarily use web mail instead of a standalone e-mail client.

In a clean install, clicking a mailto link will trigger the e-mail client selection dialog, which allows users to choose between using Opera Mail, the system default mailer, or various web mail providers. When you select a web mail provider (and check the "Do not show this dialog again" checkbox), all mailto links will open in the specified web mail provider and automatically fill in parts of the compose window. For instance, the maillto link above will put "Test Mail" in the compose window subject. Users can change their settings in Preferences > Advanced > Programs by editing the "mailto" handler.

The web mail providers currently supported are Gmail, Yahoo! Mail, and Windows Live Hotmail. Yahoo! Mail and Windows Live Hotmail will not work very well if you aren't running a recent browser.js, as neither official supports Opera. Furthermore, Yahoo! Mail currently only opens the welcome page, but doesn't open a compose window.

This feature works via a list of web mail providers in the webmailproviders.ini file in the "defaults" sub-directory of the Opera program directory. On Windows, for instance, the file will be in "C:\Program Files\Opera\defaults\" if you install Opera in "C:\Program Files\Opera\". On OS X, the file is in the Opera.app package in the "Contents/Resources/defaults/" directory. Opera will need to be restarted to pick up new/changed entries in the file. Web mail providers are defined via the following format:

[Gmail]
ID=1
URL=https://mail.google.com/mail/?extsrc=mailto&url=%s
ICON=http://mail.google.com/favicon.ico
  • The provider name shown in the UI is enclosed in square brackets.
  • ID is a unique integer identifier for each entry in the file.
  • URL is the web mail provider's mailto handler URL. "%s" will be replaced with the clicked mailto URL. Currently, data and javascript URLs are allowed.
  • Icon is a link to a favicon representing the web mail provider.

Some web mail providers do not have a mailto handler URL, but can prefill compose windows by specifying each parameter separately, e.g. "http://mail.google.com/mail/?view=cm&fs=1&to=%t&su=%s&body=%m&cc=%c&bcc=%b" where %t represents the message recipient, %s the message subject, %m the message body, %c CC'd recipients, and %b BCC'd recipients. The current implementation does not natively support this style of URL, but it is possible to get around this limitation using a javascript or data URL to process the clicked mailto URL into separate parameters. For instance, the following entry could be added to webmailproviders.ini to make Opera work with Opera Web Mail (special thanks to Michael A. Puls II for providing this URL):

[Operamail.com]
ID=4
URL=javascript:(function(uri)%7B%0D%0Afunction%20decode(s)%7Btry%7Breturn%20decodeURIComponent(s).replace(%2F%5Cr%5Cn%7C%5Cr%7C%5Cn%2Fg%2C%22%5Cr%5Cn%22)%3B%7Dcatch(e)%7Breturn%20%22Opera%20percent-decode%20error%22%3B%7D%7D%0D%0Afunction%20encode(s)%7Btry%7Breturn%20encodeURIComponent(s)%3B%7Dcatch(e)%7Breturn%20%22Opera%2520percent-encode%2520error%22%3B%7D%7D%0D%0Afunction%20escapeInvalidHH(s)%7Breturn%20s.replace(%2F%25(%3F!%5B0-9A-F%5D%7B2%7D)%2Fgi%2Cfunction()%7Breturn%20%22%2525%22%3B%7D)%3B%7D%0D%0Afunction%20escapeUnsafeHH(s)%7Breturn%20s.replace(%2F%2500%7C%2501%7C%2502%7C%2503%7C%2504%7C%2505%7C%2506%7C%2507%7C%2508%7C%250B%7C%250C%7C%250E%7C%250F%7C%2510%7C%2511%7C%2512%7C%2513%7C%2514%7C%2515%7C%2516%7C%2517%7C%2518%7C%2519%7C%251A%7C%251B%7C%251C%7C%251D%7C%251E%7C%251F%2Fgi%2Cfunction(match)%7Breturn%20encode(match)%3B%7D)%3B%7D%0D%0Afunction%20filterSingleLine(s)%7Breturn%20s.replace(%2F%5Cr%7C%5Cn%2Fg%2C%22%22)%3B%7D%0D%0Afunction%20MailtoURIParser(s)%7Bthis.parse(escapeUnsafeHH(escapeInvalidHH(%22to%3D%22%2Buri.substr(7).replace(%2F%5C%3F%2F%2C%22%26%22))))%3B%7D%0D%0AMailtoURIParser.prototype%3D%7Bparse%3Afunction(dataset)%7Bthis.to%3Dthis.subject%3Dthis.body%3Dthis.cc%3Dthis.bcc%3D%22%22%3Bvar%20ref%3Dthis%3Bdataset.replace(%2F(%5B%5E%3D%26%5D%2B)%3D(%5B%5E%26%5D*)%2Fg%2Cfunction(match%2Chname%2Chvalue)%7Bhname%3Ddecode(hname).toLowerCase()%3Bif(hname%3D%3D%22to%22)%7Bif(hvalue!%3D%22%22)%7Bif(ref.to!%3D%22%22)%7Bref.to%2B%3D%22%252C%2520%22%3B%7Dref.to%2B%3Dhvalue%3B%7D%7Delse%20if(hname%3D%3D%22cc%22)%7Bif(hvalue!%3D%22%22)%7Bif(ref.cc!%3D%22%22)%7Bref.cc%2B%3D%22%252C%2520%22%3B%7Dref.cc%2B%3Dhvalue%3B%7D%7Delse%20if(hname%3D%3D%22bcc%22)%7Bif(hvalue!%3D%22%22)%7Bif(ref.bcc!%3D%22%22)%7Bref.bcc%2B%3D%22%252C%2520%22%3B%7Dref.bcc%2B%3Dhvalue%3B%7D%7Delse%20if(hname%3D%3D%22subject%22)%7Bref.subject%3Dhvalue%3B%7Delse%20if(hname%3D%3D%22body%22)%7Bif(!(hvalue%3D%3D%22%22%26%26ref.body%3D%3D%22%22))%7Bif(ref.body!%3D%22%22)%7Bref.body%2B%3D%22%250D%250A%22%3B%7Dref.body%2B%3Dhvalue%3B%7D%7D%7D)%3Bthis.to%3Dencode(filterSingleLine(decode(this.to)))%3Bthis.subject%3Dencode(filterSingleLine(decode(this.subject)))%3Bthis.body%3Dencode(decode(this.body))%3Bthis.cc%3Dencode(filterSingleLine(decode(this.cc)))%3Bthis.bcc%3Dencode(filterSingleLine(decode(this.bcc)))%3B%7D%2Cformat%3Afunction(s)%7Bvar%20ref%3Dthis%3Breturn%20s.replace(%2F(%25%25)%7C(%25T)%7C(%25S)%7C(%25M)%7C(%25C)%7C(%25B)%7C(%25w)%2Fg%2Cfunction(match%2Ca%2Cb%2Cc%2Cd%2Ce%2Cf%2Cg)%7Bif(a)return%20%22%25%22%3Bif(b)return%20ref.to%3Bif(c)return%20ref.subject%3Bif(d)return%20ref.body%3Bif(e)return%20ref.cc%3Bif(f)return%20ref.bcc%3Bif(g)return%20encode(%22mailto%3A%22%2Bref.to%2B%22%3Fsubject%3D%22%2Bref.subject%2B%22%26body%3D%22%2Bref.body%2B%22%26cc%3D%22%2Bref.cc%2B%22%26bcc%3D%22%2Bref.bcc)%3B%7D)%3B%7D%7D%3B%0D%0Aif(uri.search(%2Fmailto%3A%2Fi)!%3D0)%7Bthrow%20%22Not%20a%20MailtoURI%22%3B%7D%0D%0Avar%20parser%3Dnew%20MailtoURIParser(uri)%3B%0D%0Avar%20compose%3Dparser.format(%22http%3A%2F%2Fmymail.operamail.com%2Fscripts%2Fmail%2FOutblaze.mail%3Fcompose%3D1%26did%3D1%26a%3D1%26to%3D%25T%26subject%3D%25S%26body%3D%25M%26cc%3D%25C%26bcc%3D%25B%22)%3B%0D%0Avar%20a%3Ddocument.createElementNS(%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%2C%22a%22)%3Ba.href%3Dcompose%3Ba.click()%3B%0D%0A%7D)(%22%s%22)%3B
ICON=http://www.opera.com/favicon.ico

This feature is a work in progress and we hope to work out all of the kinks with web mail providers before the final release of Opera 10.0.

Update (2009-01-13 2:25pm ET): The initial operamail.com URL was wrong and has now been updated.

Opera Mail: Upgrading to Opera 9.5

Opera Mail just grew up. A lot. During the past two years, the Opera Mail team has been working feverishly to improve robustness, stability, performance, and user experience. The results of our labor will soon be available in the final release of Opera 9.5 (previously referred to by the code-name "Kestrel"). Check the full changelog (once available) for the list of changes since 9.27. Below are some additional notes that didn't quite fit in the changelog:

Known Issues

  • On the initial check after upgrading, all deleted feed items still available in feeds will be redownloaded. In other words, if a user performs an upgrade installation all old feed items will be downloaded again and marked unseen. Since feeds generally contain about twenty-five items, this won't be too bad, but it's probably still worth preparing for. A user with existing feed items could, for instance, label them or add them to a filter to keep track of them, then press the Update button in the Feeds view (Feeds > Read Feeds) to force updates for all subscribed feeds. Note that it's possible to get never-before-seen feed items in addition to redownloaded feed items, so users should take care when deleting apparently redownloaded feed items. Feed items that have been downloaded with a previous install, but have not been deleted should not be duplicated.
  • The Check/Send button no longer changes into a Stop button during server communication. Users that have customized the toolbar won't get the new button and the old button will permanently be stuck at Stop. Reset the toolbar to fix the problem.
  • The Delete button has gone through some changes, so users should make sure they reset their mail view toolbars. If not, it's possible that messages may be inadvertently deleted when trying to undelete messages from, for instance, the Trash view.

What to Expect when Upgrading

The process of upgrading from previous Opera releases is straight-forward. On the first start-up after installation, Opera will notify the user that the mail database needs to be updated. During this process, Opera Mail will not be accessible. The update generally goes quickly, upgrading several thousand messages per minute. When the upgrade process is finished, the user will need to restart Opera before Opera Mail is accessible. After restarting Opera may take a long time to start up, sometimes in excess of thirty minutes. This is a necessary part of the upgrade process, so don't interrupt it!

Note: Once this process begins, Opera Mail can no longer be downgraded! Users should create a backup of their Mail directory before upgrading.

Attention POP users: If users with POP accounts set to "Leave messages on server" empty their trash, Opera will delete the trashed messages on the server. Users can disable this behavior by setting "Permanent delete=0" for the relevant account in accounts.ini. Also, there's no longer a warning when disabling "Leave mesasges on server": all messages on the server will be deleted automatically.

More information about some of the behind-the-scenes changes in Opera Mail will be available in the coming weeks.

Acid3: 100/100 and Pixel Perfect

Two days ago, we announced we had achieved 100/100 on the DOM portion of the Acid3 test. Later that evening, a bug was found in the Acid3 test itself. The bug was fixed and the WebKit team announced that they had achieved 100/100 on the DOM portion of the test and they had pixel-perfect rendering, making them the first to achieve two of the three pass conditions (congrats on that, by the way!).

Today, we'd like to announce the same. We have achieved 100/100 with pixel perfect rendering:

Screenshot of the Acid3 test from Opera's latest internal builds

This screenshot is copyright Opera Software ASA and released under the Creative Commons Attribution-ShareAlike 3.0 License.

Windows and Linux users may test this out themselves by downloading the GOGI build available from the Opera Labs. A note about these builds: GOGI, short for Generic Opera Graphics Interface, is a tool our Core team uses internally to develop our cross-platform/cross-project code. It has a very simple UI, which is nothing at all like Opera for Desktop. It is in no way meant to replace Opera for Desktop and we don't expect to duplicate any GOGI features in Opera for Desktop. It also lacks some security features, and thus we recommend that it not be used for regular surfing. Furthermore, please don't file bug reports about problems you find in GOGI.

Now, WebKit and Opera have reached the same point and have the same challenge: optimize enough to run test 26 in 33ms.