Browser Detect - Usage

The Browser Detect Lite script creates a number of new properties of the navigator object. Below is a full list of variables:

Browser Engine Name

browser.isGecko

true if the browser uses the Gecko layout engine (such as Mozilla or Netscape 6.x); false otherwise.

browser.isAppleWebKit

true if the browser uses the AppleWebKit layout engine (based on Konqueror's KHTML engine); false otherwise.

Browser Name

browser.isMozilla

true if the browser is Mozilla (and not Netscape); false otherwise. Note, no revision version information is available for Mozilla browsers (Mozilla 0.9.8 will have a navigator.versionMinor of 5) - for Mozilla and all Gecko-based browsers, use the navigator.geckoVersion for version information.

browser.isFirefox

true if the browser is Firefox (or Firebird); false otherwise. Note, no revision version information is available for Mozilla browsers (Mozilla 0.9.8 will have a navigator.versionMinor of 5) - for Mozilla and all Gecko-based browsers, use the navigator.geckoVersion for version information.

browser.isNS

true if the browser is any version of Netscape; false otherwise.

browser.isNS4x

true if the browser is any version of Netscape 4.x; false otherwise.

browser.isNS40x

true if the browser is any version of Netscape 4.0x (4.00 to 4.08); false otherwise.

browser.isNS47x

true if the browser is any version of Netscape 4.7x (4.70 - 4.79); false otherwise.

browser.isNS4up

true if the browser is any version of Netscape 4.00 or higher; false otherwise.

browser.isNS6x

true if the browser is any version of Netscape 6.x; false otherwise.

browser.isNS6up

true if the browser is any version of Netscape 6.00 or higher; false otherwise.

browser.isNS7x

true if the browser is any version of Netscape 7.x; false otherwise.

browser.isNS7up

true if the browser is any version of Netscape 7.00 or higher; false otherwise.

browser.isIE

true if the browser is any version of IE; false otherwise.

browser.isIE4x

true if the browser is any version of IE 4.x; false otherwise.

browser.isIE4xMac

true if the browser is any version of IE 4.x on the Mac; false otherwise.

browser.isIE4up

true if the browser is any version of IE 4.00 or greater; false otherwise.

browser.isIE5x

true if the browser is any version of IE 5.x; false otherwise.

browser.isIE55

true if the browser is IE 5.5; false otherwise.

browser.isIE5up

true if the browser is any version of IE 5.00 or greater; false otherwise.

browser.isIE6x

true if the browser is any version of IE 6.x; false otherwise.

browser.isIE6up

true if the browser is any version of IE 6.00 or greater; false otherwise.

browser.isOpera

true if the browser is any version of Opera; false otherwise.

browser.isSafari

true if the browser is any version of Safari; false otherwise.

browser.isOmniweb

true if the browser is any version of OmniWeb; false otherwise.

browser.isKonqueror

true if the browser is any version of Konqueror (assuming a default user-agent configuration); false otherwise.

browser.isIcab

true if the browser is any version of iCab (assuming a default user-agent configuration); false otherwise.

browser.isAol

true if the browser is any version of AOL; false otherwise.

browser.isNSCompatible

true if the browser reports itself to be Netscape or Mozilla but isn't; false otherwise.

browser.isIECompatible

true if the browser reports itself to be IE but isn't; false otherwise.

Browser Engine Version

browser.geckoVersion

Contains the Gecko version date (in YYYYMMDD format) for Gecko-based browsers; for non-Gecko browsers, it will evaluate to -1.

browser.equivalentMozilla

Contains the version number of Mozilla that would be equivalent to current browser for Gecko-based browsers (NS6+, Firebird, K-Meleon, Camino, Galeon, etc); for non-Gecko browsers, it will evaluate to -1.

browser.appleWebKitVersion

Contains the AppleWebKit build number for AppleWebKit-based browsers (Safari, OmniWeb4.5+); for non-AppleWebKit browsers, it will evaluate to -1.

Browser Version

browser.versionMajor

Contains the integer version number for the browser (for instance, the value of navigator.versionMajor for Netscape 4.07 is 4).

browser.versionMinor

Contains the full version number for the browser (for instance, the value of navigator.versionMajor for Netscape 4.07 is 4.07).

Browser Capabilities

browser.isDOM1

true if the browser supports DOM level 1; false otherwise.

browser.isDOM2Event

true if the browser supports DOM level 2 events; false otherwise.

browser.mode

Mirrors document.compatMode but available in all browsers - BackCompat for quirks mode or CSS1Compat for Strict mode.

Platform / Operating System

browser.isWin

true if the platform is Windows-based; false otherwise.

browser.isWin32

true if the platform is Windows 32bit (Win95, Win98, WinNT, Win2000, WinME); false otherwise.

browser.isMac

true if the platform is a Macintosh; false otherwise.

browser.isUnix

true if the platform is a Unix, SunOS or BSD variant; false otherwise. Because of the huge number of *nix operating systems, this property isn't foolproof.

browser.isLinux

true if the platform is a Linux variant; false otherwise. Because of the huge number of *nix operating systems, this property isn't foolproof.

More about this script

Licensing

This script is released under a Creative Commons License.