Dev.Opera - Follow the standards, break the rulesDev.Opera - Follow the standards, break the rules

Login

Lost password?

Forums » Article Discussions

Discuss the articles posted on Dev.Opera.

Note: You need to login to post in the forums. if you don't have an account you first need to sign up.

By andreasbovens O anchor Wednesday, 27. May 2009, 17:18:52

Changes in Opera’s user agent string format

Andreas gives details on the recent changes to the user agent string of our upcoming Opera 10 release.

( Read the article )

By fearphage anchor Wednesday, 27. May 2009, 18:00:54

avatarThe people that aren't retarded and deserve the title web developers are already detection opera correctly. Now all of those people who you've been evangelizing to and have been doing things properly will be punished because of the dumber part of the population. I think it's a bad habit to get into. What about when IE10 comes out and commands a change in user agent sniffing? Will Opera then jump ship and switch back to not lying about it's version number? Then all those people have to update their scripts to detect Opera in yet another way. Sounds like a lot of work to ask when you are at the bottom of the food chain. Opera shouldn't request special favors or special detection because it's not in that kind of role mostly and we don't want to be an IE. IE requires special treatment. Opera should not.

I believe the best solution is Opera to keep at the Opera 10 bit for now. Switch at beta or sometime before final. This will give you a lots of places to target with what is currently broken. Then you can officially change Opera 10 to Opera 9.8 and not just the user agent. So in the time before the real Opera 10 is comes out, you will have time to evangelize, fix, patch, and generally open the web.

By el-isra anchor Wednesday, 27. May 2009, 19:00:17

avatarok, you "fix" the compatibility problem changing the version in the user agent string now. but do you really think all (or most of) the websites will be corrected? and i'm not saying "until the final release".
i mean, most of the sites are made by people who doesn't really know how to make web pages, and who doesn't know anything instead of IE or firefox. and don't forget those sites that still exists but are not maintained anymore.
there will come the moment when even those popular browsers will have the same problem, and maybe some webmasters will fix their sites, but you can be sure that there will still be so many that will not do it.
so, it doesn't matter if it's today, tomorrow or in ten years. the day you decide to do the change to the real version, there will be the same problem.
we will alway have the same problem.

By reg-doug anchor Thursday, 28. May 2009, 00:04:32

avatar

Originally posted by fearphage:

I think it's a bad habit to get into. IE requires special treatment. Opera should not.



I agree 100% -- if you want to open the web, just keep doing what you know is right.

Originally posted by fearphage:

I believe the best solution is Opera to keep at the Opera 10 bit for now. Switch at beta or sometime before final.



OK, I agree, but not 100%. Definitely switch before final.

By Andrew Gregory anchor Thursday, 28. May 2009, 02:20:42

avatarI guess Opera have to choose between two sets of people - their customers, who cannot be expected to understand these things - and web developers, who are.

Opera have been here before. Previous versions have defaulted to identifying as IE. That made things easier for the Opera user, but not web developers, who then complained about how complicated Opera was making their lives. It was their own fault, though.

History is repeating itself. Idiot web developers are forcing Opera's hand to make things easier for Opera users. The people who have made this stupidity necessary - the web developers - they will bitch and moan again, but they're the ones responsible.

Opera can't win. If they identify themselves honestly, web developers are happy, but Opera users are faced with broken sites. Lie, and users are happy, but developers are not.

I guess since it's web developers who are responsible the fairest option is to make them pay for their mess, but I can help thinking this will have some web devs saying Opera is too complicated to be worth supporting - hence broken sites for Opera users.

By HMHofman anchor Thursday, 28. May 2009, 06:50:03

avatarIt's better not to check the browser version in Javascript, but the capabilities of the javascript compiler.
Thus not check the browser, but something like "if (window.clientWidth) else..."
That way, you don't need to know the browser version, you just check if the browser understands you.

Just a tip for web developers...

By tagawa O anchor Thursday, 28. May 2009, 08:14:15

avatarI don't think the web developers who have been doing things properly will be punished. Rather, those who haven't been can get away with it for a bit longer. When IE hits version 10 it should raise awareness of user agent sniffing and force encourage more developers to stop the practice. Even so, I imagine most sites will still fall into the category of either no longer being maintained or made by not-so-technical people with software that doesn't follow web standards.

