Clients

open class Clients(source)

The Clients interface provides access to Client objects. Access it via self.clients within a service worker.

MDN Reference

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 controller for all clients within its scope. This triggers a controllerchange event on navigator.serviceWorker in any clients that become controlled by this service worker.

Link copied to clipboard

The claim() method of the Clients interface allows an active service worker to set itself as the controller for all clients within its scope. This triggers a controllerchange event on navigator.serviceWorker in any clients that become controlled by this service worker.

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 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
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. Include the options parameter to return all service worker clients whose origin is the same as the associated service worker's origin. If options are not included, the method returns only the service worker clients controlled by the service worker.

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

The matchAll() method of the Clients interface returns a Promise for a list of service worker Client objects. Include the options parameter to return all service worker clients whose origin is the same as the associated service worker's origin. If options are not included, the method returns only the service worker clients controlled by the service worker.

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. If the calling script doesn't have permission to show popups, openWindow() will throw an InvalidAccessError.

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

The openWindow() method of the Clients interface creates a new top level browsing context and loads a given URL. If the calling script doesn't have permission to show popups, openWindow() will throw an InvalidAccessError.