CookieStoreManager Class

The cookie change subscriptions of a service worker registration (https://cookiestore.spec.whatwg.org/#cookiestoremanager), registration.cookies: the active worker of the registration receives a cookiechange event (ExtendableCookieChangeEvent) when a cookie that matches a subscription changes.

public sealed class CookieStoreManager

Remarks

The subscriptions belong to the registration: they are kept when the service worker is updated, saved with the registration by the ServiceWorkerBackend, and dropped when the registration is unregistered.

See also

Methods

NameDescription
GetSubscriptions()Returns the cookie change subscriptions of the registration (https://cookiestore.spec.whatwg.org/#dom-cookiestoremanager-getsubscriptions), in the order they were added.
Subscribe(IReadOnlyList<CookieStoreGetOptions>)Adds cookie change subscriptions to the registration (https://cookiestore.spec.whatwg.org/#dom-cookiestoremanager-subscribe): the cookies whose name is the name of a subscription (any name when it has none) and that would be sent to its URL (the scope of the registration when it has none). Adding a subscription that exists does nothing.
Unsubscribe(IReadOnlyList<CookieStoreGetOptions>)Removes cookie change subscriptions from the registration (https://cookiestore.spec.whatwg.org/#dom-cookiestoremanager-unsubscribe). Removing a subscription that does not exist does nothing.

GetSubscriptions()

CookieStoreManager.cs

Returns the cookie change subscriptions of the registration (https://cookiestore.spec.whatwg.org/#dom-cookiestoremanager-getsubscriptions), in the order they were added.

public Task<IReadOnlyList<CookieStoreGetOptions>> GetSubscriptions()

Subscribe(IReadOnlyList<CookieStoreGetOptions>)

CookieStoreManager.cs

Adds cookie change subscriptions to the registration (https://cookiestore.spec.whatwg.org/#dom-cookiestoremanager-subscribe): the cookies whose name is the name of a subscription (any name when it has none) and that would be sent to its URL (the scope of the registration when it has none). Adding a subscription that exists does nothing.

public Task Subscribe(IReadOnlyList<CookieStoreGetOptions> subscriptions)

Parameters

subscriptions IReadOnlyList<CookieStoreGetOptions>

Returns

Task A task failed with a TypeErrorException when a URL is not valid or is not in the scope of the registration.

See also

Unsubscribe(IReadOnlyList<CookieStoreGetOptions>)

CookieStoreManager.cs

Removes cookie change subscriptions from the registration (https://cookiestore.spec.whatwg.org/#dom-cookiestoremanager-unsubscribe). Removing a subscription that does not exist does nothing.

public Task Unsubscribe(IReadOnlyList<CookieStoreGetOptions> subscriptions)

Parameters

subscriptions IReadOnlyList<CookieStoreGetOptions>

Returns

Task A task failed with a TypeErrorException when a URL is not valid or is not in the scope of the registration.

See also