diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
| commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
| tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/device_memory_api | |
| parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
| download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip | |
initial commit
Diffstat (limited to 'files/ja/web/api/device_memory_api')
| -rw-r--r-- | files/ja/web/api/device_memory_api/index.html | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/files/ja/web/api/device_memory_api/index.html b/files/ja/web/api/device_memory_api/index.html new file mode 100644 index 0000000000..1572424f84 --- /dev/null +++ b/files/ja/web/api/device_memory_api/index.html @@ -0,0 +1,69 @@ +--- +title: Device Memory API +slug: Web/API/Device_Memory_API +tags: + - Device Memory API +translation_of: Web/API/Device_Memory_API +--- +<p>{{DefaultAPISidebar("Device Memory API")}}{{securecontext_header}}{{SeeCompatTable}}</p> + +<p class="summary">クライアントデバイスの能力は、使用可能な RAM の量に大きく依存します。 従来、開発者は経験則を使用し、デバイスのベンチマークを行うか、デバイスの製造元や User Agent 文字列などの他の要因に基づいてデバイスの能力を推測する必要がありました。</p> + +<h2 id="Accessing_device_memory_capacity" name="Accessing_device_memory_capacity">デバイスのメモリ容量へのアクセス</h2> + +<p>RAM デバイスの概算量にアクセスするには、JavaScript API を使用する方法と、クライアントヒント HTTP ヘッダーを使用する方法の2つがあります。</p> + +<h3 id="JavaScript_API" name="JavaScript_API">JavaScript API</h3> + +<p>{{DOMxRef("Navigator.deviceMemory")}} を取得して、RAM デバイスの概算量を照会できます。</p> + +<pre class="brush:js">var ram1 = window.navigator.deviceMemory; +var ram2 = navigator.deviceMemory; +</pre> + +<p>これらは両方とも同じ結果を返します。</p> + +<h3 id="Client_Hints_Header" name="Client_Hints_Header">クライアントヒントのヘッダー</h3> + +<p><a href="/ja/docs/Glossary/Client_hints">クライアントヒント</a>の <code>Device-Memory</code> ディレクティブを使用して、同じ概算の RAM 容量を取得することもできます。</p> + +<h2 id="<h2_id" name=" +<h2 id=">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様</th> + <th scope="col">状態</th> + <th scope="col">コメント</th> + </tr> + <tr> + <td>{{SpecName("Device Memory")}}</td> + <td>{{Spec2("Device Memory")}}</td> + <td>初期定義</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> + +<h3 id="JavaScript_interface" name="JavaScript_interface">JavaScript インターフェイス</h3> + +<div> + + +<p>{{Compat("api.Navigator.deviceMemory")}}</p> + +<h3 id="Client_Hints_extension" name="Client_Hints_extension">クライアントヒント拡張機能</h3> + +<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div> + +<p>{{Compat("http.headers.Device-Memory")}}</p> +</div> + +<h2 id="See_also" name="See_also">関連情報</h2> + +<ul> + <li>{{DOMxRef("Navigator.deviceMemory")}}</li> + <li>{{HTTPHeader("Device-Memory")}} ヘッダー</li> +</ul> |
