Package-level declarations

Types

Link copied to clipboard
open class CookieChangeEvent(val type: EventType<CookieChangeEvent>, init: CookieChangeEventInit = definedExternally) : Event

The CookieChangeEvent interface of the Cookie Store API is the event type of the CookieStore/change_event event fired at a CookieStore when any cookies are created or deleted. Available only in secure contexts.

Link copied to clipboard
Link copied to clipboard
interface CookieInit
Link copied to clipboard
Link copied to clipboard
interface CookieListItem
Link copied to clipboard
sealed interface CookieSameSite
Link copied to clipboard

The CookieStore interface of the Cookie Store API provides methods for getting and setting cookies asynchronously from either a page or a service worker. Available only in secure contexts.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The CookieStoreManager interface of the Cookie Store API allows service workers to subscribe to cookie change events. Available only in secure contexts.

Link copied to clipboard

The ExtendableCookieChangeEvent interface of the Cookie Store API is the event type passed to ServiceWorkerGlobalScope/cookiechange_event event fired at the ServiceWorkerGlobalScope when any cookie changes occur which match the service worker's cookie change subscription list.

Functions

Link copied to clipboard
inline suspend fun CookieStore.delete(name: String)

The delete() method of the CookieStore interface deletes a cookie that matches the given name or options object.

inline suspend fun CookieStore.delete(options: CookieStoreDeleteOptions)
Link copied to clipboard
inline suspend fun CookieStore.get(): CookieListItem?
inline suspend fun CookieStore.get(options: CookieStoreGetOptions): CookieListItem?

inline suspend fun CookieStore.get(name: String): CookieListItem?

The get() method of the CookieStore interface returns a Promise that resolves to a single cookie matching the given name or options object.

Link copied to clipboard
inline suspend fun CookieStore.getAll(): CookieList
inline suspend fun CookieStore.getAll(options: CookieStoreGetOptions): CookieList

inline suspend fun CookieStore.getAll(name: String): CookieList

The getAll() method of the CookieStore interface returns a Promise that resolves as an array of cookies that match the name or options passed to it.

Link copied to clipboard

The getSubscriptions() method of the CookieStoreManager interface returns a list of all the cookie change subscriptions for this ServiceWorkerRegistration.

Link copied to clipboard
inline suspend fun CookieStore.set(options: CookieInit)

inline suspend fun CookieStore.set(name: String, value: String)

The set() method of the CookieStore interface sets a cookie with the given name and value or options object.

Link copied to clipboard

The subscribe() method of the CookieStoreManager interface subscribes a ServiceWorkerRegistration to cookie change events.

Link copied to clipboard

The unsubscribe() method of the CookieStoreManager interface stops the ServiceWorkerRegistration from receiving previously subscribed events.