Main Page


The strongest alternative to IE and Mozilla on most operating systems is Opera.
Opera has a unique approach to its user-agent string. The basic user-agent string has the following format:
Using Opera 7.54 on a Windows XP computer, the user-agent string is the following:
Opera/7.54 (Windows NT 5.1; U) [en]
To its credit, Opera came up with a unique user-agent string to correctly (and simply) identify its Web
browser. The problem comes with another unique browser feature: the capability to disguise itself as
another browser.
Just by using a menu, Opera users can choose to identify the browser as Opera or as one of the various
versions of Internet Explorer and Mozilla, including older Netscape versions. To do this, Opera changes
the user-agent string it reports, as well as adapts some of its other features (including values of the
object) to try to emulate the other browsers. However, it doesn’t fully emulate the browsers it
disguises itself as, so it is still important to determine if a browser is actually Opera in disguise.
When Opera is being disguised as Mozilla 5.0, it returns a user-agent string that looks like this:
Mozilla/5.0 (Windows NT 5.1; U) Opera 7.54
As you can see, the application name has changed to Mozilla, and the version is now 5.0, just like
Mozilla’s user-agent string. Note that the string
“Opera 7.54”
is added towards the end, which still
allows identification of the browser as Opera.
If Opera is disguised as Mozilla 4.78, the user-agent string looks like the following:
Mozilla/4.78 (Windows NT 5.1; U) Opera 7.54
This isn’t too different from the Mozilla 5.0 identification because only the Mozilla version has changed.
The same is true for Mozilla 3.0, which looks like this:
Mozilla/3.0 (Windows NT 5.1; U) Opera 7.54
If Opera is disguised as IE 6.0, the user-agent string changes to this:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera 7.54
Before version 7.0, Opera could interpret the meaning of Windows operating system
strings. For example, Windows NT 5.1 actually means Windows XP, so in Opera 6.0,
the user agent included Windows XP instead of Windows NT 5.1. In an effort to be
more standards-compliant, version 7.0 started including the officially reported oper-
ating system version instead of an interpreted one.
Chapter 8
11_579088 ch08.qxd 3/28/05 11:38 AM Page 232

JavaScript EditorFree JavaScript Editor     Ajax Editor