The uasniff.js help file
The navigator object
This script source file uses the functions Exami and xbDetectBrowser to set a number of
properties for the navigator and navigator.examined objects.
Properties set by 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.
-
navigator.OS
-
navigator.family
-
navigator.org
-
The struck properties remain undefined.
-
navigator.version
-
Initially set to equal navigator.appVersion. Returns a number. For browsers
where navigator.prettyName is other than empty, the property will normally be the brand
specific version number. However, if the browser is spoofing as another browser, notably
Opera like Internet Explorer, the spoofed version number will be used
instead.
-
navigator.js
-
Stands for the JavaScript language version. It is initially set to 0. It will then
be set to 1.0, 1.1, 1.2 or 1.3
or
1.5. (The last option cannot be set by this function, but it would potentially be set
if the uaenvir.js functions were applied.)
-
navigator.prettyName
-
The popular name (or brand) of the browser. It will equal the navigator.vendor value, if the
browser, notably Gecko browsers, has that property set other than to an empty string. Possible
values:
-
Opera
-
Netscape
-
Internet Explorer
-
Apple
-
Mozilla
-
Galeon
-
OmniWeb
-
Safari
-
Konqueror
-
iCab
-
AOL
-
ICEbrowser
- a string identical with navigator.vendor
- a string identical with the first word(s) of navigator.userAgent
- a string identical with the last word(s) of navigator.userAgent
- an empty string
-
navigator.product
-
This property is already set with a read-only value in some, notably Gecko, browsers as
"Gecko". The function will set the property to other browsers. Possible values:
-
Gecko
-
Trident
-
Netscape
-
KDE
-
Gecko_spoofer
-
Opera
-
Presto
-
Java
- an empty string
-
navigator.productSub
-
This property is already set with read-only values in some, notably Gecko, browsers as
the build date. The function will set the property to other browsers to an empty
string.
-
navigator.rversion
-
The release version number in double floating points for Gecko browsers. Returns a
number. Other browsers return 0.
-
navigator.rv
-
The original release version number for Gecko browsers. Returns a
string, which will be empty for other browsers.
-
navigator.kin
-
Returns a string referring to the browser’s assumed kinship. The string is resolved
by the concatenation
navigator.appName + '/' + parseInt(navigator.appVersion)
, except for the
case of Internet Explorer. Examples are listed below.
-
Opera/N Opera browsers (if spoofing is not used) where "N" represents
the application version number 3, 4, 5, 6, 7 or 8
-
MSIE/4 Internet Explorer versions 4 and later
-
Netscape/N Netscape Navigator 3.x or 4.x browsers
-
Netscape/5 Gecko browsers such as Netscape version 6 and later or
Firefox 1.x
-
navigator.examined
-
A created object
-
navigator.examined.jscript
-
The JScript version number is set to 2 or whatever
number is returned by ScriptEngine. This property applies to
Microsoft applications. Possible values:
- between 2 and 5.6
-
0 if not Microsoft
-
navigator.examined.ecma
-
Returns a boolean value depending on compliance with ECMAScript edition 1
-
navigator.examined.ecma3
-
Returns a boolean value depending on compliance with ECMAScript edition 3
-
navigator.appCodeNameSub
-
Returns a version number between 1 and 5 representing the
general user agent version. It's based on the number next to
Mozilla/
in the user
agent string. A second decision on this version is made by Exami( )
.
Properties set by Exami( )
This function works with JavaScript from language version 1.1 browsers. It should be executed by
an event handler not before the document is fully loaded.
-
navigator.examined.nc4api
-
Returns a boolean value depending on compliance with Netscape proprietary
DOM using document.layers and navigator.kin being "Netscape/4"
-
navigator.examined.msieapi
-
Returns a boolean value depending on compliance with Microsoft proprietary
DOM using document.all and navigator.kin being "MSIE/4"
-
navigator.examined.w3cdom
-
Returns a boolean value depending on compliance with W3C industry
DOM standard using document.getElementById and also applying
document.getElementsByTagName and document.createElement
-
navigator.examined.domelementstyle
-
Returns a boolean value depending on compliance with W3C industry
DOM standard (as above) and applying
element.style
on an
element created by document.createElement
-
navigator.examined.domcreateevent
-
Returns a boolean value depending on compliance with W3C industry
DOM standard (as above) and applying document.createEvent
-
navigator.appCodeNameSub
-
Returns a version string representing the general user agent version (cp.
above). It's evaluating the already set number in the context of the DHTML
capabilities of the browser, and it may have accordingly been adjusted. The property is intentionally
somewhat spoofable. Possible values:
-
undefined or null if navigator.appCodeName is not set
- an empty string if the browser is not using Mozilla as the
value of navigator.appCodeName
-
2.n (where "2.n" is a number) JavaScript version 1.0
browsers
-
3.x (where "3.x" is a version string) JavaScript
version 1.1 browsers
-
4.x (where "4.x" is a version string) Fourth
generation DHTML browsers
-
5.x (where "5.x" is a version string) Fifth generation
browsers returning true for navigator.examined.ecma3 and
navigator.examined.w3cdom
The envir object
Exami( )
is calling the Envir function if it's present in order to use it for the
creation of the envir object. If it's absent, which is the case if the uaenvir.js file isn't there or the browser wasn't allowed to read it, then it will
create envir with one property only.
-
envir.noenvir
-
The property indicates the absence of all usual envir properties. The boolean
value is set to true if
Envir( )
is not defined, hence no other properties
of the envir object are defined.