04.11.2015 Views

javascript

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 9: Client Detection<br />

With version 4 on a Windows 98 machine, the user - agent string looked like this:<br />

Mozilla/4.0 (Win98; I)<br />

As Netscape released patches and fixes for its browser, the version was incremented accordingly, as the<br />

following user - agent string from version 4.79 indicates:<br />

Mozilla/4.79 (Win98; I)<br />

When Microsoft released Internet Explorer 4, the user - agent string featured an updated version, taking<br />

the following format:<br />

Mozilla/4.0 (compatible; MSIE Version ; Operating System )<br />

For example, IE 4 running on Windows 98 returned the following user - agent string:<br />

Mozilla/4.0 (compatible; MSIE 4.0; Windows 98)<br />

With this change, the reported Mozilla version and the actual version of IE were synchronized, allowing<br />

for easy identification of these fourth - generation browsers. Unfortunately, the synchronization ended<br />

there. As soon as Internet Explorer 4.5 (released only for Macs), the Mozilla version remained 4 while the<br />

IE version changed as follows:<br />

Mozilla/4.0 (compatible; MSIE 4.5; Mac_PowerPC)<br />

In IE versions through version 8 (the most recent version at the time of this writing), the following<br />

pattern has remained:<br />

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)<br />

It is unclear if the Mozilla version will ever change as IE continues to develop, because it now has little<br />

meaning (it can ’ t be used reliably to determine anything).<br />

Gecko<br />

The Gecko rendering engine is at the heart of Firefox. When Gecko was first developed, it was as part<br />

of the generic Mozilla browser that was to become Netscape 6. A specification was written for Netscape<br />

6, indicating how the user - agent string should be constructed in all future versions. The new format<br />

represented a fairly drastic departure from its relatively simple user - agent string used through version<br />

4.x. The format is as follows:<br />

Mozilla/ MozillaVersion ( Platform ; Encryption ; OS-or-CPU ; Language ; PrereleaseVersion )<br />

Gecko/ GeckoVersion ApplicationProduct / ApplicationProductVersion<br />

A lot of thought went into this remarkably complex user - agent string. The following table lists the<br />

meaning of each section.<br />

235

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!