Main Page

Netscape Communicator 4.0 and Internet Explorer 4.0

var isWin95 = navigator.userAgent.indexOf(“Win95”) > -1 ||
navigator.userAgent.indexOf(“Windows 95”) > -1;
But this was only the beginning.
Netscape Communicator 4.0 and Internet Explorer 4.0
Netscape Communicator 4.0 was released in August of 1997 (the name changed from
for this version). Netscape remained true to its original user-agent string format:
Security [
With version 4.0 on a Windows 98 machine, the user-agent string looked like this:
Mozilla/4.0 (Win98; I)
And as Netscape released patches and fixes for its browser, the AppVersion (accessible through
) was incremented accordingly, as a user-agent string from version 4.79 indicates:
Mozilla/4.79 (Win98; I)
To Netscape’s credit, the method for detecting the version of Netscape Communicator being used
remained the same.
When Internet Explorer 4.0 was released a short time later, Microsoft did developers a favor by updating
the user-agent string, changing the Mozilla version to 4.0 (which matched Netscape’s latest browser).
Except for this minor modification, IE remained with its original user-agent string format of:
Mozilla/4.0 (compatible; MSIE
For example, IE 4.0 running on Windows 98 returned the following user-agent string:
Mozilla/4.0 (compatible; MSIE 4.0; Windows 98)
This change allowed a very simple algorithm to be used when determining if a browser was 4.0-level:
if (parseFloat(navigator.appVersion) >= 4) {
//do 4.0-level stuff here
Although IE 4.0 was the only one of the 4.0 family to be released on the Windows platform, IE 4.5 was
released for MacOS shortly thereafter. This gave a glimpse into the future of IE’s user-agent string format.
IE 4.5 for the MacOS stayed true to the IE 4.0 format for user-agent strings, but updated the IE version
Mozilla/4.0 (compatible; MSIE 4.5; Mac_PPC)
The browser version is 4.5, but the Mozilla version is 4.0, forcing developers to adjust their algorithms
when detecting IE/Mac. This is important to keep in mind.
Browser and Operating System Detection
11_579088 ch08.qxd 3/28/05 11:38 AM Page 229

JavaScript EditorFree JavaScript Editor     Ajax Editor