ExtendableCookieChangeEvent: ExtendableCookieChangeEvent() constructor

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

Specifications

Specification
Cookie Store API
# dom-extendablecookiechangeevent-extendablecookiechangeevent

Browser compatibility

BCD tables only load in the browser