Opera 10’s Y2K Bug: Browser Detection Goes Bad

By Josh Catone

Opera 10, the latest version of the world’s #5 browser (Google’s Chrome has overtaken it according to NetApplications), was released in beta earlier this month. One unintended consequence of being the first web browser to put out a double digit version numbered release? A lot of web sites have broken due to a bug with their browser detection code reminiscent of the “Y2K” bug.

According to Hallvord Steen, who works as a part-time Quality Assurance developer at Opera, a number of web sites have faulty browser detection schemes that assume a web browser’s version number will only have one digit. That causes a problem when detecting Opera 10, which of course clearly has more than one digit.

“If websites assume that version numbers always have a one-letter “major” part and look for a single digit, they are going to “detect” Opera 1!” writes Hallvord.

So many web sites, including heavily trafficked sites like Microsoft’s Live Mail and Bank of America, are reading Opera 10 as Opera 1.0 and assuming that the browser isn’t supported. As a result, users of one of the most standards compliant and up-to-date browsers on the planet are instead greeted with messages urging them to upgrade to a better browser. Microsoft’s page, for example, suggests that users switch to Internet Explorer, Safari, or Firefox.

This is something that web developer Andrew Gregory predicted would happen in a blog post back in May.

Unfortunately, this reflects poorly on Opera, even though it is the fault of shoddy programming on the part of some web developers. Many users will undoubtedly blame the problem on Opera when the same sites works perfectly in other browsers. In reality, though, this isn’t Opera’s fault. Does your site’s browser detection work with Opera 10?

Free Guide:

7 Habits of Successful CTOs

