# Namespace goog.labs.userAgent.util

code »
Show:Public Protected Private

## Global Functions

code »goog.labs.userAgent.util.extractVersionTuples ( userAgent ) ⇒ `!Array`

Parses the user agent into tuples for each section.

Parameters

userAgent

Returns

Tuples of key, version, and the contents of the parenthetical.

code »goog.labs.userAgent.util.getNativeUserAgentString_ ( ) ⇒ `string`

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

code »goog.labs.userAgent.util.getNavigator_ ( ) ⇒ `Navigator`

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

code »goog.labs.userAgent.util.getUserAgent ( ) ⇒ `string`

Returns

The user agent string.

code »goog.labs.userAgent.util.matchUserAgent ( str ) ⇒ `boolean`

Parameters

str

Returns

Whether the user agent contains the given string, ignoring case.

code »goog.labs.userAgent.util.matchUserAgentIgnoreCase ( str ) ⇒ `boolean`

Parameters

str

Returns

Whether the user agent contains the given string.

code »goog.labs.userAgent.util.setUserAgent ( opt_userAgent )

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

code »goog.labs.userAgent.util.userAgent_ : `string`

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