2025-08-04 22:17:20 +03:00
|
|
|
#import <DOM/EventTarget.idl>
|
|
|
|
|
#import <DOM/EventHandler.idl>
|
|
|
|
|
#import <HTML/Window.idl>
|
|
|
|
|
#import <ServiceWorker/ServiceWorkerGlobalScope.idl>
|
|
|
|
|
|
2025-08-05 23:05:45 +03:00
|
|
|
[GenerateToValue]
|
|
|
|
|
dictionary CookieListItem {
|
|
|
|
|
USVString name;
|
|
|
|
|
USVString value;
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-05 23:52:27 +03:00
|
|
|
typedef sequence<CookieListItem> CookieList;
|
|
|
|
|
|
2025-08-06 00:33:20 +03:00
|
|
|
dictionary CookieStoreGetOptions {
|
|
|
|
|
USVString name;
|
|
|
|
|
USVString url;
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-06 11:01:25 +03:00
|
|
|
enum CookieSameSite {
|
|
|
|
|
"strict",
|
|
|
|
|
"lax",
|
|
|
|
|
"none"
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-06 12:04:18 +03:00
|
|
|
dictionary CookieInit {
|
|
|
|
|
required USVString name;
|
|
|
|
|
required USVString value;
|
|
|
|
|
DOMHighResTimeStamp? expires = null;
|
|
|
|
|
USVString? domain = null;
|
|
|
|
|
USVString path = "/";
|
|
|
|
|
CookieSameSite sameSite = "strict";
|
|
|
|
|
boolean partitioned = false;
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-06 23:12:37 +03:00
|
|
|
dictionary CookieStoreDeleteOptions {
|
|
|
|
|
required USVString name;
|
|
|
|
|
USVString? domain = null;
|
|
|
|
|
USVString path = "/";
|
|
|
|
|
boolean partitioned = false;
|
|
|
|
|
};
|
|
|
|
|
|
2025-08-04 22:17:20 +03:00
|
|
|
// https://cookiestore.spec.whatwg.org/#cookiestore
|
|
|
|
|
[Exposed=(ServiceWorker,Window), SecureContext]
|
|
|
|
|
interface CookieStore : EventTarget {
|
2025-08-05 23:05:45 +03:00
|
|
|
Promise<CookieListItem?> get(USVString name);
|
2025-08-06 00:33:20 +03:00
|
|
|
Promise<CookieListItem?> get(optional CookieStoreGetOptions options = {});
|
2025-08-05 23:52:27 +03:00
|
|
|
|
|
|
|
|
Promise<CookieList> getAll(USVString name);
|
2025-08-06 00:48:19 +03:00
|
|
|
Promise<CookieList> getAll(optional CookieStoreGetOptions options = {});
|
2025-08-06 11:01:25 +03:00
|
|
|
|
|
|
|
|
Promise<undefined> set(USVString name, USVString value);
|
2025-08-06 12:04:18 +03:00
|
|
|
Promise<undefined> set(CookieInit options);
|
2025-08-06 22:54:24 +03:00
|
|
|
|
|
|
|
|
Promise<undefined> delete(USVString name);
|
2025-08-06 23:12:37 +03:00
|
|
|
Promise<undefined> delete(CookieStoreDeleteOptions options);
|
2025-08-07 18:20:13 +03:00
|
|
|
|
|
|
|
|
[Exposed=Window] attribute EventHandler onchange;
|
2025-08-04 22:17:20 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 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;
|
|
|
|
|
};
|