The ua.js help file
This script source file uses the function xbDetectBrowser to set a number of properties for the
navigator and navigator.examined objects.
function F()
This empty function is used to determine ECMAScript capabilities.
function xbDetectBrowser()
This function is partly derivative work on the now dated Practical Browser Sniffer. It works with
JavaScript from language version 1.0 browsers. It is executed instantly.
Properties added to the navigator object
-
navigator.kin
-
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.family
-
Returns a string, which will be empty if the browser doesn't belong to one of the
families listed. The formerly possible values hotjava and aol are removed. Current
possible values:
-
"gecko" browsers based upon mozilla.org open source code, e.g. Netscape
6+, Firefox, SeaMonkey, Galeon, K-Meleon
-
"opera" Opera browsers versions before 7
-
"presto" Opera browsers versions 7 and later
-
"applewebkit" browsers applying the AppleWebKit, e.g.
Safari, OmniWeb
-
"ie3" Internet Explorer versions before 4
-
"ie4" Internet Explorer versions 4 and later, Netscape Browser 8
when the trident plugin is applied
-
"java" java based browsers, e.g. ICEbrowser
-
"nnN " where "N" is a Netscape version major integer, usually
nn2, nn3 or nn4
- ""
-
navigator.version
-
Returns a number, which will be a floating point number from the number part of the
navigator.appVersion property, if the browser doesn't belong to one of the families listed or
belongs to the "java" family. So, for browsers where navigator.family is other than empty,
the property will normally be the rendering engine specific version number as seen in the list:
- "gecko" browsers will return the build date from the navigator.productSub property,
such as 20060516.
- "opera" browsers return the normal version number.
- "presto" browsers return the normal version number.
- "applewebkit" browsers return the particular AppleWebKit version number (stripping it off the number
past the second dot).
- "ie3" and "ie4" browsers return the normal version number, and Netscape Browser (applying
the trident engine) returns the "MSIE" specific number from the user agent string.
-
Netscape Navigator browsers return the normal version number.
-
navigator.rv
-
Returns a string, which is identical with the release version number if it
exists and the navigator.family value is gecko. If not, the property is
empty:
-
navigator.rversion
-
Returns a number, which is the release version number in double
floating points if the navigator.rv value is other than empty. If not, the property is
0.
-
navigator.prettyName
-
Returns a string, usually identical with the first or last word(s) of
navigator.userAgent.
-
navigator.prettyVersion
-
Returns a string, which is identical with the number put in relation with
navigator.prettyName.
-
navigator.js
-
Returns a number for the evaluated client-side JavaScript language
version up to version 1.3. (Testing beyond that point would necessarily break simpler script engines.)
-
1.3 The script engine is compliant with ECMAScript, edition 1, and has not
undefined values for the
call
and apply
methods of functions (and
fulfills the 1.2 requirements below).
-
1.2 The script engine has not undefined values for
navigator.platform and screen and has a way of determining the natural language of
the browser or system (and fulfills the 1.1 requirements below).
-
1.1 The script engine has not undefined values for
Date.prototype.getTimezoneOffset, navigator.javaEnabled,
navigator.mimeTypes and navigator.plugins.
-
1.0 Netscape Navigator 2, Internet Explorer before version 4
-
0 unknown version