userAgent

Classes


Public Protected Private

Global Functions

goog.userAgent.compare(v1v2) number
Use goog.string.compareVersions. Compares two version numbers.
Arguments:
v1 : string
Version of first item.
v2 : string
Version of second item.
Returns: number  1 if first argument is higher 0 if arguments are equal -1 if second argument is higher.
code »
goog.userAgent.determinePlatform_() string
No description.
Returns: 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).
code »
goog.userAgent.determineVersion_() string
No description.
Returns: string  The string that describes the version number of the user agent.
code »
goog.userAgent.getDocumentMode_() number | undefined
No description.
Returns: number | undefined  Returns the document mode (for testing).
code »
goog.userAgent.getNavigator() Object
TODO(nnaze): Change type to "Navigator" and update compilation targets.
Returns: Object  The native navigator object.
code »
goog.userAgent.getUserAgentString() string
Returns the userAgent string for the current browser.
Returns: string  The userAgent string.
code »
goog.userAgent.initPlatform_()
Initialize the goog.userAgent constants that define which platform the user agent is running on.
code »
goog.userAgent.isDocumentMode()
No description.
code »
goog.userAgent.isDocumentMode(version) boolean
Use goog.userAgent.isDocumentModeOrHigher(). Deprecated alias to goog.userAgent.isDocumentModeOrHigher.
Arguments:
version : number
The version to check.
Returns: boolean  Whether the IE effective document mode is higher or the same as the given version.
code »
goog.userAgent.isDocumentModeOrHigher(documentMode) boolean
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.
Arguments:
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.
code »
goog.userAgent.isMobile_() boolean
Whether the user agent is running on a mobile device. This is a separate function so that the logic can be tested. TODO(nnaze): Investigate swapping in goog.labs.userAgent.device.isMobile().
Returns: boolean  Whether the user agent is running on a mobile device.
code »
goog.userAgent.isVersion(version) boolean
Use goog.userAgent.isVersionOrHigher(). Deprecated alias to goog.userAgent.isVersionOrHigher.
Arguments:
version : string | number
The version to check.
Returns: boolean  Whether the user agent version is higher or the same as the given version.
code »
goog.userAgent.isVersionOrHigher(version) boolean
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.
Arguments:
version : string | number
The version to check.
Returns: boolean  Whether the user agent version is higher or the same as the given version.
code »

Global Properties

goog.userAgent.ANDROID :
Whether the user agent is running on Android.
Code »
goog.userAgent.ASSUME_ANDROID :
No description.
Code »
goog.userAgent.ASSUME_ANY_VERSION :
No description.
Code »
goog.userAgent.ASSUME_GECKO :
No description.
Code »
goog.userAgent.ASSUME_IE :
No description.
Code »
goog.userAgent.ASSUME_IPAD :
No description.
Code »
goog.userAgent.ASSUME_IPHONE :
No description.
Code »
goog.userAgent.ASSUME_LINUX :
No description.
Code »
goog.userAgent.ASSUME_MAC :
No description.
Code »
goog.userAgent.ASSUME_MOBILE_WEBKIT :
No description.
Code »
goog.userAgent.ASSUME_OPERA :
No description.
Code »
goog.userAgent.ASSUME_WEBKIT :
No description.
Code »
goog.userAgent.ASSUME_WINDOWS :
No description.
Code »
goog.userAgent.ASSUME_X11 :
No description.
Code »
goog.userAgent.BROWSER_KNOWN_ :
Whether we know the browser engine at compile-time.
Code »
goog.userAgent.CAMINO :
No description.
Code »
goog.userAgent.DOCUMENT_MODE :
For IE version < 7, documentMode is undefined, so attempt to use the CSS1Compat property to see if we are in standards mode. If we are in standards mode, treat the browser version as the document mode. Otherwise, IE is emulating version 5.
Code »
goog.userAgent.GECKO :
Whether the user agent is Gecko. Gecko is the rendering engine used by Mozilla, Firefox, and others.
Code »
goog.userAgent.IE :
Whether the user agent is Internet Explorer.
Code »
goog.userAgent.IPAD :
Whether the user agent is running on an iPad.
Code »
goog.userAgent.IPHONE :
Whether the user agent is running on an iPhone.
Code »
goog.userAgent.LINUX :
Whether the user agent is running on a Linux operating system.
Code »
goog.userAgent.MAC :
Whether the user agent is running on a Macintosh operating system.
Code »
goog.userAgent.MOBILE :
Whether the user agent is running on a mobile device. TODO(nnaze): Consider deprecating MOBILE when labs.userAgent is promoted as the gecko/webkit logic is likely inaccurate.
Code »
goog.userAgent.OPERA :
Whether the user agent is Opera.
Code »
goog.userAgent.PLATFORM :
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).
Code »
goog.userAgent.PLATFORM_KNOWN_ :
No description.
Code »
goog.userAgent.SAFARI :
Used while transitioning code to use WEBKIT instead.
Code »
goog.userAgent.VERSION :
The version of the user agent. This is a string because it might contain 'b' (as in beta) as well as multiple dots.
Code »
goog.userAgent.WEBKIT :
Whether the user agent is WebKit. WebKit is the rendering engine that Safari, Android and others use.
Code »
goog.userAgent.WINDOWS :
Whether the user agent is running on a Windows operating system.
Code »
goog.userAgent.X11 :
Whether the user agent is running on a X11 windowing system.
Code »
goog.userAgent.adobeReader :
No description.
Code »
goog.userAgent.adobeReaderTest :
No description.
Code »
goog.userAgent.detectedAndroid_ :
Whether the user agent is running on Android.
Code »
goog.userAgent.detectedIPad_ :
Whether the user agent is running on an iPad.
Code »
goog.userAgent.detectedIPhone_ :
Whether the user agent is running on an iPhone.
Code »
goog.userAgent.detectedLinux_ :
Whether the user agent is running on a Linux operating system.
Code »
goog.userAgent.detectedMac_ :
Whether the user agent is running on a Macintosh operating system.
Code »
goog.userAgent.detectedWindows_ :
Whether the user agent is running on a Windows operating system.
Code »
goog.userAgent.detectedX11_ :
Whether the user agent is running on a X11 windowing system.
Code »
goog.userAgent.flash :
No description.
Code »
goog.userAgent.flashTest :
No description.
Code »
goog.userAgent.iphoto :
No description.
Code »
goog.userAgent.isVersionOrHigherCache_ :
Cache for goog.userAgent.isVersionOrHigher. Calls to compareVersions are surprisingly expensive and, as a browser's version number is unlikely to change during a session, we cache the results.
Code »
goog.userAgent.jscript :
No description.
Code »
goog.userAgent.jscriptTest :
No description.
Code »
goog.userAgent.keyboard :
No description.
Code »
goog.userAgent.keyboardTest :
No description.
Code »
goog.userAgent.picasa :
No description.
Code »
goog.userAgent.platform :
No description.
Code »
goog.userAgent.platformTest :
No description.
Code »
goog.userAgent.product :
No description.
Code »
goog.userAgent.productTest :
No description.
Code »

Package userAgent

Package Reference