Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update and fix to Cookie Store API #30183

Closed
wants to merge 51 commits into from

Conversation

skyclouds2001
Copy link
Contributor

@skyclouds2001 skyclouds2001 commented Nov 10, 2023

make huge change to Cookie Store API related pages

Description


API summary and GroupData

add window.cookieStore ServiceWorkerGlobalScope.cookieStore ServiceWorkerGlobalScope.cookiechange ServiceWorkerRegistration.cookies to the API group data, also add them to api summary page

fix the incorrect event type in the Cookie Store API - Interfaces section - ExtendableCookieChangeEvent, which should fired at ServiceWorkerGlobalScope.cookiechange event, not change event

add {{Experimental_Inline}} to Cookie Store API interfaces in API summary

specific spec-urls front matter key of Cookie Store API api summary, see #30542

also update browser-compat front matter key by adding interfaces of this API

add {{AvailableInWorkers}} [available both in Window and ServiceWorker]


CookieChangeEvent and ExtendableCookieChangeEvent

add partitioned parameter in CookieChangeEvent and ExtendableCookieChangeEvent properties values description

add a Instance methods section for CookieChangeEvent and ExtendableCookieChangeEvent

add {{Optional_Inline}} macros to CookieChangeEvent and ExtendableCookieChangeEvent constructor options parameter

add {{AvailableInWorkers}} to ExtendableCookieChangeEvent interface [available only in ServiceWorker]


CookieStore

add a Event type section to CookieStore.change event

add {{optional_inline}} to CookieStore.get() CookieStore.getAll() CookieStore.delete(), as they are able to accept two types of parameters

update CookieStore.get() and CookieStore.set() parameters section by adding default value description

update CookieStore.get() CookieStore.getAll() CookieStore.delete() exception section

fix the example in CookieStore.get(), which return a Promise, and to get value must use await

fix the example in CookieStore.getAll(), which return a Promise resolves to an array, and to check if it is empty, we must check the length property of array

fix the parameters bug in CookieStore.delete(), that the options parameter can not accept a url parameter but should accept domain parameter

add {{AvailableInWorkers}} (Except for CookieStore.change event, which is only available in Window context) [available both in Window and ServiceWorker]


CookieStoreManager

fix the incorrect apiref usage in CookieStoreManager pages

add {{AvailableInWorkers}}

add {{AvailableInWorkers}} [available both in Window and ServiceWorker]


total

initial documentation for window.cookieStore ServiceWorkerGlobalScope.cookieStore ServiceWorkerGlobalScope.cookiechange ServiceWorkerRegistration.cookies

make some style update and fix

Motivation

Additional details

reference to https://developer.mozilla.org/en-US/docs/Web/API/Cookie_Store_API

reference to https://wicg.github.io/cookie-store/

Related issues and pull requests

Relates to #29975 and #29461

@github-actions github-actions bot added the Content:WebAPI Web API docs label Nov 10, 2023
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@skyclouds2001 skyclouds2001 marked this pull request as ready for review November 28, 2023 14:08
@skyclouds2001 skyclouds2001 requested review from a team as code owners November 28, 2023 14:08
@skyclouds2001 skyclouds2001 requested review from wbamberg and dipikabh and removed request for a team November 28, 2023 14:08
@skyclouds2001
Copy link
Contributor Author

see mdn/browser-compat-data#18591, need we add partitioned_option compat data in CookieChangeEvent or ExtendableCookieChangeEvent?

@skyclouds2001 skyclouds2001 marked this pull request as draft December 9, 2023 14:12
@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Dec 10, 2023
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot removed the merge conflicts 🚧 [PR only] label Dec 10, 2023
@skyclouds2001 skyclouds2001 deleted the Cookie-Store-API branch December 10, 2023 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant