CookieChangeEvent: CookieChangeEvent() constructor
Baseline
2025
Newly available
Since June 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The CookieChangeEvent() constructor creates a new CookieChangeEvent object
which is the event type of the change event fired at a CookieStore when any cookie changes occur.
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
new CookieChangeEvent(type)
new CookieChangeEvent(type, options)
Parameters
type-
A string with the name of the event. It is case-sensitive and browsers always set it to
change. optionsOptional-
An object that, in addition of the properties defined in
Event(), can have the following properties:changedOptional-
An array containing the changed cookies.
deletedOptional-
An array containing the deleted cookies.
Return value
A new CookieChangeEvent object.
Specifications
| Specification |
|---|
| Cookie Store API> # dom-cookiechangeevent-cookiechangeevent> |
Browser compatibility
Loading…