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/permissions/revoke/index.html | |
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/permissions/revoke/index.html')
-rw-r--r-- | files/ja/web/api/permissions/revoke/index.html | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/files/ja/web/api/permissions/revoke/index.html b/files/ja/web/api/permissions/revoke/index.html new file mode 100644 index 0000000000..2ffebf2cb5 --- /dev/null +++ b/files/ja/web/api/permissions/revoke/index.html @@ -0,0 +1,90 @@ +--- +title: Permissions.revoke() +slug: Web/API/Permissions/revoke +tags: + - API + - Experimental + - Method + - Permissions + - Permissions API + - Reference + - revoke +translation_of: Web/API/Permissions/revoke +--- +<p>{{APIRef("Permissions API")}}{{SeeCompatTable}}</p> + +<p><span class="seoSummary">{{domxref("Permissions")}} インターフェイスの <strong><code>Permissions.revoke()</code></strong> メソッドは、現在設定されているパーミッションをデフォルト状態(通常は <code>prompt</code>)に戻します。</span></p> + +<h2 id="Syntax" name="Syntax">構文</h2> + +<p>このメソッドは、グローバルな {{domxref("Permissions")}} オブジェクトである {{domxref("navigator.permissions")}} に対して呼び出します。</p> + +<pre class="syntaxbox">var <em>revokePromise</em> = navigator.permissions.revoke(<em>descriptor</em>); +</pre> + +<h3 id="Parameters" name="Parameters">パラメーター</h3> + +<dl> + <dt><code>descriptor</code></dt> + <dd>名前と値のペアのコンマ区切りリストで構成される、操作のオプションを設定する <code>PermissionDescriptor</code> ディクショナリに基づくオブジェクト。 利用可能なオプションは次のとおりです。 + <ul> + <li><code>name</code>: パーミッションを照会したい API の名前。 有効な値は、<code>'geolocation'</code>、<code>'midi'</code>、<code>'notifications'</code>、<code>'push'</code> です。</li> + <li><code>userVisibleOnly</code>: Push のみ。 Firefox はサポートしていません。 下記の{{anch("Browser compatibility","ブラウザーの互換性")}}のセクションを参照してください)すべてのメッセージについて通知を表示するか、サイレントプッシュ通知を送信できるかを示します。 デフォルトは <code>false</code> です。</li> + <li><code>sysex</code>: (MIDI のみ)システムエクスクルーシブメッセージが必要か受信するかどうかを示します。 デフォルトは <code>false</code> です。</li> + </ul> + </dd> +</dl> + +<div class="note"> +<p><strong>注</strong>: Firefox 44 以降、<a href="/ja/docs/Web/API/Notifications_API">Notifications</a> と <a href="/ja/docs/Web/API/Push_API">Push</a> のパーミッションは統合されました。 (例えば、ユーザーによって、関連するパーミッションのダイアログにより)パーミッションが与えられた場合、<code>navigator.permissions.query()</code> は <code>notifications</code> と <code>push</code> の両方に対して <code>true</code> を返します。</p> +</div> + +<div class="note"> +<p><strong>注</strong>: <code>persistent-storage</code> パーミッションは、<a href="https://storage.spec.whatwg.org/">Storage API</a> のとおりに、オリジンがそのストレージとして永続的ボックス(すなわち永続的ストレージ(<a href="https://storage.spec.whatwg.org/#persistence">persistent storage</a>))を使用することを許可します。</p> +</div> + +<h3 id="Returns" name="Returns">戻り値</h3> + +<p>要求の結果を示す {{domxref("PermissionStatus")}} オブジェクトと共に成功ハンドラを呼び出す {{jsxref("Promise")}}。</p> + +<h3 id="Exceptions" name="Exceptions">例外</h3> + +<dl> + <dt><code>TypeError</code></dt> + <dd><code>PermissionDescriptor</code> 情報の取得が何らかの理由で失敗したか、アクセス権が存在しないか現在サポートされていません(例えば、<code>midi</code>、または <code>userVisibleOnly</code> と一緒の <code>push</code> で)。</dd> +</dl> + +<h2 id="Example" name="Example">例</h2> + +<p>この関数をアプリで使用して、それが有する Geolocation API のパーミッションを取り消すように要求できます。</p> + +<pre class="brush: js">function revokePermission() { + navigator.permissions.revoke({name:'geolocation'}).then(function(result) { + report(result.state); + }); +}</pre> + +<h2 id="Specification" name="Specification">仕様</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様</th> + <th scope="col">状態</th> + <th scope="col">コメント</th> + </tr> + <tr> + <td>{{SpecName('Permissions API','#dom-permissions-revoke','revoke()')}}</td> + <td>{{Spec2('Permissions API')}}</td> + <td>初期定義</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> + +<div> + + +<p>{{Compat("api.Permissions.revoke")}}</p> +</div> |