Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

clientInformation

Inherits from NavigatorNavigator

Properties

No properties.

Methods

No methods.

Events

No events.

Inherited from Navigator

Properties

appCodeName
Returns the internal “code” name of the current browser. Do not rely on this property to return the correct value.
appMinorVersion
Retrieves the userAgent application’s minor version value.
appName
appName Returns a string with the name of the browser/user agent. The HTML5 specification also allows any browser to return “Netscape” here, for compatibility reasons.
appVersion
Returns the version of the browser as a string. It may be either a plain version number, like "5.0", or a version number followed by more detailed information. The HTML5 specification also allows any browser to return “4.0” here, for compatibility reasons.

constructor
:

cookieEnabled

Retrieves whether client-side persistent cookies are enabled. Persistent cookies are those that are stored on the client-side computer.

doNotTrack

Returns the user’s do-not-track setting. This is “yes” if the user has requested not to be tracked by web sites, content, or advertising.

maxTouchPoints

The maximum number of simultaneous touch contacts supported by the device.

platform

Retrieves the name of the user’s operating system.

In IE10 and higher and WaterFox browsers this will return the bitness of the current tab. eg

Win32 or Win64.

pointerEnabled

Indicates if the browser will fire pointer events for pointing input.

In late 2013, pointerEnabled was removed from the specification as checking PointerEvent in Window object is sufficient for feature detection. Do not use this property and use PointerEvent instead.

userLanguage

Retrieves the operating system’s natural language setting.

This property reflects the setting in the "Your locale (location)" box in the Regional Options of Control Panel—for example, "English (United States).

Methods

getGamepads
Retrieves a snapshot of the data for the currently connected and interacted-with gamepads. Returns a Gamepad object.
getUserMedia
Prompts the user for permission to use a media device such as a camera or microphone. If the user provides permission, the successCallback is invoked on the calling application with a LocalMediaStream object as its argument.
javaEnabled
This method indicates whether the current browser is Java Run Time Environment-enabled or not.
sendBeacon
Asynchronously queues small amounts of HTTP data for transfer from the user agent to a web server. For example, it can be used to send analytics or diagnostics code without delaying the page’s unload or affecting the performance of the navigation.

Events

No events.

Examples

This example shows how to determine whether the client can run Java applets.

if (window.clientInformation.javaEnabled()) {
    // Java is enabled; applets can run.
}

This example shows how to determine whether the userAgent of the browser contains "MSIE". If it does, the browser is Internet Explorer.

if (window.clientInformation.userAgent.indexOf( "MSIE " ) > 0) {
    // The browser is Microsoft Internet Explorer.
}

Attributions