CookieStoreManager: unsubscribe() メソッド
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。
Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。
CookieStoreManager インターフェイスの unsubscribe() メソッドは、ServiceWorkerRegistration が以前購読していたイベントを受け取るのを止めます。
構文
js
unsubscribe(subscriptions)
引数
subscriptions-
以下が格納されたオブジェクトです。
返値
例外
例
この例では、registration で表される ServiceWorkerRegistration が、名前が "cookie1" でスコープが "/path1" である Cookie の変更イベントの購読を解除します。
js
const subscriptions = [{ name: "cookie1", url: `/path1` }];
await registration.cookies.unsubscribe(subscriptions);
仕様書
| Specification |
|---|
| Cookie Store API> # dom-cookiestoremanager-unsubscribe> |
ブラウザーの互換性
Loading…