From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/permissions/index.html | 62 +++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 files/ja/web/api/permissions/index.html (limited to 'files/ja/web/api/permissions/index.html') diff --git a/files/ja/web/api/permissions/index.html b/files/ja/web/api/permissions/index.html new file mode 100644 index 0000000000..83625bbae8 --- /dev/null +++ b/files/ja/web/api/permissions/index.html @@ -0,0 +1,62 @@ +--- +title: Permissions +slug: Web/API/Permissions +tags: + - API + - Experimental + - Interface + - Permissions + - Permissions API + - Reference +translation_of: Web/API/Permissions +--- +

{{APIRef("Permissions API")}}{{SeeCompatTable}}

+ +

Permissions APIPermissions インターフェイスは、パーミッションの照会および取り消しのためのメソッドなど、コアとなる Permission API 機能を提供します。

+ +

メソッド

+ +
+
{{domxref("Permissions.query()")}}
+
特定の API のパーミッションの状態を返します。
+
{{domxref("Permissions.request()")}}
+
特定の API を使用するパーミッションを要求します。 これは現在どのブラウザーもサポートしていません。
+
{{domxref("Permissions.revoke()")}}
+
特定の API に現在設定されているパーミッションを取り消します。
+
+ +

+ +
navigator.permissions.query({name:'geolocation'}).then(function(result) {
+  if (result.state == 'granted') {
+    showLocalNewsWithGeolocation();
+  } else if (result.state == 'prompt') {
+    showButtonToEnableLocalNews();
+  }
+  // パーミッションが拒否された場合は何もしないでください。
+});
+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('Permissions API', '#permissions-interface', 'Permissions')}}{{Spec2('Permissions API')}}初期定義
+ +

ブラウザーの互換性

+ +
+ + +

{{Compat("api.Permissions")}}

+
-- cgit v1.2.3-54-g00ecf