Namespace goog.labs.userAgent.util

code »
Show:

Global Functions

Parses the user agent into tuples for each section.

Parameters
userAgent
Returns
Tuples of key, version, and the contents of the parenthetical.

Gets the native userAgent string from navigator if it exists. If navigator or navigator.userAgent string is missing, returns an empty string.

Getter for the native navigator. This is a separate function so it can be stubbed out in testing.

Returns
The user agent string.
Parameters
str
Returns
Whether the user agent contains the given string, ignoring case.
Parameters
str
Returns
Whether the user agent contains the given string.

Applications may override browser detection on the built in navigator.userAgent object by setting this string. Set to null to use the browser object instead.

Parameters
opt_userAgent: ?string=
The User-Agent override.

Global Properties

A possible override for applications which wish to not check navigator.userAgent but use a specified value for detection instead.