Navigator.oscpu

  • Revision slug: Web/API/window.navigator.oscpu
  • Revision title: window.navigator.oscpu
  • Revision id: 407117
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 18 words addedMoved From DOM/window.navigator.oscpu to Web/API/window.navigator.oscpu

Revision Content

{{ DomRef() }}

Summary

Returns a string that identifies the current operating system.

Syntax

oscpuInfo = window.navigator.oscpu 
  • oscpuInfo is a string that takes the following form:
Operating system oscpuInfo string format
OS/2 OS/2 Warp x (either 3, 4 or 4.5)
Windows CE WindowsCE x.y1
Windows 64-bit (64-bit build) Windows NT x.y; Win64; x64
Windows 64-bit (32-bit build) Windows NT x.y; WOW64
Windows 32-bit Windows NT x.y
Mac OS X (PPC build) PPC Mac OS X x.y
Mac OS X (i386/x64 build) Intel Mac OS X x.y
Linux 64-bit (32-bit build) Output of uname -s plus "i686 on x86_64"
Linux Output of uname -sm

1x.y refers to the version of the operating system

Example

function osInfo() { 
  alert(window.navigator.oscpu); 
}
// returns: "Windows NT 6.0" for example

Notes

Unless your code is privileged (chrome or at least has the UniversalBrowserRead privilege), it may get the value of the general.oscpu.override preference instead of the true platform.

Specification

{{ DOM0() }}

{{ languages( { "ja": "ja/DOM/window.navigator.oscpu", "zh-cn": "zh-cn/DOM/window.navigator.oscpu", "pl": "pl/DOM/window.navigator.oscpu" } ) }}

Revision Source

<p>{{ DomRef() }}</p>
<h3 id="Summary" name="Summary">Summary</h3>
<p>Returns a string that identifies the current operating system.</p>
<h3 id="Syntax" name="Syntax">Syntax</h3>
<pre class="eval"><em>oscpuInfo</em> = window.navigator.oscpu 
</pre>
<ul> <li><code>oscpuInfo</code> is a string that takes the following form:</li>
</ul>
<table class="fullwidth-table"> <tbody> <tr> <th>Operating system</th> <th><code>oscpuInfo</code> string format</th> </tr> <tr> <td>OS/2</td> <td>OS/2 Warp x (either 3, 4 or 4.5)</td> </tr> <tr> <td>Windows CE</td> <td>WindowsCE x.y<sup>1</sup></td> </tr> <tr> <td>Windows 64-bit (64-bit build)</td> <td>Windows NT x.y; Win64; x64</td> </tr> <tr> <td>Windows 64-bit (32-bit build)</td> <td>Windows NT x.y; WOW64</td> </tr> <tr> <td>Windows 32-bit</td> <td>Windows NT x.y</td> </tr> <tr> <td>Mac OS X (PPC build)</td> <td>PPC Mac OS X x.y</td> </tr> <tr> <td>Mac OS X (i386/x64 build)</td> <td>Intel Mac OS X x.y</td> </tr> <tr> <td>Linux 64-bit (32-bit build)</td> <td>Output of uname -s plus "i686 on x86_64"</td> </tr> <tr> <td>Linux</td> <td>Output of uname -sm</td> </tr> </tbody>
</table>
<p><sup>1</sup>x.y refers to the version of the operating system</p>
<h3 id="Example" name="Example">Example</h3>
<pre class="brush: js">function osInfo() { 
  alert(window.navigator.oscpu); 
}
// returns: "Windows NT 6.0" for example
</pre>
<h3 id="Notes" name="Notes">Notes</h3>
<p>Unless your code is privileged (chrome or at least has the UniversalBrowserRead privilege), it may get the value of the <code>general.oscpu.override</code> preference instead of the true platform.</p>
<h3 id="Specification" name="Specification">Specification</h3>
<p>{{ DOM0() }}</p>
<p>{{ languages( { "ja": "ja/DOM/window.navigator.oscpu", "zh-cn": "zh-cn/DOM/window.navigator.oscpu", "pl": "pl/DOM/window.navigator.oscpu" } ) }}</p>
Revert to this revision