Summary: CookieStore API is an asynchronous Javascript cookies API for documents and service workers. Together with WebKit, we agreed to ship a subset of the originally proposed API to expose only the cookie details already available through `document.cookie`.
Bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1475599Specification:
https://wicg.github.io/cookie-store/Platform coverage: Firefox Desktop, Firefox on Android
Preference: `dom.cookieStore.enabled`
Link to standards-positions discussion:
https://github.com/mozilla/standards-positions/issues/94Other browsers:
* Chrome: shipped since 87 (Nov 2020)
* Safari: They are working on the implementation. No official release date yet.
web-platform-tests: /cookie-store
We plan to land a prototype that diverges from the official spec by the following points:
1. Only cookie names and values are shared via `CookieStore.get()`/`getAll()` methods. In this way, we do not expose more than what `document.cookie` already offers.
2. We don't implement the `CookieStoreManager` and the `ServiceWorkerGlobalScope.oncookiechange` event handler, with its `ExtendableCookieChangeEvent` event because we don't want to spawn ServiceWorkers at any cookie change
3. Following up on the previous point, `CookieStore.onchange` event handler is also exposed to ServiceWorkers.