Opera, as much as it wants to promote standards, has to have keeping users happy as its priority. The Open the Web team seem to be working harder and harder on the promotion part but inevitably allowances must be made for the areas they can't reach. Hence this user agent change is not an ideal solution but certainly the most practical, IMO.

It will be interesting to see how IE handles this. To be on the safe side, as HMHofman says, check the browser's capabilities, not the browser's name.

By dahulevogyre anchor Thursday, 28. May 2009, 08:18:05

avatarWhy not 9.7 instead ot 9.8 ?

By remcolanting anchor Thursday, 28. May 2009, 13:56:14

avatarInstead of this change, I would rather like to see an extra option for masking as 9.x. It makes much more sense with the entire infrastructure Opera has built to override/fix bad behaving sites.

By Robert90 anchor Thursday, 28. May 2009, 14:45:26

avatar

Originally posted by remcolanting:

Instead of this change, I would rather like to see an extra option for masking as 9.x. It makes much more sense with the entire infrastructure Opera has built to override/fix bad behaving sites.


I agree, and sites that are known for not working with Opera 10 because of wrong sniffing, can automaticly be facked with browser.js so the user doesn't notice of the change from the identify/mask as. Then you could also make a button which say's "This site is stuppid and uses browser sniffing" if you click on it, you, the Opera team, gets notified about it (and can contact the site owner) and if needed could add the site to browser.js, like IE8 does with the IE7 compatible mode/view.

Edit:
The solution you now have choosed for is just stalling the changes site owners have to make. What if IE never gets a version 10, because it gets a new name before that time? Then you will for ever have to use this (dirty) trick of Opera/9.8 Version/10.00. And before Firefox has a version 10 release we are allready a lot of years, and Opera versions further.

Or are you planning to get world domination soon, so everyone has to listen to you and you could do what you want (like IE does)? :devil:

Post edited Thursday, 28. May 2009, 14:59:29

By tudsta anchor Thursday, 28. May 2009, 15:59:15

avatarThis smells like X-UA-Compatible and version targeting, except not quite as severe (without the whole separate rendering engine). It automatically patches numerous outdated sites and frameworks designed for browsers < 10.

Opera maybe better off having a useragent98.ini containing all known domains with Opera 10 detection problems. All sites in the list get sent the Opera/9.80 UA string. MAMA could help out to find problem domains.

The drawbacks for this solution would be that useragent98.ini file will become massive and be a performance issue.

Opera's Chief Web Opener could contact any problematic Websites and framework developers to provide them with code solutions. Yes, David Storey, we are looking at you. p:

The drawbacks here are that contacting Website owners will be long and tedious. Websites using a faulty framework are using a framework for a reason: to not have to deal with coding issues. Many unmaintained Websites just wont get updated.

Have Opera presented this problem to Mozilla, Microsoft, Apple, Google, W3C, WASP for their suggestions and possible remedies, for the sake of a better and more open Web? Even though UA string violations already occur elsewhere, this is important to remain respectful and responsible.

It is unfortunate that the altered UA string currently appears to be the most unobtrusive and easiest "fix" for a mainstream problem.


Opera 10: Stuck between sloppy Web poo and hard Web poo.


Originally posted by leunen.d:

Why not 9.7 instead ot 9.8 ?

I suspect to avoid any confusion with Opera Mobile 9.7

By Zajec anchor Thursday, 28. May 2009, 16:05:06

avatarThat's wrong way, don't introduce such a hacks in browser. You make webmasters use hacks to detect real version of Opera.

If there is some huge and important site that's doesn't work - report it to webmaster. And if you really, really, have to make it work in Opera... ok, use browse.js to hack it.

What will be next? Implementing undocumented IE's filters? Come on... don't break the web.

By dstorey O anchor Thursday, 28. May 2009, 18:20:20

avatarI'm not sure this is making Opera harder to work with than other browsers. Look at every otherbrowser's UA string. They all identify as Mozilla 5, where we have Opera 9.8. Chrome identifies as every browser under the sun (except Opera or IE).

While I don't particularly like this solution, it is necessary. Most sites that use ASP.net/IIS break in Opera 10. That is many thousands of sites, including MS sites. We've reported it to them, but they've not fixed it yet. Even if they do fix it, it will take a long time for all sites to update their software (if they do at all). Although I've been contacting sites that break due to this, I'm but one person and only have so many hours in the day, and I can't possibly contact every one of the sites that break and convince them all to fix the issue.

