Window.navigator

  • Revision slug: DOM/window.navigator
  • Revision title: window.navigator
  • Revision id: 15568
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment use templates where possible; 280 words added, 5 words removed

Revision Content

{{ DomRef() }}

Summary

Returns a reference to the navigator object, which can be queried for information about the application running the script.

Example

alert("You're using " + navigator.appName);

Properties

{{ domxref("window.navigator.appCodeName", "navigator.appCodeName") }}
Returns the internal "code" name of the current browser.
{{ domxref("window.navigator.appName", "navigator.appName") }}
Returns the official name of the browser.
{{ domxref("window.navigator.appVersion", "navigator.appVersion") }}
Returns the version of the browser as a string.
{{ domxref("window.navigator.buildID", "navigator.buildID") }}
Returns the build identifier of the browser (e.g. "2006090803")
{{ domxref("window.navigator.cookieEnabled", "navigator.cookieEnabled") }}
Returns a boolean indicating whether cookies are enabled in the browser or not.
{{ domxref("navigator.doNotTrack") }} {{ non-standard_inline() }}
Reports the value of the user's do-not-track preference. When this value is "yes", your web site or application should not track the user.
{{ domxref("window.navigator.language", "navigator.language") }}
Returns a string representing the language version of the browser.
{{ domxref("window.navigator.mimeTypes", "navigator.mimeTypes") }}
Returns a list of the MIME types supported by the browser.
{{ domxref("window.navigator.mozBattery", "navigator.mozBattery") }} {{ gecko_minversion_inline("10.0") }}
Returns a {{ domxref("window.navigator.mozBattery", "battery") }} object you can use to get information about the battery charging status.
{{ domxref("navigator.mozNotification") }} {{ MobileOnlyInline("2.0") }} {{ non-standard_inline() }}
{{ domxref("navigator.webkitNotification") }}
Returns a {{ domxref("navigator.mozNotification", "notification") }} object you can use to deliver notifications to the user from your web application.
{{ domxref("window.navigator.onLine", "navigator.onLine") }}
Returns a boolean indicating whether the browser is working online.
{{ domxref("window.navigator.oscpu", "navigator.oscpu") }}
Returns a string that represents the current operating system.
{{ domxref("window.navigator.platform", "navigator.platform") }}
Returns a string representing the platform of the browser.
{{ domxref("window.navigator.plugins", "navigator.plugins") }}
Returns an array of the plugins installed in the browser.
{{ domxref("window.navigator.product", "navigator.product") }}
Returns the product name of the current browser. (e.g. "Gecko")
{{ domxref("window.navigator.productSub", "navigator.productSub") }}
Returns the build number of the current browser (e.g. "20060909")
{{ domxref("window.navigator.securitypolicy", "navigator.securitypolicy") }}
Returns an empty string. In Netscape 4.7x, returns "US & CA domestic policy" or "Export policy".
{{ domxref("window.navigator.userAgent", "navigator.userAgent") }}
Returns the user agent string for the current browser.
{{ domxref("window.navigator.vendor", "navigator.vendor") }}
Returns the vendor name of the current browser (e.g. "Netscape6")
{{ domxref("window.navigator.vendorSub", "navigator.vendorSub") }}
Returns the vendor version number (e.g. "6.1")
navigator.webkitPointer
Returns a PointerLock object for the Mouse Lock API.

Methods

{{ domxref("window.navigator.javaEnabled", "navigator.javaEnabled") }}
Indicates whether the host browser is Java-enabled or not.
{{ domxref("window.navigator.mozIsLocallyAvailable", "navigator.mozIsLocallyAvailable") }}
Lets code check to see if the document at a given URI is available without using the network.
{{ domxref("window.navigator.preference", "navigator.preference") }} {{ obsolete_inline("2.0") }}
Sets a user preference. This method is only available to privileged code and is obsolete; you should use the XPCOM Preferences API instead.
{{ domxref("window.navigator.registerContentHandler", "navigator.registerContentHandler") }}
Allows web sites to register themselves as a possible handler for a given MIME type.
{{ domxref("window.navigator.registerProtocolHandler", "navigator.registerProtocolHandler") }} {{ Fx_minversion_inline("3") }}
Allows web sites to register themselves as a possible handler for a given protocol.
{{ domxref("window.navigator.taintEnabled", "navigator.taintEnabled") }} {{ Obsolete_inline("1.7.8") }}
Returns false. JavaScript taint/untaint functions removed in JavaScript 1.2.

See also

Specification

{{ languages( { "fr": "fr/DOM/window.navigator", "ja": "ja/DOM/window.navigator", "pl": "pl/DOM/window.navigator" } ) }}

Revision Source

