blob: dc2f2e8ed2c21acc3afe6e98c41ef35be2ce5702 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
---
title: Navigator.oscpu
slug: Web/API/Navigator/oscpu
tags:
- API
- CPU
- HTML DOM
- Navigator
- NavigatorID
- Property
- Reference
- oscpu
- processor
translation_of: Web/API/Navigator/oscpu
---
<p>{{ ApiRef("HTML DOM") }}</p>
<p><code><strong>Navigator.oscpu</strong></code> プロパティは、現在のオペレーティングシステムを識別する文字列を返します。</p>
<h2 id="Syntax" name="Syntax">構文</h2>
<pre class="eval notranslate"><var>oscpuInfo</var> = navigator.oscpu
</pre>
<h3 id="Value" name="Value">値</h3>
<p>{{domxref("DOMString")}} はブラウザーが実行されているオペレーティングシステムを識別する文字列を提供します。</p>
<table class="standard-table">
<tbody>
<tr>
<th>オペレーティングシステム</th>
<th><code>oscpuInfo</code> の文字列形式</th>
</tr>
<tr>
<td>OS/2</td>
<td>OS/2 Warp x (3, 4, 4.5 のいずれか)</td>
</tr>
<tr>
<td>Windows CE</td>
<td>WindowsCE x.y<sup>1</sup></td>
</tr>
<tr>
<td>Windows 64-bit (64ビット版)</td>
<td>Windows NT x.y; Win64; x64</td>
</tr>
<tr>
<td>Windows 64-bit (32ビット版)</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 版)</td>
<td>PowerPC Mac OS X version x.y</td>
</tr>
<tr>
<td>Mac OS X (i386/x64 版)</td>
<td>Intel Mac OS X or macOS version x.y</td>
</tr>
<tr>
<td>Linux 64ビット (32ビット版)</td>
<td><code>uname -s</code> の出力結果に <code>i686 on x86_64</code>を加えたもの</td>
</tr>
<tr>
<td>Linux</td>
<td><code>uname -sm</code> の出力結果</td>
</tr>
</tbody>
</table>
<ol>
<li>x.y はオペレーティングシステムのバージョンを参照</li>
</ol>
<h2 id="Example" name="Example">例</h2>
<pre class="brush: js notranslate">function osInfo() {
alert(window.navigator.oscpu);
}
osInfo(); // alerts "Windows NT 6.0" for example
</pre>
<h2 id="Usage_notes" name="Usage_notes">使用上の注意</h2>
<p>コードが特権 ({{Glossary("Chrome", "クローム")}}であるか、少なくとも UniversalBrowserRead privilege) を持っていない場合は、実際のプラットフォームの代わりに <code>general.oscpu.override</code> 設定の値が得られる可能性があります。</p>
<h2 id="Specifications" name="Specifications">仕様書</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">仕様書</th>
<th scope="col">状態</th>
<th scope="col">備考</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('HTML WHATWG', '#dom-navigator-oscpu', 'NavigatorID: oscpu')}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td>初回定義</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
<p>{{Compat("api.Navigator.oscpu")}}</p>
|