JAVASCRIPT
Browser Detection and User Agent sniffing
All samples are using Ink.requireModules
, please read how to use it at Ink.requireModules section
Function name | Description |
---|---|
.debug() | Debug function which displays browser (and Ink.Dom.Browser) information as an alert message. |
.detectBrowser() | Detects the browser and stores the found properties. Called automatically when this module is loaded. |
.init() | Initialization function for the Browser object. |
.setDimensions() | Retrieves and stores window dimensions in this object. Called automatically when this module is loaded. |
.setReferrer() | Stores the referrer. Called automatically when this module is loaded. |
Property name | Description |
---|---|
.CHROME | True if browser is Chrome |
.GECKO | True if the browser is Gecko based |
.IE | True if the browser is Internet Explorer |
.KONQUEROR | True if the browser is Konqueror |
.OPERA | True if the browser is Opera |
.SAFARI | True if the browser is Safari |
.cssPrefix | The CSS prefix (-moz-, -webkit-, -ms-, ...) |
.domPrefix | The DOM prefix (Moz, Webkit, ms, ...) |
.model | The specific browser model. |
.userAgent | The user agent string. |
.version | The browser version. |
Debug function which displays browser (and Ink.Dom.Browser) information as an alert message.
Code
Detects the browser and stores the found properties. Called automatically when this module is loaded.
Initialization function for the Browser object.
Is called automatically when this module is loaded, and calls setDimensions, setBrowser and setReferrer.
Retrieves and stores window dimensions in this object. Called automatically when this module is loaded.
Stores the referrer. Called automatically when this module is loaded.
Boolean
True if browser is Chrome
Boolean
True if the browser is Gecko based
Boolean
True if the browser is Internet Explorer
Boolean
True if the browser is Konqueror
Boolean
True if the browser is Opera
Boolean
True if the browser is Safari
Boolean|String
The CSS prefix (-moz-, -webkit-, -ms-, ...)
False if it is unavailable
Boolean|String
The DOM prefix (Moz, Webkit, ms, ...)
False if it is unavailable
Boolean|String
The specific browser model.
False if it is unavailable.
Boolean|String
The user agent string.
False if it is unavailable.
Boolean|String
The browser version.
False if it is unavailable.