useragent.js
Rendering engine detection.

File Location

useragent/useragent.js


Public Protected Private

Global Functions

goog.userAgent.compare(v1v2)
Use goog.string.compareVersions. Compares two version numbers.
Arguments:
v1 :
Version of first item.
v2 :
Version of second item.
Returns:   1 if first argument is higher 0 if arguments are equal -1 if second argument is higher.
code »
goog.userAgent.determinePlatform_()
No description.
Returns:   the platform (operating system) the user agent is running on. Default to empty string because navigator.platform may not be defined (on Rhino, for example).
code »
goog.userAgent.determineVersion_()
No description.
Returns:   The string that describes the version number of the user agent.
code »
goog.userAgent.getDocumentMode_()
(number | undefined)
No description.
Returns: 
(number | undefined)
  Returns the document mode (for testing).
code »
goog.userAgent.getNavigator()
(Object | null)
No description.
Returns: 
(Object | null)
  The native navigator object.
code »
goog.userAgent.getUserAgentString()
(null | string)
Returns the userAgent string for the current browser. Some user agents (I'm thinking of you, Gears WorkerPool) do not expose a navigator object off the global scope. In that case we return null.
Returns: 
(null | string)
  The userAgent string or null if there is none.
code »
goog.userAgent.initPlatform_()
Initialize the goog.userAgent constants that define which platform the user agent is running on.
code »
goog.userAgent.init_()
Initializer for goog.userAgent. This is a named function so that it can be stripped via the jscompiler option for stripping types.
code »
goog.userAgent.isDocumentMode(documentMode)
Whether the IE effective document mode is higher or the same as the given document mode version. NOTE: Only for IE, return false for another browser.
Arguments:
documentMode :
The document mode version to check.
Returns:   Whether the IE effective document mode is higher or the same as the given version.
code »
goog.userAgent.isVersion(version)
Whether the user agent version is higher or the same as the given version. NOTE: When checking the version numbers for Firefox and Safari, be sure to use the engine's version, not the browser's version number. For example, Firefox 3.0 corresponds to Gecko 1.9 and Safari 3.0 to Webkit 522.11. Opera and Internet Explorer versions match the product release number.
Arguments:
version :
The version to check.
Returns:   Whether the user agent version is higher or the same as the given version.
code »

Global Properties

goog.userAgent.BROWSER_KNOWN_ :
Whether we know the browser engine at compile-time.
Code »
goog.userAgent.GECKO :
Whether the user agent is Gecko. Gecko is the rendering engine used by Mozilla, Mozilla Firefox, Camino and many more.
Code »
goog.userAgent.IE :
Whether the user agent is Internet Explorer. This includes other browsers using Trident as its rendering engine. For example AOL and Netscape 8
Code »
goog.userAgent.LINUX :
Whether the user agent is running on a Linux operating system.
Code »
goog.userAgent.MAC :
Whether the user agent is running on a Macintosh operating system.
Code »
goog.userAgent.MOBILE :
Whether the user agent is running on a mobile device.
Code »
goog.userAgent.OPERA :
Whether the user agent is Opera.
Code »
goog.userAgent.PLATFORM :
The platform (operating system) the user agent is running on. Default to empty string because navigator.platform may not be defined (on Rhino, for example).
Code »
goog.userAgent.PLATFORM_KNOWN_ :
No description.
Code »
goog.userAgent.SAFARI :
Used while transitioning code to use WEBKIT instead.
Code »
goog.userAgent.VERSION :
The version of the user agent. This is a string because it might contain 'b' (as in beta) as well as multiple dots.
Code »
goog.userAgent.WEBKIT :
Whether the user agent is WebKit. WebKit is the rendering engine that Safari, Android and others use.
Code »
goog.userAgent.WINDOWS :
Whether the user agent is running on a Windows operating system.
Code »
goog.userAgent.X11 :
Whether the user agent is running on a X11 windowing system.
Code »
goog.userAgent.detectedGecko_ :
Whether the user agent string denotes Gecko. Gecko is the rendering engine used by Mozilla, Mozilla Firefox, Camino and many more.
Code »
goog.userAgent.detectedIe_ :
Whether the user agent string denotes Internet Explorer. This includes other browsers using Trident as its rendering engine. For example AOL and Netscape 8
Code »
goog.userAgent.detectedLinux_ :
Whether the user agent is running on a Linux operating system.
Code »
goog.userAgent.detectedMac_ :
Whether the user agent is running on a Macintosh operating system.
Code »
goog.userAgent.detectedMobile_ :
Whether the user agent string denotes a mobile device.
Code »
goog.userAgent.detectedOpera_ :
Whether the user agent string denotes Opera.
Code »
goog.userAgent.detectedWebkit_ :
Whether the user agent string denotes WebKit. WebKit is the rendering engine that Safari, Android and others use.
Code »
goog.userAgent.detectedWindows_ :
Whether the user agent is running on a Windows operating system.
Code »
goog.userAgent.detectedX11_ :
Whether the user agent is running on a X11 windowing system.
Code »
goog.userAgent.isDocumentModeCache_ :
(Object | null)
Cache for goog.userAgent.isDocumentMode. Browsers document mode version number is unlikely to change during a session we cache the results.
Code »
goog.userAgent.isVersionCache_ :
(Object | null)
Cache for goog.userAgent.isVersion. Calls to compareVersions are surprisingly expensive and as a browsers version number is unlikely to change during a session we cache the results.
Code »

Directory useragent

File Reference