The goog.userAgent Namespace

.ASSUME_ANY_VERSION

.ASSUME_GECKO

.ASSUME_IE

.ASSUME_LINUX

.ASSUME_MAC

.ASSUME_MOBILE_WEBKIT

.ASSUME_OPERA

.ASSUME_WEBKIT

.ASSUME_WINDOWS

.ASSUME_X11

.GECKO {boolean}

Whether the user agent is Gecko. Gecko is the rendering engine used by Mozilla, Mozilla Firefox, Camino and many more.

.IE {boolean}

Whether the user agent is Internet Explorer. This includes other browsers using Trident as its rendering engine. For example AOL and Netscape 8

.LINUX {boolean}

Whether the user agent is running on a Linux operating system.

.MAC {boolean}

Whether the user agent is running on a Macintosh operating system.

.MOBILE {boolean}

Whether the user agent is running on a mobile device.

.OPERA {boolean}

Whether the user agent is Opera.

.PLATFORM {string}

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).

.VERSION {string}

The version of the user agent. This is a string because it might contain 'b' (as in beta) as well as multiple dots.

.WEBKIT {boolean}

Whether the user agent is WebKit. WebKit is the rendering engine that Safari, Android and others use.

.WINDOWS {boolean}

Whether the user agent is running on a Windows operating system.

.X11 {boolean}

Whether the user agent is running on a X11 windowing system.

The goog.userAgent.adobeReader Namespace

… more

The goog.userAgent.flash Namespace

… more

.getNavigator()

returns {Object}
The native navigator object.

.getUserAgentString()

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 {?string}
The userAgent string or null if there is none.

The goog.userAgent.iphoto Namespace

… more

.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.

documentMode {number}
The document mode version to check.
returns {boolean}
Whether the IE effective document mode is higher or the same as the given version.

.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.

version {string|number}
The version to check.
returns {boolean}
Whether the user agent version is higher or the same as the given version.
@see
<a href="http://en.wikipedia.org/wiki/Safari_version_history"> Webkit</a>
@see
<a href="http://en.wikipedia.org/wiki/Gecko_engine">Gecko</a>

The goog.userAgent.jscript Namespace

… more

The goog.userAgent.picasa Namespace

… more

The goog.userAgent.platform Namespace

… more

The goog.userAgent.product Namespace

… more