WindowClient

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.

MDN Reference

Properties

Link copied to clipboard

The focused read-only property of the the current client has focus.

Link copied to clipboard

The frameType read-only property of the Client interface indicates the type of browsing context of the current Client.

Link copied to clipboard
val id: String

The id read-only property of the Client interface returns the universally unique identifier of the Client object.

Link copied to clipboard

The type read-only property of the Client interface indicates the type of client the service worker is controlling.

Link copied to clipboard
val url: String

The url read-only property of the Client interface returns the URL of the current service worker client.

Link copied to clipboard

The visibilityState read-only property of the This value can be one of 'hidden', 'visible', or 'prerender'.

Functions

Link copied to clipboard
suspend fun focus(): WindowClient

The focus() method of the WindowClient interface gives user input focus to the current client and returns a ``js-nolint focus() `` None.

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

The navigate() method of the WindowClient interface loads a specified URL into a controlled client page then returns a ``js-nolint navigate(url) `` - url - : The location to navigate to.

suspend fun navigate(url: URL): WindowClient?
Link copied to clipboard
Link copied to clipboard
fun postMessage(message: JsAny?, transfer: ReadonlyArray<Transferable>)

The postMessage() method of the (a Window, Worker, or SharedWorker).

fun postMessage(message: JsAny?, options: StructuredSerializeOptions = definedExternally)