ladybird/Libraries/LibWeb/CookieStore/CookieStore.idl
Idan Horowitz 81e3afd1fd
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
LibWeb+LibWebView: Implement emitting CookieChangeEvents
2025-08-08 13:09:58 -04:00

69 lines
1.8 KiB
Text

#import <DOM/EventTarget.idl>
#import <DOM/EventHandler.idl>
#import <HTML/Window.idl>
#import <ServiceWorker/ServiceWorkerGlobalScope.idl>
[GenerateToValue]
dictionary CookieListItem {
USVString name;
USVString value;
};
typedef sequence<CookieListItem> 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<CookieListItem?> get(USVString name);
Promise<CookieListItem?> get(optional CookieStoreGetOptions options = {});
Promise<CookieList> getAll(USVString name);
Promise<CookieList> getAll(optional CookieStoreGetOptions options = {});
Promise<undefined> set(USVString name, USVString value);
Promise<undefined> set(CookieInit options);
Promise<undefined> delete(USVString name);
Promise<undefined> 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;
};