Home

# Library goog.userAgent

Function Summary
| `compare(string v1, string v2) ⇒ number` Compares two version numbers.
| `determinePlatform_() ⇒ string`
| `determineVersion_() ⇒ string`
| `getDocumentMode_() ⇒ (number|undefined)`
| `getNavigator() ⇒ ?Object`
| `getUserAgentString() ⇒ ?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.
| `initPlatform_()` Initialize the goog.userAgent constants that define which platform the user agent is running on.
| `init_()` Initializer for goog.userAgent. This is a named function so that it can be stripped via the jscompiler option for stripping types.
| `isDocumentMode(number documentMode) ⇒ boolean` 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.

`isVersion((number|string) version) ⇒ boolean`

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.