goog.labs.userAgent.util
Module ID |
---|
Utilities used by goog.labs.userAgent tools. These functions should not be used outside of goog.labs.userAgent.*.
Exported Functions
getNativeUserAgentString() → string
string
Gets the native userAgent string from navigator if it exists. If navigator or navigator.userAgent string is missing, returns an empty string.
Parameters | None. | |
---|---|---|
Returns |
|
getUserAgent() → string
string
Parameters | None. | ||
---|---|---|---|
Returns |
|
getUserAgentData() → (NavigatorUAData|null)
(NavigatorUAData|null)
Parameters | None. | ||
---|---|---|---|
Returns |
|
matchUserAgent( str ) → boolean
boolean
matchUserAgentDataBrand( str ) → boolean
boolean
matchUserAgentIgnoreCase( str ) → boolean
boolean
resetUserAgentData() → void
void
If the user agent data object was overridden using setUserAgentData, reset it so that it uses the native browser object instead, if it exists.
setUserAgent( userAgent ) → void
void
Override the user agent string with the given value.
This should only be used for testing within the goog.labs.userAgent
namespace.
Pass null
to use the native browser object instead.
Parameters |
|
---|
setUserAgentData( userAgentData ) → void
void
Override the user agent data object with the given value.
This should only be used for testing within the goog.labs.userAgent
namespace.
Pass null
to specify the absence of userAgentData. Note that this behavior
is different from setUserAgent.
Parameters |
|
---|
Exported Properties
ASSUME_CLIENT_HINTS_SUPPORT → boolean
boolean
No information.