goog.labs.userAgent.platform
Exported Functions
getVersion() → string
string
The version of the platform. We only determine the version for Windows, Mac, and Chrome OS. It doesn't make much sense on Linux. For Windows, we only look at the NT version. Non-NT-based versions (e.g. 95, 98, etc.) are given version 0.0.
Parameters | None. | ||
---|---|---|---|
Returns |
|
isAndroid() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
isChromeOS() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
isChromecast() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
isIos() → boolean
boolean
Returns whether the platform is iOS.
Note that iPadOS 13+ spoofs macOS Safari by default in its user agent, and in
this scenario the platform will not be recognized as iOS. If you must have
iPad-specific behavior, use
goog.labs.userAgent.extra.isSafariDesktopOnMobile
.
Parameters | None. | ||
---|---|---|---|
Returns |
|
isIpad() → boolean
boolean
Returns whether the platform is iPad.
Note that iPadOS 13+ spoofs macOS Safari by default in its user agent, and in
this scenario the platform will not be recognized as iPad. If you must have
iPad-specific behavior, use
goog.labs.userAgent.extra.isSafariDesktopOnMobile
.
Parameters | None. | ||
---|---|---|---|
Returns |
|
isIphone() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
isIpod() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
isKaiOS() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
isLinux() → boolean
boolean
Note: ChromeOS is not considered to be Linux as it does not report itself as Linux in the user agent string.
Parameters | None. | ||
---|---|---|---|
Returns |
|
isMacintosh() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|
isVersionOrHigher( version ) → boolean
boolean
isWindows() → boolean
boolean
Parameters | None. | ||
---|---|---|---|
Returns |
|