We also want to get developers to start checking the Presto number instead of the browser version, as it makes more sense. All browsers on the same Presto version have the same features and bugs, no matter which browser it is in (whether it is Opera, Opera Mobile or a Nintendo device). Checking this will give the developers what they want more reliably than the browser version number.

By seifip anchor Thursday, 28. May 2009, 18:21:51

avatar

By gbilotta anchor Thursday, 28. May 2009, 23:36:29

avatar

Originally posted by remcolanting:

Instead of this change, I would rather like to see an extra option for masking as 9.x. It makes much more sense with the entire infrastructure Opera has built to override/fix bad behaving sites.



I was going to propose just that. One more vote to adding an entry for 'Identify as Opera 9.8' to the list of UA spoofs.

By GwenDragon anchor Friday, 29. May 2009, 08:30:36

avatarI dislike the change of the version number lowered to 9.8. This is like spreading a "browser flu"!
Sorry, the new user agent string is not a good idea. It results in more fixing currently running webapps sniffing for correct Opera/10 string.

If you want to make Opera 10 compatible to Opera 9.x on some websites, please add an extra button (like IE 8 does, cheating as IE 7) or add a new faked useragent string to Opera's site preferences.
Adding websites (not running with Opera 10 version string) to browser.js is a good idea, because fixing "ugly" websites has been done by Opera using this concept in the past.

Please, don't hardcode a wrong version number into Opera until the web ends and the last ugly browser sniffer died from your new invented Opera flu. :wink:

If you want a more common UA string, you may use something like this:
Old UA:
Opera/10.00 (X11; Linux i686; U; de) Presto/2.2.0
New UA:
Mozilla/5.0 (X11; U; Linux i686; de) Presto/2.2.0 Opera/10.00

I hope, the idea running with the current 9.8 user agent string will be revised.

Have a nice day

By seifip anchor Friday, 29. May 2009, 14:37:51

avatarIMHO GwenDragon gave two great ideas and one of them should be used in the final release.

By dstorey O anchor Friday, 29. May 2009, 17:26:26

avatarGwenDragon's suggestion wouldn't work. The regex would still detect the word Opera and get the first digit after, which would still be 1. Believe me, we've looked into many solutions, and unfortunately this is the best option we have.

We were thinking about spoofing, but there are too many sites using ASP.net, and not all of them are known by us. There is also a lot of issues with sites like banks (Bank of America is one example) and they are hard to test as they are behind a log-in.

By seifip anchor Friday, 29. May 2009, 17:33:42

avatar@dstorey:But what about IR8-like compatibility mode button? Wouldn't that be a better/cleaner solution?

By dstorey O anchor Friday, 29. May 2009, 19:47:27

avatarSeifip: No, a button to change the UI that regular users wouldn't and shouldn't have to understand isn't a good solution. It would also be worse for developers as they wouldn't be able to predict what user agent string is being used.

By Luchio anchor Saturday, 30. May 2009, 05:30:56

avatar

Originally posted by GwenDragon:

It results in more fixing currently running webapps sniffing for correct Opera/10 string.


How? There are NO webapps today that filter intentionally Opera >= 10 and have a different behavior. And if so, that's the WRONG way to do it. As someone else pointed out, you should detect features provided by the browser, not use browser versions to do filtering... And if you ABSOLUTELY want to filter it, use >=9.8 instead of 10.0.

I really don't see how this creates a problem. This solution, though very, very ugly, fixes more problems than it creates...

By edvakf anchor Saturday, 30. May 2009, 08:10:49

avatarAt first I thought the same way as fearphage, but I now think it was the best solution both for Opera and the web.

UA string can be just anything. If a browser vendor wants to, they can change it to a completely defferent one from its current UA. And of course, a new browser could potentially be born at any moment.

The key is that a browser can change it's UA for some egoistic reasons, and it's a decision of one single vendor. However, the "users", in this case site owners, can be millions an millions. The answer is obvious. You can't force all the users to keep up with your decisions all the time. The browser should be as backward compatible as possible. (especially for such a trivial thing like the UA)

By fearphage anchor Saturday, 30. May 2009, 09:40:21

