W3cubDocs

/DOM

Client

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The Client interface represents an executable context such as a Worker, or a SharedWorker. Window clients are represented by the more-specific WindowClient. You can get Client/WindowClient objects from methods such as Clients.matchAll() and Clients.get().

Methods

Client.postMessage()
Sends a message to the client.

Properties

Client.id Read only
The universally unique identifier of the client as a string.
Client.type Read only
The client's type as a string. It can be "window", "worker", or "sharedworker".
Client.url Read only
The URL of the client as a string.

Specifications

Specification Status Comment
Service Workers
The definition of 'Client' in that specification.
Editor's Draft Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 40 44.0 (44.0)[1] No support 27 No support
type property 60 54.0 (54.0) ? 47 ?
Feature Android Webview Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 40 40 44.0 (44.0) No support 27 No support
type property 60 60 54.0 (54.0) ? 47 ?

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Client