<p>{{ DomRef() }}</p>
<h3>Summary</h3>
<p>Returns a reference to the navigator object, which can be queried for information about the application running the script.</p>
<h3>Example</h3>
<pre class="eval">alert("You're using " + navigator.appName);
</pre>
<h3>Properties</h3>
<dl> <dt>{{ domxref("window.navigator.appCodeName", "navigator.appCodeName") }}</dt> <dd>Returns the internal "code" name of the current browser.</dd> <dt>{{ domxref("window.navigator.appName", "navigator.appName") }}</dt> <dd>Returns the official name of the browser.</dd> <dt>{{ domxref("window.navigator.appVersion", "navigator.appVersion") }}</dt> <dd>Returns the version of the browser as a string.</dd> <dt>{{ domxref("window.navigator.buildID", "navigator.buildID") }}</dt> <dd>Returns the build identifier of the browser (e.g. "2006090803")</dd> <dt>{{ domxref("window.navigator.cookieEnabled", "navigator.cookieEnabled") }}</dt> <dd>Returns a boolean indicating whether cookies are enabled in the browser or not.</dd> <dt>{{ domxref("navigator.doNotTrack") }} {{ non-standard_inline() }}</dt> <dd>Reports the value of the user's do-not-track preference. When this value is "yes", your web site or application should not track the user.</dd> <dt>{{ domxref("window.navigator.language", "navigator.language") }}</dt> <dd>Returns a string representing the language version of the browser.</dd> <dt>{{ domxref("window.navigator.mimeTypes", "navigator.mimeTypes") }}</dt> <dd>Returns a list of the MIME types supported by the browser.</dd> <dt>{{ domxref("window.navigator.mozBattery", "navigator.mozBattery") }} {{ gecko_minversion_inline("10.0") }}</dt> <dd>Returns a {{ domxref("window.navigator.mozBattery", "battery") }} object you can use to get information about the battery charging status.</dd> <dt>{{ domxref("navigator.mozNotification") }} {{ MobileOnlyInline("2.0") }} {{ non-standard_inline() }}<br> {{ domxref("navigator.webkitNotification") }}</dt> <dd>Returns a {{ domxref("navigator.mozNotification", "notification") }} object you can use to deliver notifications to the user from your web application.</dd> <dt>{{ domxref("window.navigator.onLine", "navigator.onLine") }}</dt> <dd>Returns a boolean indicating whether the browser is working online.</dd> <dt>{{ domxref("window.navigator.oscpu", "navigator.oscpu") }}</dt> <dd>Returns a string that represents the current operating system.</dd> <dt>{{ domxref("window.navigator.platform", "navigator.platform") }}</dt> <dd>Returns a string representing the platform of the browser.</dd> <dt>{{ domxref("window.navigator.plugins", "navigator.plugins") }}</dt> <dd>Returns an array of the plugins installed in the browser.</dd> <dt>{{ domxref("window.navigator.product", "navigator.product") }}</dt> <dd>Returns the product name of the current browser. (e.g. "Gecko")</dd> <dt>{{ domxref("window.navigator.productSub", "navigator.productSub") }}</dt> <dd>Returns the build number of the current browser (e.g. "20060909")</dd> <dt>{{ domxref("window.navigator.securitypolicy", "navigator.securitypolicy") }}</dt> <dd>Returns an empty string. In Netscape 4.7x, returns "US &amp; CA domestic policy" or "Export policy".</dd> <dt>{{ domxref("window.navigator.userAgent", "navigator.userAgent") }}</dt> <dd>Returns the user agent string for the current browser.</dd> <dt>{{ domxref("window.navigator.vendor", "navigator.vendor") }}</dt> <dd>Returns the vendor name of the current browser (e.g. "Netscape6")</dd> <dt>{{ domxref("window.navigator.vendorSub", "navigator.vendorSub") }}</dt> <dd>Returns the vendor version number (e.g. "6.1")</dd> <dt><a href="/en/API/Mouse_Lock_API" title="Mouse Lock API">navigator.webkitPointer</a></dt> <dd>Returns a PointerLock object for the <a href="/en/API/Mouse_Lock_API" title="Mouse Lock API">Mouse Lock API</a>.</dd>
</dl>
<h3>Methods</h3>
<dl> <dt>{{ domxref("window.navigator.javaEnabled", "navigator.javaEnabled") }}</dt> <dd>Indicates whether the host browser is Java-enabled or not.</dd> <dt>{{ domxref("window.navigator.mozIsLocallyAvailable", "navigator.mozIsLocallyAvailable") }}</dt> <dd>Lets code check to see if the document at a given URI is available without using the network.</dd> <dt>{{ domxref("window.navigator.preference", "navigator.preference") }} {{ obsolete_inline("2.0") }}</dt> <dd>Sets a user preference. This method is <a class="external" href="http://www.faqts.com/knowledge_base/view.phtml/aid/1608/fid/125/lang/en">only available to privileged code</a> and is obsolete; you should use the XPCOM <a href="/en/Preferences_API" title="en/Preferences_API">Preferences API</a> instead.</dd> <dt>{{ domxref("window.navigator.registerContentHandler", "navigator.registerContentHandler") }}</dt> <dd>Allows web sites to register themselves as a possible handler for a given MIME type.</dd> <dt>{{ domxref("window.navigator.registerProtocolHandler", "navigator.registerProtocolHandler") }} {{ Fx_minversion_inline("3") }}</dt> <dd>Allows web sites to register themselves as a possible handler for a given protocol.</dd> <dt>{{ domxref("window.navigator.taintEnabled", "navigator.taintEnabled") }} {{ Obsolete_inline("1.7.8") }}</dt> <dd>Returns <code>false</code>. JavaScript taint/untaint functions removed in JavaScript 1.2.</dd>
</dl>
<h3>See also</h3>
<ul> <li><a href="/en/DOM_Client_Object_Cross-Reference/navigator" title="en/DOM_Client_Object_Cross-Reference/navigator">DOM Client Object Cross-Reference:navigator</a></li>
</ul>
<h3>Specification</h3>
<ul> <li>Defined in <a class="external" href="http://www.whatwg.org/html/#navigator" title="http://www.whatwg.org/html/#navigator">HTML</a>.</li>
</ul>
<p>{{ languages( { "fr": "fr/DOM/window.navigator", "ja": "ja/DOM/window.navigator", "pl": "pl/DOM/window.navigator" } ) }}</p>
Revert to this revision