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 WorkersThe 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.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Chrome
Full support 40 |
Edge
Full support 17 |
Firefox Full support 44 Full support 44 Notes' Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API. |
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 |
Chrome
Full support 43 |
Edge
Full support 17 |
Firefox Full support 44 Full support 44 Notes' Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API. |
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 | |
Chrome
Full support 40 |
Edge
Full support ≤79 |
Firefox Full support 44 Full support 44 Notes' Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API. |
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 | |
Chrome
Full support 45 |
Edge
Full support ≤79 |
Firefox Full support 44 Full support 44 Notes' Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API. |
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 | |
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 | |
Chrome
Full support 40 |
Edge
Full support ≤79 |
Firefox Full support 44 Full support 44 Notes' Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API. |
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.
See also
Client by Mozilla Contributors is licensed under CC-BY-SA 2.5.