#import #import #import #import [GenerateToValue] dictionary CookieListItem { USVString name; USVString value; }; typedef sequence CookieList; dictionary CookieStoreGetOptions { USVString name; USVString url; }; enum CookieSameSite { "strict", "lax", "none" }; dictionary CookieInit { required USVString name; required USVString value; DOMHighResTimeStamp? expires = null; USVString? domain = null; USVString path = "/"; CookieSameSite sameSite = "strict"; boolean partitioned = false; }; dictionary CookieStoreDeleteOptions { required USVString name; USVString? domain = null; USVString path = "/"; boolean partitioned = false; }; // https://cookiestore.spec.whatwg.org/#cookiestore [Exposed=(ServiceWorker,Window), SecureContext] interface CookieStore : EventTarget { Promise get(USVString name); Promise get(optional CookieStoreGetOptions options = {}); Promise getAll(USVString name); Promise getAll(optional CookieStoreGetOptions options = {}); Promise set(USVString name, USVString value); Promise set(CookieInit options); Promise delete(USVString name); Promise delete(CookieStoreDeleteOptions options); [Exposed=Window] attribute EventHandler onchange; }; // https://cookiestore.spec.whatwg.org/#Window [SecureContext] partial interface Window { [SameObject] readonly attribute CookieStore cookieStore; }; // https://cookiestore.spec.whatwg.org/#ServiceWorkerGlobalScope partial interface ServiceWorkerGlobalScope { [SameObject] readonly attribute CookieStore cookieStore; };