The xbDetect.js help page

The script uses a variety of detection techniques and a number of functions to add a property called xb to the native navigator object. This property consists of an array of thirteen browser and environment identifying values, in turn bringing the basis for the same number of elements of the format navigator.xb[number]. By letting your own script ask for the value of each element’s number, you would know something about the browser executing it.

This script’s source code is believed to be safe and fully accurate with all JavaScript executioners adopting language versions from 1.1 and up. The functions will be read into memory and the main function then immediately executed.

Check out the Browser Detection 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". Here is a list of common values for this property:
  • "MSIE/4" Internet Explorer 4 and later and also Opera spoofing as Internet Explorer
  • "Netscape/3" Netscape Navigator 3
  • "Netscape/4" Netscape Communicator 4
  • "Netscape/5" Browsers belonging to the Gecko family such as Netscape 6 and later, Firefox, SeaMonkey, and webkit browsers such as Safari, Google Chrome, identifying themselves like Gecko
  • "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 , equivalent 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
  • "webkit" browsers applying the AppleWebKit, e.g. Safari, OmniWeb, Google Chrome
  • "khtml" Konqueror and other browsers from the KDE family
  • "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 on navigator.appCodeName converted to lower case
navigator.xb[2] is
Operating System 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
Operating System CPU (equivalent) 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:
    • "i686"
    • "sun"
    • "hpux"
    • "alpha"
    • "linux"
    • "unixware"
    • "reliant"
    • "sinix"
    • "freebsd"
    • "aix"
    • "sco"
    • "mpras"
    • "bsd"
    • "dec"
  • "os2"
  • "vms"
  • "" (empty) if not one of the above
navigator.xb[4] is
Presentational Name Returns a string , denoting the browser's popular name when it's detectable, falling back on the first or last word(s) of navigator.userAgent.
navigator.xb[5] is
Presentational Version Returns a string , which is the number put in relation with navigator.xb[4].
navigator.xb[6] is
Spoken Language Code Returns a string , which is based on the language part -- not locale -- of navigator.language, navigator.userLanguage or navigator.browserLanguage.
  • language-code, e.g "en" for English in any locale
  • "" (empty) if not reported by the browser
navigator.xb[7] is
Build Version Returns a number , equivalent to the floating point number in navigator.appVersion, if the browser doesn’t belong to one of the rendering engines listed above. So, the property will normally be the navigator.xb[1] specific version number:
  • "gecko" browsers return the build date from the navigator.productSub property, such as 20100628 -- never including the hour of the build.
  • "presto" browsers return the normal Opera version number.
  • "khtml" and "webkit" browsers return the particular KHTML or AppleWebKit build version number converted to double floating points.
  • "trident" browsers return the JScript version number.
  • falling back on 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
Geographic 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 © mikaelsnet.info · e-mail