Thursday, August 27, 2009

List of Navigator Attributes by Browser and Operating System


As a web designer, I have had to test my sites in many different browsers. My pages tend to be customized for each browser, and over time, I've accumulated a list of navigator attributes that I test for. Sometimes I redirect a browser based on what operating system they use (navigator.platform) other times by language (navigator.systemLangauge, which isn't supported by Firefox). So, here's a table of the attributes for which I've tested. I believe that some people would find it useeful. Note that these were obtained in different operating systems (usually virtual machines). Internet Explorer 2 is not included in the results because it did not support scripting:
 
navigator.platform

Windows (all 32-bit versions)  Win32
Mac OS 10.5  MacIntel
openSUSE 11.1  Linux i686
Ubuntu 8.04  Linux x686
Solaris 9  SunOS5.5.1_i86pc
 
navigator.userAgent

BrowserUser agent
Internet Explorer 8 Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Internet Explorer 7 Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Internet Explorer 6 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Internet Explorer 5 Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Internet Explorer 4 Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)
Internet Explorer 3 Mozilla/2.0 (compatible; MSIE 3.02; Update a; Windows NT)
Firefox 3 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)
Firefox 2 Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20
Firefox 1 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Safari 4 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/530.19.1
Safari 3 Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.28 (KHTML, like Gecko) Version/3.2.2 Safari/525.28.1
Safari 2 Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.3
Konqueror 4.1 Mozilla/5.0 (compatible; Konqueror/4.1; Linux) KHTML/4.1.3 (like Gecko) SUSE
Opera 9.64 Opera/9.64 (Windows NT 5.1; U; en) Presto/2.1.1
Opera 8.5 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.50
Opera 7 Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1) Opera 7.02 [en]
Chrome 2 Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.39 Safari/530.5
Netscape 4.79 Mozilla/4.79 [en] (Windows NT 5.0; U)
 
You may have noticed that Opera 8.5 identifies itself as Internet Explorer 6.0 by default, although this can be changed by going to Tools → Preferences → Advanced and selecting another option from the Browser Identification drop-down menu. That browser never ceases to impress me.

You may have also noticed that almost every browser includes the word Mozilla in its application version information. It has nothing to do with Firefox. This is an old spoof used by browsers to pretend that they were Netscape Navigator.
 
navigator.appName

BrowserApp name
Internet Explorer 8 Microsoft Internet Explorer
Internet Explorer 7 Microsoft Internet Explorer
Internet Explorer 6 Microsoft Internet Explorer
Internet Explorer 5 Microsoft Internet Explorer
Internet Explorer 4 Microsoft Internet Explorer
Internet Explorer 3 Microsoft Internet Explorer
Firefox 3 Netscape
Firefox 2 Netscape
Firefox 1 Netscape
Safari 4 Netscape
Safari 3 Netscape
Safari 2 Netscape
Konqueror 4.1 Netscape
Opera 9.64 Opera
Opera 8.5 Microsoft Internet Explorer
Opera 7 Microsoft Internet Explorer
Chrome 2 Netscape
Netscape 4.79 Netscape
 
As you may have guessed from the above answers, detecting Netscape Navigator is a bit tricky today! It makes me wonder whether the usage share of Netscape Navigator is under-estimated by HitsLink!
 
navigator.AppVersion
 
BrowserApp version
Internet Explorer 8 4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)
Internet Explorer 7 4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Internet Explorer 6 4.0 (compatible; MSIE 6.0; Windows 98)
Internet Explorer 5 4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
Internet Explorer 4 4.0 (compatible; MSIE 4.01; Windows 95)
Internet Explorer 3 2.0 (compatible; MSIE 3.02; Update a; Windows NT)
Firefox 3 5.0 (Windows; en-US)
Firefox 2 5.0 (Windows; en-US)
Firefox 1 5.0 (Windows; en-US)
Safari 4 5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/530.19.1
Safari 3 5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us)
Safari 2 5.0 (Macintosh; U; PPC Mac OS X; en)
Konqueror 4.1 5.0 (Compatible; Konqueror/4.1; Linux) KHTML/4.1.3 (like Gecko) SUSE
Opera 9.64 9.63 (Windows NT 5.1; U; en)
Opera 8.5 4.0 (compatible; MSIE 6.0; Windows NT 5.1; en)
Opera 7 4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1)
Chrome 2 5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.39 Safari/530.5
Netscape 4.79 4.79 [en] (Windows NT 5.0; U)
 
To test this out in your own browser, type the following code into a text file and save it with a .html or .htm extension:

<html>
   <head>
      <script type='text/javascript'>
         document.write("User agent: " + navigator.userAgent + "<br/>");
         document.write("App name: " + navigator.appName + "<br/>");
         document.write("App version: " + navigator.appVersion);
      </script>
   </head>
   <body>
   </body>
</html>

No comments: