NavigatorID.product

  • Revision slug: Web/API/Navigator.product
  • Revision title: Navigator.product
  • Revision id: 458401
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment Moved From Web/API/window.navigator.product to Web/API/Navigator.product

Revision Content

{{DomRef}}

Summary

This property returns the product name of the current browser.

Note: Do not rely on this property to return a real product name. Both Gecko and WebKit browsers return "Gecko" as the value of this property.

Syntax

productName = window.navigator.product 
  • productName is a string.

Example

<script>
function prod() { 
  dt = document.getElementById("d"); 
  dt.innerHTML = window.navigator.product; 
}
</script> 

<button onclick="prod();">product</button> 
<div id="d"> </div> 
<!-- returns "Gecko" -->

Notes

In Gecko-based browsers the product matches the portion of the full user agent string that comes directly after the platform. In the user agent for Netscape 6.1, for example, the product is "Gecko" and the full agent string is the following: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1.

In WebKit-based browsers the product is returned as "Gecko" even though the portion of the full user agent string directly after the platform is actually the following: (KHTML, like Gecko).

Specification

{{dom0}}

Revision Source

<div>
  {{DomRef}}</div>
<h2 id="Summary" name="Summary">Summary</h2>
<p>This property returns the product name of the current browser.</p>
<div class="note">
  <strong>Note:</strong> Do not rely on this property to return a real product name. Both Gecko and WebKit browsers return "Gecko" as the value of this property.</div>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">
<i>productName</i> = window.navigator.product 
</pre>
<ul>
  <li><code>productName</code> is a string.</li>
</ul>
<h2 id="Example" name="Example">Example</h2>
<pre class="brush: html">
&lt;script&gt;
function prod() { 
  dt = document.getElementById("d"); 
  dt.innerHTML = window.navigator.product; 
}
&lt;/script&gt; 

&lt;button onclick="prod();"&gt;product&lt;/button&gt; 
&lt;div id="d"&gt;&nbsp;&lt;/div&gt; 
&lt;!-- returns "Gecko" --&gt;
</pre>
<h2 id="Notes" name="Notes">Notes</h2>
<p>In Gecko-based browsers the <code>product</code> matches the portion of the full user agent string that comes directly after the platform. In the user agent for Netscape 6.1, for example, the product is "<code>Gecko</code>" and the full agent string is the following: <code>Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1</code>.</p>
<p>In WebKit-based browsers the <code>product</code> is returned as "<code>Gecko</code>" even though the portion of the full user agent string directly after the platform is actually the following: <code>(KHTML, like Gecko)</code>.</p>
<h2 id="Specification" name="Specification">Specification</h2>
<p>{{dom0}}</p>
Revert to this revision