Wednesday, June 3, 2009

Opera 10 Beta Released and a “Y2K” Discovery for the Web

Opera

Opera has released a beta version of Opera 10, which promises faster web rendering, more accurate standard compliance (e.g. 100/100 on ACID3), Opera Turbo Browsing, Auto-updates and a hell lot of new features. Opera has been well ahead of the curve in terms of features and implementing new standards and Opera 10 is surely on that path.

Y2K-Like Bug Discovered by Opera

While web browsers are one of the most widely used application for computers, not everyone has reached version 10 of the browser. Opera is currently beta testing v10 of its browser and in this process has discovered that a lot of browser detection scripts for websites have a bug of being able to detect only a single digit version number. Much like the Y2K-bug in applications, these browser detection scripts thus think of Opera 10 as Opera 1, and hence show one of these quirky little messages you can see in the image below:

opera10-bankofamerica

While Opera 10 has hacked its way through by renaming its version as 9.80 and putting the browser version in the user-agent part, this problem begs a bigger question to be answered. Opera developers suggest browser-specific hacks and browser detection is not a good thing and such hacks should be avoided. Other people around the web seem to think these web developers need a spanking. While both these opinions are pointing towards the ideal web, none of these are realistic. Because of the way the browsers have understood the ambiguity of web standards differently, the normal web developer has no where to go. There are so many differences in the way IE/Firefox/Opera/Safari render HTML+CSS and execute JavaScript, there isn’t one holy grail that all of us can follow. To adapt to these changes, as web developers we need to hack our ways through some real painstaking quirks. And to avoid some pain, most of us pickup readily available browser detection scripts and feel happy that things work on all the browsers.

This will continue to happen for sometime in the foreseeable future, unless the browser companies sit together and decide how they want to render things... Or the experts from the standards committee write standards that are a little-less ambiguous.

1 comment:

Anonymous said...

There is a very simple and easy way to make JavaScript that functions as intended in the various browsers - object or feature detection. Please read ppk's explanation.