Client
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2018.
Client
接口表示一个可执行的上下文,如 Worker
或 SharedWorker
。Window
客户端由更具体的 WindowClient
表示。你可以从 Clients.matchAll()
和 Clients.get()
等方法获取 Client
/WindowClient
对象。
实例方法
Client.postMessage()
-
向客户端发送一条消息。
实例属性
Client.id
只读-
一个字符串,表示客户端的通用唯一标识。
Client.type
只读-
表示客户端类型的字符串。可能是
"window"
、"worker"
或"sharedworker"
。 Client.url
只读-
表示客户端 URL 的字符串。
规范
Specification |
---|
Service Workers # client-interface |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Client | ||||||||||||
frameType | ||||||||||||
id | ||||||||||||
postMessage | ||||||||||||
type | ||||||||||||
url |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
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.