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.
Note: This feature is only available in Service Workers.
Giao diện Client đại diện cho một ngữ cảnh thực thi như Worker hoặc SharedWorker. Các client Window được biểu diễn bằng WindowClient cụ thể hơn. Bạn có thể lấy các đối tượng Client/WindowClient từ những phương thức như Clients.matchAll() và Clients.get().
Phương thức thực thể
Client.postMessage()-
Gửi một thông điệp tới client.
Thuộc tính thực thể
Client.frameTypeRead only-
Kiểu khung của client dưới dạng chuỗi. Giá trị có thể là
"auxiliary","top-level","nested"hoặc"none". Client.idRead only-
Mã định danh duy nhất toàn cục của client dưới dạng chuỗi.
Client.typeRead only-
Loại của client dưới dạng chuỗi. Giá trị có thể là
"window","worker"hoặc"sharedworker". Client.urlRead only-
URL của client dưới dạng chuỗi.
Thông số kỹ thuật
| Specification |
|---|
| Service Workers Nightly> # client-interface> |