Changes in Opera's user agent string format

, ,

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.

Browser sniffing — unless you’re writing a web stats application — is always a bad idea. It’s a misguided attempt to send different content to different user agents. This is never scalable — you can’t change every website you’ve ever made every time a new browser version comes out. It is also not future-proof, as highlighted by this article.

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.

For those interested, here is a little note from behind the trenches: for a while, we considered going with Opera/9.99 as it is only 0.01 away from 10, but in the end we settled on Opera/9.80, as this gives us some room for manoeuvre in the future in case we somehow want to update the Opera version number, while still staying below 10. The web is a moving target, so better be prepared for the unexpected!

Feel free to leave any questions you may have in the comment section, and of course, we hope you’ll enjoy Opera 10!

This article was originally posted on Dev.Opera and written by Andreas Bovens.

Auto close idle tabsOpera survey

Comments

Tamil Friday, May 29, 2009 8:16:50 AM

up

FavDjiXas Friday, May 29, 2009 8:33:22 AM

Are you reserving 9.70 string for a release before Opera 10?

*SPAM :-)* http://www.favbrowser.com/opera-970-and-presto-230/

Angelikiellinidata Friday, May 29, 2009 12:53:59 PM

up

Ben Tudballtudsta Friday, May 29, 2009 1:46:51 PM

Originally posted by DjiXas:

Are you reserving 9.70 string for a release before Opera 10?

I would suspect to avoid any conflict with Opera Mobile 9.70

Charles SchlossChas4 Friday, May 29, 2009 2:47:04 PM

up

jonpar Friday, May 29, 2009 11:30:07 PM

why can't you let it be just "Opera 1" ? Not 10 but 1.
Or just "Opera One" ?. Or Opera 2009 ? Or "Opera T" (from ten)
...?

Charles SchlossChas4 Friday, May 29, 2009 11:59:26 PM

jonpar Opera have seen on some site as Opera 1 because they have been only looking at the first digit

jonpar Saturday, May 30, 2009 12:15:48 AM

let it this way "1" it is cool
what's the problem ?
or opera T ---> meaning ten
why do you need, right now "opera 10" ?

Madiseestlane Saturday, May 30, 2009 9:57:00 PM

@jonpar
Scripts are usually made to search for (0-9).x, i.e 8.3. There's no search for letters used in versions.

jonpar Saturday, May 30, 2009 10:11:42 PM

and win 95, 98 but then win xp, win vista
imagination guys up up

Charles SchlossChas4 Saturday, May 30, 2009 11:38:44 PM

jonpar win 95, 98 are operating systems and Opera is not an operating system it is a web browser

jonpar Saturday, May 30, 2009 11:58:11 PM

nobody says, or forces you to name it 10 !!
i look at other software names, or numbers !!

Charles SchlossChas4 Sunday, May 31, 2009 12:09:09 AM

jonpar 10 is the next number in line after version 9 on Opera's timeline

look at other software names, or numbers

others have not been around as long as Opera

jonpar Sunday, May 31, 2009 12:21:01 AM

lol lol lol
i give up up up up

yeeliberto Monday, June 1, 2009 10:06:53 PM

Opera Hall version?
haha

jonpar Tuesday, June 2, 2009 12:47:47 AM

right rolleyes whistle good idea after all sing

Vladimir Georgievvladimirg Wednesday, June 3, 2009 3:03:06 PM

@jonpar:
Based on the detected version number, a sniffing site would generally decide what content to serve to the browser.

If the site sees "9", it would most probably think "Oh, 9 is greater than 8, and Opera 8 was able to handle this nice content. So I will serve this nice content to 9 too."

The user gets the nice content, an everybody is happy.

If the site sees "1" (instead of 10), then the site would think "Opera 1?! This must be a very old browser, not able to handle such a nice content. So I wonty serve any nice content to it."

Similarly, if it was "Opera T", the sniffing site would probably perceive the "T" as "0" (zero), because T is not a digit at all, while the site sniffs for a number.

So were it 10, Ten or Ten-Ten wink would not help: the sniffing sites would still not serve the nice content.

Thus Opera is forced to fake 9...

jonpar Friday, June 5, 2009 12:41:07 AM

Something like that happened at the Olympics of 1976, at the gymnastics they gave a ten and the software showed nothing
Since then ...i don't remember wheather they have changed the software or the 10 hasn't been given again bigsmile

Vladimir Georgievvladimirg Friday, June 5, 2009 6:19:21 AM

bigsmile cheers

Write a comment

New comments have been disabled for this post.