Navigator: deviceMemory プロパティ

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。

deviceMemoryNavigator インターフェイスの読み取り専用プロパティで、端末のおよそのメモリー量をギガバイト単位で返します。

報告される値は、フィンガープリンティングを抑制するために概数になっています。この値は、最も近い 2 の累乗に切り捨て、その値を 1024 で割ることによって概算されています。その後、メモリーが非常に少ない、または非常に多い端末の所有者のプライバシーを保護するため、下限と上限の範囲内に丸められます。

浮動小数点値で 0.25, 0.5, 1, 2, 4, 8 のうちのいずれかです。

js
const memory = navigator.deviceMemory;
console.log(`この端末には ${memory}GiB 以上の RAM があります。`);

仕様書

Specification
Device Memory
# sec-device-memory-js-api

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
deviceMemory

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

関連情報