Window.navigator

  • Revision slug: DOM/window.navigator
  • Revision title: window.navigator
  • Revision id: 15559
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 6 words added

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

navigator.appCodeName 
Returns the internal "code" name of the current browser.
navigator.appName 
Returns the official name of the browser.
navigator.appVersion 
Returns the version of the browser as a string.
navigator.buildID 
Returns the build identifier of the browser (e.g. "2006090803")
navigator.cookieEnabled 
Returns a boolean indicating whether cookies are enabled in the browser or not.
navigator.language 
Returns a string representing the language version of the browser.
navigator.mimeTypes 
Returns a list of the MIME types supported by the browser.
{{ domxref("navigator.mozNotification") }} {{ gecko_minversion_inline("2.0") }} {{ MobileOnlyInline("2.0") }} {{ non-standard_inline() }}
Returns a {{ domxref("navigator.mozNotification", "mozNotification") }} object you can use to deliver notifications to the user from your web application.
navigator.onLine 
Returns a boolean indicating whether the browser is working online.
navigator.oscpu 
Returns a string that represents the current operating system.
navigator.platform 
Returns a string representing the platform of the browser.
navigator.plugins 
Returns an array of the plugins installed in the browser.
navigator.product 
Returns the product name of the current browser. (e.g. "Gecko")
navigator.productSub 
Returns the build number of the current browser (e.g. "20060909")
navigator.securityPolicy {{ Obsolete_inline() }}
Returns an empty string. In Netscape 4.7x, returns "US & CA domestic policy" or "Export policy".
navigator.userAgent 
Returns the user agent string for the current browser.
navigator.vendor 
Returns the vendor name of the current browser (e.g. "Netscape6")
navigator.vendorSub 
Returns the vendor version number (e.g. "6.1")

Methods

navigator.javaEnabled 
Indicates whether the host browser is Java-enabled or not.
navigator.mozIsLocallyAvailable 
Lets code check to see if the document at a given URI is available without using the network.
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.
navigator.registerContentHandler 
Allows web sites to register themselves as a possible handler for a given MIME type.
navigator.registerProtocolHandler {{ Fx_minversion_inline("3") }} 
Allows web sites to register themselves as a possible handler for a given protocol.
navigator.taintEnabled {{ Obsolete_inline() }} 
Returns false. JavaScript taint/untaint functions removed in JavaScript 1.2

See also

DOM Client Object Cross-Reference:navigator

Specification

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

Revision Source

