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()
.
Client
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 |
---|
Service Workers 1 # client-interface |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
Client |
40
|
17
|
44
Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.
|
No
|
27
|
11.1
|
40
|
40
|
44
|
27
|
11.3
|
4.0
|
frameType |
43
|
17
|
44
Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.
|
No
|
30
|
11.1
|
43
|
43
|
44
|
30
|
11.3
|
4.0
|
id |
40
|
17
|
44
Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.
|
No
|
27
|
11.1
|
40
|
40
|
44
|
27
|
11.3
|
4.0
|
postMessage |
45
|
17
|
44
Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.
|
No
|
32
|
11.1
|
45
|
45
|
44
|
32
|
11.3
|
5.0
|
type |
60
|
17
|
54
|
No
|
47
|
11.1
|
60
|
60
|
54
|
44
|
11.3
|
8.0
|
url |
40
|
17
|
44
Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.
|
No
|
27
|
11.1
|
40
|
40
|
44
|
27
|
11.3
|
4.0
|
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Client