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. |
Working Draft | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Client | Chrome Full support 40 | Edge Full support 17 | Firefox
Full support
44
| IE No support No | Opera Full support 27 | Safari No support No | WebView Android Full support 40 | Chrome Android Full support 40 | Firefox Android Full support 44 | Opera Android Full support 27 | Safari iOS No support No | Samsung Internet Android Full support 4.0 |
frameType | Chrome Full support 43 | Edge Full support 17 | Firefox
Full support
44
| IE No support No | Opera Full support 30 | Safari No support No | WebView Android Full support 43 | Chrome Android Full support 43 | Firefox Android Full support 44 | Opera Android Full support 30 | Safari iOS No support No | Samsung Internet Android Full support 4.0 |
id | Chrome Full support 40 | Edge Full support ≤79 | Firefox
Full support
44
| IE No support No | Opera Full support 27 | Safari No support No | WebView Android Full support 40 | Chrome Android Full support 40 | Firefox Android Full support 44 | Opera Android Full support 27 | Safari iOS No support No | Samsung Internet Android Full support 4.0 |
postMessage | Chrome Full support 45 | Edge Full support ≤79 | Firefox
Full support
44
| IE No support No | Opera Full support 32 | Safari No support No | WebView Android Full support 45 | Chrome Android Full support 45 | Firefox Android Full support 44 | Opera Android Full support 32 | Safari iOS No support No | Samsung Internet Android Full support 5.0 |
type | Chrome Full support 60 | Edge Full support ≤79 | Firefox Full support 54 | IE No support No | Opera Full support 47 | Safari No support No | WebView Android Full support 60 | Chrome Android Full support 60 | Firefox Android Full support 54 | Opera Android Full support 44 | Safari iOS No support No | Samsung Internet Android Full support 8.0 |
url | Chrome Full support 40 | Edge Full support ≤79 | Firefox
Full support
44
| IE No support No | Opera Full support 27 | Safari No support No | WebView Android Full support 40 | Chrome Android Full support 40 | Firefox Android Full support 44 | Opera Android Full support 27 | Safari iOS No support No | Samsung Internet Android Full support 4.0 |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- See implementation notes.
- See implementation notes.