Window.navigator

  • Revision slug: DOM/window.navigator
  • Revision title: window.navigator
  • Revision id: 15546
  • Created:
  • Creator: Blueray
  • Is current revision? No
  • Comment /* Properties */

Revision Content

{{template.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.
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 build number / build date of the current browser. (e.g. "20060909")
navigator.productSub 
Returns the product version number (e.g. "5.0")
navigator.securityPolicy 
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.taintEnabled {{template.Obsolete_inline()}} 
Returns false. JavaScript taint/untaint functions removed in JavaScript 1.2
navigator.preference 
Sets a user preference. This method is only available to privileged code, and you should use XPCOM Preferences API instead.
navigator.registerContentHandler 
Allows web sites to register themselves as a possible handler for a given MIME type.
navigator.registerProtocolHandler 
Allows web sites to register themselves as a possible handler for a given protocol.

See also

DOM Client Object Cross-Reference:navigator

Specification

{{template.DOM0()}}

{{ wiki.languages( { "fr": "fr/DOM/window.navigator" } ) }}

Revision Source

<p>
{{template.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/Navigator.appCodeName">navigator.appCodeName</a> </dt><dd> Returns the internal "code" name of the current browser.
</dd><dt> <a href="en/Navigator.appName">navigator.appName</a> </dt><dd> Returns the official name of the browser.
</dd><dt> <a href="en/Navigator.appVersion">navigator.appVersion</a> </dt><dd> Returns the version of the browser as a string.
</dd><dt> <a href="en/Navigator.buildID">navigator.buildID</a> </dt><dd> Returns the build identifier of the browser (e.g. "2006090803")
</dd><dt> <a href="en/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/Navigator.language">navigator.language</a> </dt><dd> Returns a string representing the language version of the browser.
</dd><dt> <a href="en/Navigator.mimeTypes">navigator.mimeTypes</a> </dt><dd> Returns a list of the MIME types supported by the browser.
</dd><dt> <a href="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/Navigator.oscpu">navigator.oscpu</a> </dt><dd> Returns a string that represents the current operating system.
</dd><dt> <a href="en/Navigator.platform">navigator.platform</a> </dt><dd> Returns a string representing the platform of the browser.
</dd><dt> <a href="en/Navigator.plugins">navigator.plugins</a> </dt><dd> Returns an array of the plugins installed in the browser.
</dd><dt> <a href="en/Navigator.product">navigator.product</a> </dt><dd> Returns the build number / build date of the current browser. (e.g. "20060909")
</dd><dt> <a href="en/Navigator.productSub">navigator.productSub</a> </dt><dd> Returns the product version number (e.g. "5.0")
</dd><dt> <a href="en/DOM/window.navigator.securityPolicy">navigator.securityPolicy</a> </dt><dd> Returns an empty string.  In Netscape 4.7x, returns "US &amp; CA domestic policy" or "Export policy".
</dd><dt> <a href="en/Navigator.userAgent">navigator.userAgent</a> </dt><dd> Returns the user agent string for the current browser.
</dd><dt> <a href="en/Navigator.vendor">navigator.vendor</a> </dt><dd> Returns the vendor name of the current browser (e.g. "Netscape6")
</dd><dt> <a href="en/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/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.taintEnabled">navigator.taintEnabled</a> {{template.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><dt><a class="external" href="http://devedge-temp.mozilla.org/library/manuals/2000/javascript/1.3/reference/nav.html#1194117"> </a><a href="en/DOM/window.navigator.preference">navigator.preference</a> </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 you should use XPCOM <a href="en/Preferences_API">Preferences API</a> instead.
</dd><dt> <a href="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">navigator.registerProtocolHandler</a> </dt><dd> Allows web sites to register themselves as a possible handler for a given protocol.
</dd></dl>
<h3 name="See_also"> See also </h3>
<p><a href="en/DOM_Client_Object_Cross-Reference/navigator">DOM Client Object Cross-Reference:navigator</a>
</p>
<h3 name="Specification"> Specification </h3>
<p>{{template.DOM0()}}
</p>{{ wiki.languages( { "fr": "fr/DOM/window.navigator" } ) }}
Revert to this revision