avatarSo when IE10 comes out and forces people to update their code checking, will Opera switch back to the way it was showing versions before this snapshot? What I was referring to in special treatment is it is bad enough that very few web devs pay attention to Opera as it is. Now you are requesting that they change the way they detect one of the smaller fishes in the tank. I hope this will be set in stone at that point and not switch back to "normal" after IE tackles the issue.

With respect to detecting presto version instead, that is not present in older versions of Opera so that creates disparity in how you detect versions in Opera. Every other browser (to my knowledge) has a single method to accurately detect which version the browser is via useragent.

I'm not fully convinced that this change should be made at all but as long as the change is permanent and not a temporary solution, it will be more tolerable.

Post edited Saturday, 30. May 2009, 09:51:26

By Zaufany anchor Sunday, 31. May 2009, 01:24:15

avatarWhy this string is so bad?
Presto/2.2.15 (X11; Linux i686; U; en) OperaDesktop/10.00 (Opera/9.64 successor)

Presto number is on the first place. There isn't any "Opera/1" substring. There is working "Opera/9" substring. It looks quite good for humans...

By GwenDragon anchor Tuesday, 2. June 2009, 15:22:54

avatar

Originally posted by Big_Z:

Why this string is so bad?
Presto/2.2.15 (X11; Linux i686; U; en) OperaDesktop/10.00 (Opera/9.64 successor)


What is Presto? A Coffee-Making-Browser Version 2.2? Really nice. :wink:

Putting the rendering engine in front of UA is really "nonstandard", it is nonsense.
Read FFC:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.8
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43

Please, don't invent such browser agent string.
Opera opens the web. It does not invent nonsense standards (i hope!).



Post edited Tuesday, 2. June 2009, 15:45:59

By reashlin anchor Friday, 5. June 2009, 14:27:01

avatarSorry Opera Devs but you got it very wrong this time.

There is no doubt in my mind that as far as standards compatibility goes you are doing the right thing. People tell me all the time that Opera is "incompatible with site x" and I discover site x is using some hideous hack to make it work in the two or three browsers it does work in.

In this case you are doing quite the opposite and allowing people to create a hideous hack to discover Opera. As a web developer I never go by UA strings. In js I ask the browser if it can handle what I want to do. In CSS I specify everything and there is very rarely a case that things go wrong. I will write a patch file for ie and leave everything else with as good a code as I can write.

Please don't support the morons out there. Remain loyal to one of the best reasons I have for supporting Opera - Its more pro-standard that just about anything else. Pro-Standard in this case is the only way forward.

Originally posted by GwenDragon:

Please, don't invent such browser agent string. Opera opens the web. It does not invent nonsense standards (i hope!).



I really like that. Please for heavens sake don't go mucking about with things that just aren't the business of browser developers.

By iveinsomnia anchor Sunday, 7. June 2009, 21:35:11

avatarOpera 10 Alpha:

Opera/10.00 (Windows NT 5.1; U; fr) Presto/2.2.2


Opera 10 Beta 1:

Opera/9.80 (Windows NT 5.1; U; en) Presto/2.2.15 Version/10.00



From "$HTTP_USER_AGENT" PHP5 on Linux Server.
Oo I don't see any difficulties to check that ...

By dstorey O anchor Monday, 8. June 2009, 12:26:32

avatarreashlin: we are glad you do capability testing, and commend you for doing it right. We wish everyone would. Unfortunately not all developers are like you and if we do not make this change huge amounts of sites (those ASP.net based sites as one example - which is a huge amount of sites in its own) would break. We are not in a position where we can allow thousands of sites to break in Opera cause they misdirect us properly. It would be akin to commercial suicide.

By GwenDragon anchor Sunday, 14. June 2009, 11:59:28

avatar

Originally posted by dstorey:

We are not in a position where we can allow thousands of sites to break in Opera cause they misdirect us properly. It would be akin to commercial suicide.


I agree with that. Opera should run with all sites. But this disability of runnig websites in Opera is often no problem of Opera's user agent string. But this would be OffTopic to discuss here.

Well, OK. We have to live with Opera 9.80 until the Web knows there are more numbers than only 9 :wink:
I'm really curious which UA version number Opera 11 would have.
May be I'm old fashioned (or my brain was not working with enough flexibility), i liked the old Opera numbering of UA.

