Clients

The Clients interface provides access to Client objects.

MDN Reference

Functions

Link copied to clipboard
suspend fun 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
Link copied to clipboard
suspend fun get(id: String): Client?

The get() method of the id and returns it in a Promise.

Link copied to clipboard
Link copied to clipboard
suspend fun <T : ClientQueryOptions> matchAll(options: T = definedExternally): ReadonlyArray<Client>

The matchAll() method of the Clients interface returns a Promise for a list of service worker clients whose origin is the same as the associated service worker's origin.

Link copied to clipboard
fun <T : ClientQueryOptions> matchAllAsync(options: T = definedExternally): Promise<ReadonlyArray<Client>>
Link copied to clipboard
suspend fun openWindow(url: String): WindowClient?

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

suspend fun openWindow(url: URL): WindowClient?