"What makes a great CTO?" Engineering skills? Business savvy? An innate tendency to channel a mythical creature (ahem, unicorn)? All of the above? Discover the top traits of the most successful CTOs in this free guide.

  • Zachary Voase (http://biga.mp)

    You know, they could just use hex. Instead of 10, it would be Opera A. Of course, they’d then have another 5 versions to go before people would have to fix their browser detection scripts.

  • SimonPhoto

    Browser detection is poor form anyhow.

    Everyone should be using feature detection by now. Its been around for years, and guaranteed not to break when an unknown browser shows up.

    Also, Opera can easily be told to give a false user agent string, so this will not be a problem for most Opera users – in general, Opera users are more tech-savvy than their Internet Explorer or even Firefox counterparts.

  • Ben Johnson

    What a surprise! Microsoft has shoddy programming, I don’t believe it.

  • Alan Hogan

    Sad, just sad.

  • http://www.studio-gecko.com/ XLCowBoy

    That’s why you shouldn’t build anything on the back of browser sniffing, unless the browser itself has a publicly available “hack” (e.g. MSIE conditional comments) for you to work on.

    Shame on the programmers for shoddy work.

  • Shantra

    Opera has been blamed for many problems. Most often, as said in the article, it’s because of bad programming (the site).

    Also, it doesn’t help Opera that some programmers develops their code for IE and Firefox, and gives Opera visitors a message saying they have to change browser, even though Opera have no problems with the site.

    One thing is sure, being a programmer at a big company, is NOT the same as being good or qualifed.

  • http://www.tyssendesign.com.au Tyssen

    Many users will undoubtedly blame the problem on Opera when the same sites works perfectly in other browsers.

    I doubt it’d be that many. Like mentioned already, most Opera users will be more tech-savvy than those using IE and wouldn’t be so quick to blame their browser.

  • http://pixopoint.com/ ryanhellyer

    Google Chrome had the same problem with Windows Live the last time I checked.

  • dels

    didn’t Opera allow you to change your browser identity on fly? didn’t Opera allow us to use Identify as Firefox or Identify as Internet Explorer? or it didn’t work

    shame on faulty browser detection schema, better way just stick to 9.63, before Opera 10 going final (or beta atleast)

  • madr

    They didn’t release a beta, the released an alpha.

    Sadly, the dumb programmers won’t do anything since to few use Opera.

  • http://www.dan-schulz.com Dan Schulz

    So madr, you’re saying that 30 million people using the desktop browser alone (and nearly the same number of people using the mobile versions) [link: operawatch.com] isn’t enough to consider incorporating Opera into a programmer’s development, testing, and support regimen?

    Personally, I hope that’s not the case; if it is, then it would be a real disappointment.

  • nightwatchman

    It is possible, in the spirit of co-operation, if all web developers decided that on a certain date we would disable all browser hacks, work-arounds, and discontinue all other non-compliance pandering behaviour.

    How long would it then take for MIcrosoft to release IE 8 and all these issues and extra work to disappear?

  • http://www.dan-schulz.com Dan Schulz

    I doubt that would be possible, nightwatchman. To do that we’d have to fix the 90% of the web that’s currently broken – and many companies are loathe to do it because they don’t see it as something that requires fixing (even though we know better).

  • http://www.brothercake.com/ brothercake

    even though it is the fault of shoddy programming on the part of some web developers. Many users will undoubtedly blame the problem on Opera when the same sites works perfectly in other browsers.

    Believe me, Opera users are extremely well used to this scenario!

  • islandsteve

    Hmmm…Apple went with OS X.
    Maybe there’s something in this? ;-)

  • Martin Bean

    Ouch. However, browser detection really shouldn’t be necessary; site’s should be cross-platform with everyone jumping on the web standards bandwagon and cross-platform compatibility. Seems the world and the Internet are full of hypocrites (no surprise, really).

  • Montoya

    Wow, that’s dumb. So many programmers never think about the potential mistakes they are making :(

  • Prof Patrice

    A site witch is using browser detection instead of feature detection should not be considered very smart. Is it smart enough so I can trust such a site to be safe ?
    I rather trust a browser witch is the FIRST and ONLY ONE on windows to score the perfect 100/100 at the Acid3 Test !

  • Stevie D

    I’d be surprised if this actually turns out to be a big problem. Most websites that employ browser-sniffing tell users with any version of Opera to go away and get knotted (or, on slightly more enlightened sites, that their browser is not supported and so some features may not work properly – this seems to be becoming more common).

    To be sniffing for a particular version of Opera, the website developer must be in possession of a reasonable quantity of clueness, so while there may be a few sites that give rise to this problem, I wouldn’t expect it to be huge – nowhere near as big a problem as the number of sites that say “Opera … nope, never heard of it. Upgrade to IE6 and come back when you’ve done that”

  • http://www.calcResult.co.uk omnicity

    @Dan Shulz
    Going by those figures, I believe that Safari has a user base of around 2 billion, and Gecko around 20 billion, so yes it is insignificant. I really don’t understand why Opera are still in business.

  • http://www.dan-schulz.com Dan Schulz

    Given that our planet doesn’t even have a population of 7 billion, I’m sure that those numbers were just made up on the spot. Besides, if there really were 2 billion Safari users, Microsoft would be out of business, there’d be no need for the Gecko project, and we’d all all be praising our Macs.

    But there aren’t, and so we’re not. If you want to know why Opera’s “still in business” as you put it, it’s because their primary market is the mobile browser industry, not the desktop. Besides, and I’m sure many will agree with me on this – the main two impediments to Opera being adopted by many on the desktop are a lack of marketing/advertising and the fact that Opera was once NOT FREE – even in 7.5 you had to pay to remove the advertisements. That’s a pretty powerful bad taste to remove from one’s mouth if you know what I mean (even though Opera is now free – as in beer).

  • Silver Firefly

    I think a lot of it is down to laziness. Why should we expect Opera to use hex for versioning when programmers need to get off their backsides? After all, isn’t problem solving a part of programming?

  • Deran

    Look guys. Why don’t we forget what has already happened and concern about how to overcome this problem. Even though I’m a very loyal Opera user, my suggestion is to change the version number into some other form. As we all know the number of sites that use shoddy browser detection code is too much to be fixed. Besides some of those companies outsource their web development work and the service providers may no longer be there for them. Moreover, being practical, if I encountered this while browsing, I’d simply open the site either in IE or Firefox without going to worry about Opera. The development team of Opera is the single party that can solve this issue out than waiting for other companies to fix their sites. This is just my opinion tho. :)

  • Silver Firefly

    That’s a typical example of a defeatist attitude and it’s way too prevalent. :(

  • Stevie D

    Moreover, being practical, if I encountered this while browsing, I’d simply open the site either in IE or Firefox without going to worry about Opera.

    If I encounter a site that doesn’t let me in using Opera, I put it into stealth mode and masquerade as Firefox. If I still can’t get in, I’ll go to another website. If they can’t be bothered to get their website working properly, they don’t deserve my custom.

    The development team of Opera is the single party that can solve this issue out than waiting for other companies to fix their sites.

    Er … no. Other browsers will eventually reach v10 and the problem will arise again. Browser manufacturers who are doing things properly should not have to hack and bodge their correct systems to allow for bad practice elsewhere. With the masking options that Opera provides (and has done for years) and, as I said earlier, the small number of sites where I expect this to be an issue at all, I very much doubt that there will be more than a handful of sites that Opera 9 users can access and Opera 10 users can’t. If those sites don’t want the custom of clued-up web users, that’s their problem.

  • Deran

    If they can’t be bothered to get their website working properly, they don’t deserve my custom.

    That’s of very high self esteem but if you deal with something like Bank of America and expect them to fix their web system which would probably cost several thousand dollars and a length approval process (you know from IT department to finance and on and on) guess who is going to lose; it’s no one else but you. Imagine maintaining your browser loyalty and expecting them to change their web system just for a minority of their customers. Besides, Opera isn’t the only browser in the world and (top 5th, not the best) and this problem DID NOT HAPPEN BEFORE AND OPERA IS THE ONLY BROWSER which makes an issue. Think about it; when there are larger things at play.
    Seriously, I really doubt whether someone waits till the bank fixes their site to make an emergency transaction online, rather simply opening another browser and making the transaction without delaying a second. Think about it; it’s Opera which we all praise which is going to tarnish its reputation. We can’t expect everyone to be tech savvy like all of us here.
    Ideally, what Opera should do is, if it ever wishes to maintain its reputation, to alter the version into something else, maintain its popularity while the industry, being aware of this issue now, create some sort of a standard to change shoddily coded web sites.

  • Ben

    Perhaps Opera should consider alpha-numeric numbering, going from 9 to A, and using the alphabet to continue up to 36 before entering double digits. I find it frustrating sometimes that Gmail either seems engineered to favour Firefox, heavily promoted by Google, or Opera seems engineered to be too awkward to comply with Gmail’s needs (it works fine in Epiphany, and Midori…)

  • http://www.dan-schulz.com Dan Schulz

    Ben, we’ve discussed that on this blog already. It won’t work. Especially with Internet Explorer on the verge of reaching version 10 itself (IE 8 comes out this year; presuming they don’t rest on their laurels like they did after IE 6 launched, they’ll be very busy working on IE 9 and finally IE X – I mean 10.)

    Right now people seem not to be giving a rat’s bottom about Opera, but when Internet Explorer hits version 10, watch all those rats scurrying to get off the sinking ship that’s called the SS Browser Sniffer. (Either that or just hack their pointless and utterly useless scripts again.)

  • Jeffrey D.

    Opera why not just have websites detect opera 10 as “opera 9”
    Opera 9.63 the best brower to-date! opera 10 is not as good.
    Pz. keep up the good work you put into opera 9.x

Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

Get the latest in Front-end, once a week, for free.