FetchEvent: thuộc tính resultingClientId
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2022.
Note: This feature is only available in Service Workers.
Thuộc tính chỉ đọc resultingClientId của giao diện FetchEvent là id của client thay thế client trước trong quá trình điều hướng trang.
Ví dụ, khi điều hướng từ trang A đến trang B, resultingClientId là ID của client liên kết với trang B.
Nếu yêu cầu tìm nạp là yêu cầu tài nguyên con hoặc destination của yêu cầu là report, resultingClientId sẽ là chuỗi rỗng.
Giá trị
Một chuỗi.
Ví dụ
js
self.addEventListener("fetch", (event) => {
console.log(event.resultingClientId);
});
Thông số kỹ thuật
| Specification |
|---|
| Service Workers Nightly> # fetch-event-resultingclientid> |