From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/document/hasstorageaccess/index.html | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 files/ja/web/api/document/hasstorageaccess/index.html (limited to 'files/ja/web/api/document/hasstorageaccess') diff --git a/files/ja/web/api/document/hasstorageaccess/index.html b/files/ja/web/api/document/hasstorageaccess/index.html new file mode 100644 index 0000000000..c1be7b0324 --- /dev/null +++ b/files/ja/web/api/document/hasstorageaccess/index.html @@ -0,0 +1,57 @@ +--- +title: Document.hasStorageAccess() +slug: Web/API/Document/hasStorageAccess +tags: + - API + - DOM + - Document + - Reference + - Storage Access API + - hasStorageAccess + - メソッド +translation_of: Web/API/Document/hasStorageAccess +--- +
{{APIRef}}{{seecompattable}}
+ +

{{domxref("Document")}} インターフェイスの hasStorageAccess() メソッドは、文書がファーストパーティのストレージへのアクセス権を持っているかどうかを真偽値で解決する {{jsxref("Promise")}} を返します。

+ +

詳しくは Storage Access API を参照してください。

+ +

構文

+ +
var promise = document.hasStorageAccess();
+ +

引数

+ +

なし。

+ +

返値

+ +

文書がファーストパーティのストレージへのアクセス権を持っているかどうかを真偽値で解決する {{jsxref("Promise")}} です。

+ +

Promise が解決され、関数が最初に呼び出されたときにユーザージェスチャーイベントを処理していた場合、解決ハンドラーはユーザージェスチャーが処理されているかのように実行されるため、ユーザーによるアクティベーションを必要とする API を呼び出すことができます。

+ +

+ +
document.hasStorageAccess().then(hasAccess => {
+  if (hasAccess) {
+    // ストレージへのアクセスはすでに許可されています。
+  } else {
+    // ストレージへのアクセスはまだ許可されていません。
+    // requestStorageAccess() を呼び出す必要があります。
+  }
+});
+ +

仕様書

+ +

この API はまだ提案段階にあります。 — 標準化プロセスはまだ始まっていません。現在のところ、この API の詳細の仕様書は、アップルのブログ投稿の Introducing Storage Access API、および WHATWG HTML issue 3338 — Proposal: Storage Access API で見ることができます。

+ +

ブラウザーの互換性

+ + + +

{{Compat("api.Document.hasStorageAccess")}}

+ +

関連情報

+ +

Storage Access API

-- cgit v1.2.3-54-g00ecf