ExtendableCookieChangeEvent: ExtendableCookieChangeEvent() constructor

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is only available in Service Workers.

The ExtendableCookieChangeEvent() constructor creates a new ExtendableCookieChangeEvent object which is the event type passed to cookiechange event fired at the ServiceWorkerGlobalScope when any cookie changes occur which match the service worker's cookie change subscription list. This constructor is called by the browser when a change event occurs.

Note: This event constructor is generally not needed for production websites. It's primary use is for tests that require an instance of this event.

Syntax

js
new ExtendableCookieChangeEvent(type)
new ExtendableCookieChangeEvent(type, options)

Parameters

type

A string with the name of the event. It is case-sensitive and browsers always set it to cookiechange.

options Optional

An object that, in addition of the properties defined in ExtendableEvent(), can have the following properties:

changed Optional

An array containing a changed cookie.

deleted Optional

An array containing a deleted cookie.

Return value

A new ExtendableCookieChangeEvent object.

Specifications

Specification
Cookie Store API
# dom-extendablecookiechangeevent-extendablecookiechangeevent

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
ExtendableCookieChangeEvent() constructor
Chrome – Full support
Chrome 87 (Release date: 2020-11-17)
footnote Full support
Edge – Full support
Edge 87 (Release date: 2020-11-19)
footnote Full support
Firefox – Full support
Firefox 140 (Release date: 2025-06-24)
footnote Full support
Opera – Full support
Opera 73 (Release date: 2020-12-09)
footnote Full support
Safari – No support
Safari 18.4 (Release date: 2025-03-31)
disabled
disabled From version 18.4 users must explicitly set the Cookie Store API CookieStoreManager preference to Enabled.
Chrome Android – Full support
Chrome Android 87 (Release date: 2020-11-17)
footnote Full support
Firefox for Android – Full support
Firefox for Android 140 (Release date: 2025-06-24)
footnote Full support
Opera Android – Full support
Opera Android 62 (Release date: 2021-02-16)
footnote Full support
Safari on iOS – No support
Safari on iOS 18.4 (Release date: 2025-03-31)
disabled
disabled From version 18.4 users must explicitly set the Cookie Store API CookieStoreManager preference to Enabled.
Samsung Internet – Full support
Samsung Internet 14 (Release date: 2021-04-17)
footnote Full support
WebView Android – Full support
WebView Android 87 (Release date: 2020-11-17)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
User must explicitly enable this feature.