The WindowClient interface of the ServiceWorker API represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. The service worker client independently selects and uses a service worker for its own loading and sub-resources.

Documentation WindowClient by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Variables

read onlyfocused:Bool

A boolean that indicates whether the current client has focus.

read onlyvisibilityState:VisibilityState

Indicates the visibility of the current client. This value can be one of hidden, visible, prerender, or unloaded.

Methods

focus():Promise<WindowClient>

Gives user input focus to the current client. 

Throws:

null

DOMError

navigate(url:String):Promise<WindowClient>

Loads a specified URL into a controlled client page.

Throws:

null

DOMError

Inherited Variables

Defined by Client

read onlyid:String

The universally unique identifier of the client as a string.

read onlytype:ClientType

The client's type as a string. It can be "window", "worker", or "sharedworker".

read onlyurl:String

The URL of the client as a string.

Inherited Methods

Defined by Client

postMessage(message:Dynamic, ?transfer:Array<Dynamic>):Void

Sends a message to the client.

Throws:

null

DOMError