The xbDetect.js help page

This script source file uses various detection techniques and a number of functions, primarily the xbDetectAndAddxbArray function, to add an array xb to the navigator object containing thirteen browser and environment identifying values.

The script should be safe and fully accurate with JavaScript language versions from 1.1 and up. It is executed instantly.

Check out the Browser Sniffing Example!

The cross browser array

navigator.xb is
Returns an array containing the 13 values explained below.

The array contents

navigator.xb[0] is
Application Kinship Returns a string resolved by the concatenation navigator.appName + '/' + parseInt(navigator.appVersion). This way the resulting string would be "Microsoft Internet Explorer/4" if Internet Explorer was used. To simplify matters, the script will instead return "MSIE/4". A few examples:
  • "MSIE/4" Internet Explorer 4 and later and also Opera spoofing as Internet Explorer
  • "Netscape/4" Netscape Navigator 4
  • "Netscape/5" Browsers belonging to the Gecko family such as Netscape 6 and later, Firefox, SeaMonkey
  • "Opera/N" Opera browsers (if spoofing is not used) where "N" represents the application version number integer 3, 4, 5, ... 9.
navigator.xb[1] is
Rendering Engine Technology Returns a lower case string , which will fall back to navigator.appCodeName if the browser does not belong to one of the rendering engines listed, does not have a navigator.product value, or is applying a critical spoofing technique ( cp. navigator.xb[12] ). Current possible values:
  • "gecko" browsers based upon mozilla.org open source code, e.g. Netscape 6+, Firefox, SeaMonkey, Galeon, K-Meleon
  • "presto" Opera browsers versions 7 and later
  • "applewebkit" browsers applying the AppleWebKit, e.g. Safari, OmniWeb
  • "trident" Internet Explorer versions 4 and later, Netscape Browser 8 when the trident plugin is applied
  • the value for navigator.product converted to lower case
  • falling back to navigator.appCodeName converted to lower case
navigator.xb[2] is
OS (Platform) Returns one of the four string values in the list:
  • "win" for all Windows platforms
  • "mac" for all Macintosh platforms
  • "nix" for all Unix like platforms
  • "" (empty) if platform is not one of the above
navigator.xb[3] is
OS (CPU/Variant) Returns an OS or CPU string value depending on the platform:
  • for Windows normally:
    • "9x"
    • "nt"
  • for Macintosh normally:
    • "68k"
    • "ppc"
    • "x86"
  • for Unix like normally:
    • "sun"
    • "hpux"
    • "alpha"
    • "linux"
    • "unixware"
    • "reliant"
    • "sinix"
    • "freebsd"
    • "aix"
    • "sco"
    • "mpras"
    • "bsd"
    • "dec"
  • "os2"
  • "vms"
  • "" (empty) if unknown
navigator.xb[4] is
Popular Name Returns a string , denoting the browser's popular name when it's detectable, falling back to the first or last word(s) of navigator.userAgent.
navigator.xb[5] is
Popular Version Returns a string , which is the number put in relation with navigator.xb[4].
navigator.xb[6] is
Natural Language Code Returns a string , which is based on navigator.language, navigator.userLanguage or navigator.browserLanguage.
  • language-code, e.g "en" for English
  • "" (empty) if not reported by the browser
navigator.xb[7] is
Development Version Returns a number , which will fall back to a floating point number from the number part of the navigator.appVersion property, if the browser doesn't belong to one of the rendering engines. So, the property will normally be the navigator.xb[1] specific version number as seen in the list:
  • "gecko" browsers return the build date from the navigator.productSub property, such as 20071119 (but never including the hour of the build).
  • "presto" browsers return the normal Opera version number.
  • "applewebkit" browsers return the particular AppleWebKit build version number converted to double floating points.
  • "trident" browsers return the JScript version number.
  • falling back upon the number part of navigator.appVersion
navigator.xb[8] is
Release Version Returns a number , which is a particular release version number in double floating points if such a release version number is available for the browser in question. If not, the property will fall back on navigator.xb[7] or return 0.
  • e.g. 1.080114 for Firefox 2.0.0.14 ( rv:1.8.1.14 )
  • e.g. 525.1303 for Safari 3.1 ( Version/3.1 Safari/525.13.3 )
navigator.xb[9] is
Screen Colour Resolution The property returns a number , which is a computed integer dependent on the screen's colour resolution, where 2 represents a widely used (basic) resolution. Note that integers greater than 4 is perfectly possible.
  • 0 Screen resolution is less than 256 colours.
  • 1 Screen resolution is 256 colours.
  • 2 Screen resolution is 16-bits (high) colour.
  • 3 Screen resolution is 24-bits colour.
  • 4 Screen resolution is 32-bits (true) colour.
navigator.xb[10] is
Screen Size Resolution The property returns a number , which is a computed integer dependent on the screen's pixel resolution, where 2 represents a widely used (basic) resolution. Note that integers greater than 4 is perfectly possible.
  • 0 Screen resolution is less than 400 x 300 pixels.
  • 1 Screen resolution is at least 400 x 300 pixels.
  • 2 Screen resolution is at least 800 x 600 pixels.
  • 3 Screen resolution is at least 1200 x 900 pixels.
  • 4 Screen resolution is at least 1600 x 1200 pixels.
navigator.xb[11] is
Normal Timezone Returns a number , corresponding to the timezone relative to GMT, and taking DST into account, i.e. Central Europe will all year round return (+)1.
navigator.xb[12] is
Critical Spoofing Attempt Returns a boolean value, depending on the detection of a critical spoofing attempt. If the returned value is true, not all of the other values in the cross browser array are reliable.
  • true Critical spoofing is detected.
  • false None or non-critical spoofing is detected.

valid-xhtml11 © mikaels.net · e-mail