<p>{{ DomRef() }}</p>
<h3 name="Summary">Summary</h3>
<p>Returns a reference to the navigator object, which can be queried for information about the application running the script.</p>
<h3 name="Example">Example</h3>
<pre class="eval">alert("You're using " + navigator.appName);
</pre>
<h3 name="Properties">Properties</h3>
<dl> <dt><a href="/en/DOM/window.navigator.appCodeName" title="en/DOM/window.navigator.appCodeName">navigator.appCodeName</a> </dt> <dd>Returns the internal "code" name of the current browser.</dd> <dt><a href="/en/DOM/window.navigator.appName" title="en/DOM/window.navigator.appName">navigator.appName</a> </dt> <dd>Returns the official name of the browser.</dd> <dt><a href="/en/DOM/window.navigator.appVersion" title="en/DOM/window.navigator.appVersion">navigator.appVersion</a> </dt> <dd>Returns the version of the browser as a string.</dd> <dt><a href="/en/DOM/window.navigator.buildID" title="en/DOM/window.navigator.buildID">navigator.buildID</a> </dt> <dd>Returns the build identifier of the browser (e.g. "2006090803")</dd> <dt><a href="/en/DOM/window.navigator.cookieEnabled" title="en/DOM/window.navigator.cookieEnabled">navigator.cookieEnabled</a> </dt> <dd>Returns a boolean indicating whether cookies are enabled in the browser or not.</dd> <dt><a href="/en/DOM/window.navigator.language" title="en/DOM/window.navigator.language">navigator.language</a> </dt> <dd>Returns a string representing the language version of the browser.</dd> <dt><a href="/en/DOM/window.navigator.mimeTypes" title="en/DOM/window.navigator.mimeTypes">navigator.mimeTypes</a> </dt> <dd>Returns a list of the MIME types supported by the browser.</dd> <dt>{{ domxref("navigator.mozNotification") }} {{ gecko_minversion_inline("2.0") }} {{ MobileOnlyInline("2.0") }} {{ non-standard_inline() }}</dt> <dd>Returns a {{ domxref("navigator.mozNotification", "mozNotification") }} object you can use to deliver notifications to the user from your web application.</dd> <dt><a href="/en/DOM/window.navigator.onLine" title="en/DOM/window.navigator.onLine">navigator.onLine</a> </dt> <dd>Returns a boolean indicating whether the browser is working online.</dd> <dt><a href="/en/DOM/window.navigator.oscpu" title="en/DOM/window.navigator.oscpu">navigator.oscpu</a> </dt> <dd>Returns a string that represents the current operating system.</dd> <dt><a href="/en/DOM/window.navigator.platform" title="en/DOM/window.navigator.platform">navigator.platform</a> </dt> <dd>Returns a string representing the platform of the browser.</dd> <dt><a href="/en/DOM/window.navigator.plugins" title="en/DOM/window.navigator.plugins">navigator.plugins</a> </dt> <dd>Returns an array of the plugins installed in the browser.</dd> <dt><a href="/en/DOM/window.navigator.product" title="en/DOM/window.navigator.product">navigator.product</a> </dt> <dd>Returns the product name of the current browser. (e.g. "Gecko")</dd> <dt><a href="/en/DOM/window.navigator.productSub" title="en/DOM/window.navigator.productSub">navigator.productSub</a> </dt> <dd>Returns the build number of the current browser (e.g. "20060909")</dd> <dt><a href="/en/DOM/window.navigator.securityPolicy" title="en/DOM/window.navigator.securityPolicy">navigator.securityPolicy</a> {{ Obsolete_inline() }}</dt> <dd>Returns an empty string. In Netscape 4.7x, returns "US &amp; CA domestic policy" or "Export policy".</dd> <dt><a href="/en/DOM/window.navigator.userAgent" title="en/DOM/window.navigator.userAgent">navigator.userAgent</a> </dt> <dd>Returns the user agent string for the current browser.</dd> <dt><a href="/en/DOM/window.navigator.vendor" title="en/DOM/window.navigator.vendor">navigator.vendor</a> </dt> <dd>Returns the vendor name of the current browser (e.g. "Netscape6")</dd> <dt><a href="/en/DOM/window.navigator.vendorSub" title="en/DOM/window.navigator.vendorSub">navigator.vendorSub</a> </dt> <dd>Returns the vendor version number (e.g. "6.1")</dd>
</dl><h3 name="Methods">Methods</h3>
<dl> <dt><a href="/en/DOM/window.navigator.javaEnabled" title="en/DOM/window.navigator.javaEnabled">navigator.javaEnabled</a> </dt> <dd>Indicates whether the host browser is Java-enabled or not.</dd> <dt><a href="/en/DOM/window.navigator.mozIsLocallyAvailable" title="en/DOM/window.navigator.mozIsLocallyAvailable">navigator.mozIsLocallyAvailable</a> </dt> <dd>Lets code check to see if the document at a given URI is available without using the network.</dd> <dt><a href="/en/DOM/window.navigator.preference" title="en/DOM/window.navigator.preference">navigator.preference</a> {{ 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><a href="/en/DOM/window.navigator.registerContentHandler" title="en/DOM/window.navigator.registerContentHandler">navigator.registerContentHandler</a> </dt> <dd>Allows web sites to register themselves as a possible handler for a given MIME type.</dd> <dt><a href="/en/DOM/window.navigator.registerProtocolHandler" title="en/DOM/window.navigator.registerProtocolHandler">navigator.registerProtocolHandler</a> {{ Fx_minversion_inline("3") }} </dt> <dd>Allows web sites to register themselves as a possible handler for a given protocol.</dd> <dt><a href="/en/DOM/window.navigator.taintEnabled" title="en/DOM/window.navigator.taintEnabled">navigator.taintEnabled</a> {{ Obsolete_inline() }} </dt> <dd>Returns false. JavaScript taint/untaint functions removed in JavaScript 1.2<a class="external" href="http://devedge-temp.mozilla.org/library/manuals/2000/javascript/1.3/reference/nav.html#1194117"></a></dd>
</dl>
<h3 name="See_also">See also</h3>
<p><a href="/en/DOM_Client_Object_Cross-Reference/navigator" title="en/DOM_Client_Object_Cross-Reference/navigator">DOM Client Object Cross-Reference:navigator</a></p>
<h3 name="Specification">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