ExtendableCookieChangeEvent: changed プロパティ
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。
ExtendableCookieChangeEvent
インターフェイスの読み取り専用プロパティ changed
は、与えられた ExtendableCookieChangeEvent
のインスタンスで変更されたすべての Cookie を返します。
値
オブジェクトの配列で、変更された Cookie が格納されています。それぞれのオブジェクトは以下のプロパティを持ちます。
例
この例では、Cookie が設定されると、イベントリスナーがコンソールに changed
プロパティを記録します。この配列の最初の要素には、今設定されたばかりの Cookie を表すオブジェクトが格納されています。
js
self.addEventListener("cookiechange", (event) => {
console.log(event.changed[0]);
});
const one_day = 24 * 60 * 60 * 1000;
cookieStore.set({
name: "cookie1",
value: "cookie1-value",
expires: Date.now() + one_day,
domain: "example.com",
});
仕様書
Specification |
---|
Cookie Store API # dom-extendablecookiechangeevent-changed |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
changed | ||||||||||||
partitioned property |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- In development. Supported in a pre-release version.
- In development. Supported in a pre-release version.
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.