Changes in Opera's user agent string format
By Espen André ØverdahlEspenAO. Friday, May 29, 2009 8:01:08 AM
Our latest weekly snapshot identifies itself in a slightly unexpected fashion (as will the beta and final versions of Opera 10). The user agent for Opera 10 (eg Mac platform, English locale) will be as follows:
Opera/9.80 (Macintosh; Intel Mac OS X; U; en) Presto/2.2.15 Version/10.00
Confused? Let us look at this in more detail.
When we released the Opera 10 alpha in December last year, we gave it a
Opera/10.00 (Macintosh; Intel Mac OS X; U; en) Presto/2.2.0 user agent string. This was a logical follow-on from previous browser versions, but we soon found out that the
Opera/10.00 part was not digested well on a number of sites that deploy browser sniffing to serve version-specific content and scripts. As browsers haven’t been around for a very long time yet, their version numbers have stayed in the realm of single digits thus far; Opera reaching 10 is the first of its kind. It appears that a considerable amount of browser sniffing scripts are not quite ready for this change to double digits, as they detect only the first digit of the user agent string: in such a scenario,
Opera 10 is interpreted as
Opera 1. This results in sites mistakenly identifying Opera 10 as an unsupported browser, thereby breaking server, as well as client-side scripts.
It’s important to note that other browsers — including Internet Explorer, which is two versions away from the dreaded 10 number — might face similar problems in the future, unless site administrators fix their scripts.
For those interested in an example, try to load http://www.allocine.fr/video/merciqui/ with our earlier Opera 10 alpha build. You’ll see that after the advertising intro, the Flash video is shown at half the intended height. This is because the browser sniffing script on which the height parameter depends interprets Opera 10 as 1, which results in an incorrect value and a broken layout.
So, after a few months of careful analysis of the impact this Y2K-like versioning problem may have on site compatibility, we’ve decided to freeze the first part of the string as
Opera/9.80 for now, and add the version number in the end — hence the
Version/10.00 appendix. This construct allows us to somehow serve the
real version number, while sidestepping the various double digit-related issues described above. In future releases, we plan to update the
Version part. For example, Opera 11 will have a
Version/11.00 appendix, and so on.
Feel free to leave any questions you may have in the comment section, and of course, we hope you’ll enjoy Opera 10!