But now, after a while, I think, it's better to get Opera running on many websites instead of hanging on pseudostandards like "correct" UA numbering.

By jax anchor Friday, 4. September 2009, 13:17:24

avatarThis is a sane solution to an insane problem. Browser version number sniffing is damentally broken (I was to write "fundamentally broken", but there is no fun in version sniffing).

Maybe I should tout my own horn, namely the one called Conditional Comments in HTML5?

Somewhat analogous to the simplified DOCTYPE in HTML5 browser vendors should stop providing version numbers at all, this only encourages unhealthy habits. Instead they should use engine tokens (the "planned obsolescence" in my article).

Conditional comments is a less-bad approach than the alternatives. I would recommend that Opera supported them as well.

By DotNET Pro anchor Monday, 7. September 2009, 15:45:49

avatarI wish Opera had an INI file where I could edit the UA String that is transmitted in the Header to sniffing websites. That would solve the problems I have. I also realize that this has the potential to create problems or lead to abuse.

I agree with what all of the posters here have said about ignorant and unqualified programmers and poor web site--or web page(s)--design and implementation. There are many sites that simply do not care. If you do not want to use IE, Mozilla or Firefox, then you cannot use or have access to their site. That brings me to the problem I have been trying to get Opera to resolve for over three years. It has to do with the User Agent string and is exactly what you are discussing here.

Here is the problem: The Mozilla Gecko Engine and Firefox Version Identification information transmitted in the Header to sniffing websites is OVER THREE YEARS OLD!!

I have posted this to the Wish List years ago and even put it in email replies to Opera employees that responded to some of my earlier posts--also over one year ago.

Please see my current post in the Opera Browser Forum at this URL: http://my.opera.com/community/forums/topic.dml?id=290465

Please read both the original post and the reply I added for more clarification and additional info.

Once you read my post, and the problems detailed therein, I believe you will agree it is related to the problems you are discussing here. It may even be the heart of the problem. Perhaps it would be better if you reply to the Opera Browser Forum and tell me what more can be done.

Thanks.

By Leighman anchor Saturday, 12. September 2009, 11:57:54

avatarAny chance of a 'Set default UA to read Opera 10' in opera:config for those masochistic people among us who want to lead the anti-browser-sniffing charge? =D
I got two sites fixed when it said 10, back in the day P:

(Also! Where do I report the fact that the 'previous replies' under this is telling me that I posted them all. Although presumably someone is aware of this =D)

By lucideer anchor Saturday, 12. September 2009, 19:24:51

avatar

Originally posted by Leighman:

Any chance of a 'Set default UA to read Opera 10' in opera:config for those masochistic people among us


I second this request. Total masochist me. Plus I think it would be nice to get one or two "Real Opera 10" UA's out into visitor statistic lists without needing to revert to early snapshots.

By DanielHendrycks anchor Saturday, 12. September 2009, 19:27:16

avatarWhat if there is no IE10? What if M$FT goes with Gazelle? What will happen to the user agent string?

By lucideer anchor Saturday, 12. September 2009, 19:57:04

avatar

Originally posted by DanielHendrycks:

What if there is no IE10? What if M$FT goes with Gazelle? What will happen to the user agent string?


There'll be a Chrome 10 - they go through version numbers like noodles through a goose.

By Leighman anchor Saturday, 12. September 2009, 22:32:32

avatar

Originally posted by lucideer:

like noodles through a goose.


I'm gunna use that phrase for ever and ever =D

By andreasbovens O anchor Tuesday, 15. September 2009, 21:55:27

avatar

Originally posted by DotNET Pro:

Here is the problem: The Mozilla Gecko Engine and Firefox Version Identification information transmitted in the Header to sniffing websites is OVER THREE YEARS OLD!!



We're looking into how this should be updated in future releases.

By fearphage anchor Wednesday, 16. September 2009, 10:29:07

avatarThe problem I see with updating the header is then sites will expect us to support Firefox 3/3.5 functionality (think html5). That could cause a world of different problems.

By fearphage anchor Wednesday, 16. September 2009, 11:51:37

avatarThe problem I see with updating the header is then sites will expect us to support Firefox 3/3.5 functionality (think html5). That could cause a world of different problems.

Moderators: pepelsbey | dstorey | mcx | operadev | chrismills | shwetankdixit | brucelawson | iheni | andreasbovens | zibin | mollydotcom