Package-level declarations

Types

Link copied to clipboard
open class Client

The Client interface represents an executable context such as a Worker, or a SharedWorker.

Link copied to clipboard
Link copied to clipboard
open class Clients

The Clients interface provides access to Client objects.

Link copied to clipboard
sealed interface ClientTypes
Link copied to clipboard
open class ExtendableEvent(val type: EventType<ExtendableEvent>, init: ExtendableEventInit = definedExternally) : Event

The ExtendableEvent interface extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle.

Link copied to clipboard
Link copied to clipboard

The ExtendableMessageEvent interface of the Service Worker API represents the event object of a ServiceWorkerGlobalScope/message_event event fired on a service worker (when a message is received on the ServiceWorkerGlobalScope from another context) — extends the lifetime of such events.

Link copied to clipboard

This is the event type for fetch events dispatched on the ServiceWorkerGlobalScope.

Link copied to clipboard
Link copied to clipboard
sealed interface FrameType
Link copied to clipboard
Link copied to clipboard

The NavigationPreloadManager interface of the Service Worker API provides methods for managing the preloading of resources in parallel with service worker bootup. Available only in secure contexts.

Link copied to clipboard
Link copied to clipboard

The NotificationEvent interface of the Notifications API represents a notification event dispatched on the ServiceWorkerGlobalScope of a ServiceWorker.

Link copied to clipboard
Link copied to clipboard

The ServiceWorker interface of the Service Worker API provides a reference to a service worker. Available only in secure contexts.

Link copied to clipboard

The ServiceWorkerContainer interface of the Service Worker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations. Available only in secure contexts.

Link copied to clipboard

The ServiceWorkerGlobalScope interface of the Service Worker API represents the global execution context of a service worker. Available only in secure contexts.

Link copied to clipboard
sealed interface ServiceWorkerModule
Link copied to clipboard

The ServiceWorkerRegistration interface of the Service Worker API represents the service worker registration. Available only in secure contexts.

Link copied to clipboard
sealed interface ServiceWorkerState
Link copied to clipboard
Link copied to clipboard
open class WindowClient : Client

The WindowClient interface of the ServiceWorker API represents the scope of a service worker client that is a document in a browsing context, controlled by an active worker.

Properties

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

Functions

Link copied to clipboard
inline suspend fun Clients.claim()

The claim() method of the Clients interface allows an active service worker to set itself as the ServiceWorkerContainer.controller for all clients within its ServiceWorkerRegistration.scope.

Link copied to clipboard
inline suspend fun NavigationPreloadManager.disable()

The disable() method of the NavigationPreloadManager interface halts the automatic preloading of service-worker-managed resources previously started using NavigationPreloadManager.enable() It returns a promise that resolves with undefined.

Link copied to clipboard
inline suspend fun NavigationPreloadManager.enable()

The enable() method of the NavigationPreloadManager interface is used to enable preloading of resources managed by the service worker.

Link copied to clipboard
inline suspend fun WindowClient.focus(): WindowClient

The focus() method of the WindowClient interface gives user input focus to the current client and returns a Promise that resolves to the existing WindowClient.

Link copied to clipboard
inline suspend fun Clients.get(id: String): Client?

The get() method of the Clients interface gets a service worker client matching a given id and returns it in a Promise.

Link copied to clipboard

The getNotifications() method of the ServiceWorkerRegistration interface returns a list of the notifications in the order that they were created from the current origin via the current service worker registration.

Link copied to clipboard

The getRegistration() method of the ServiceWorkerContainer interface gets a ServiceWorkerRegistration object whose scope URL matches the provided client URL.

Link copied to clipboard

The getRegistrations() method of the ServiceWorkerContainer interface gets all ServiceWorkerRegistrations associated with a ServiceWorkerContainer, in an array.

Link copied to clipboard

The getState() method of the NavigationPreloadManager interface returns a Promise that resolves to an object with properties that indicate whether preload is enabled and what value will be sent in the Service-Worker-Navigation-Preload HTTP header.

Link copied to clipboard
inline suspend fun <T : ClientQueryOptions> Clients.matchAll(options: T): ReadonlyArray<Client>

The matchAll() method of the Clients interface returns a Promise for a list of service worker Client objects.

Link copied to clipboard
inline suspend fun WindowClient.navigate(url: String): WindowClient?

The navigate() method of the WindowClient interface loads a specified URL into a controlled client page then returns a Promise that resolves to the existing WindowClient.

inline suspend fun WindowClient.navigate(url: URL): WindowClient?
Link copied to clipboard
inline suspend fun Clients.openWindow(url: String): WindowClient?

The openWindow() method of the Clients interface creates a new top level browsing context and loads a given URL.

inline suspend fun Clients.openWindow(url: URL): WindowClient?
Link copied to clipboard

The register() method of the ServiceWorkerContainer interface creates or updates a ServiceWorkerRegistration for the given scope.

Link copied to clipboard

The setHeaderValue() method of the NavigationPreloadManager interface sets the value of the Service-Worker-Navigation-Preload header that will be sent with requests resulting from a Window/fetch operation made during service worker navigation preloading.

Link copied to clipboard

The showNotification() method of the ServiceWorkerRegistration interface creates a notification on an active service worker.

Link copied to clipboard

The skipWaiting() method of the ServiceWorkerGlobalScope interface forces the waiting service worker to become the active service worker.

Link copied to clipboard

The unregister() method of the ServiceWorkerRegistration interface unregisters the service worker registration and returns a Promise.

Link copied to clipboard

The update() method of the ServiceWorkerRegistration interface attempts to update the service worker.