-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
47 lines (33 loc) · 1.29 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
title: "FetchEvent: resultingClientId property"
short-title: resultingClientId
slug: Web/API/FetchEvent/resultingClientId
page-type: web-api-instance-property
browser-compat: api.FetchEvent.resultingClientId
---
{{APIRef("Service Workers API")}}{{AvailableInWorkers("service")}}
The **`resultingClientId`** read-only property of the
{{domxref("FetchEvent")}} interface is the {{domxref("Client.id", "id")}} of the
{{domxref("Client", "client")}} that replaces the previous client during a page
navigation.
For example, when navigating from page A to page B `resultingClientId` is
the ID of the client associated with page B.
If the fetch request is a subresource request or the request's
[`destination`](/en-US/docs/Web/API/Request/destination) is
`report`, `resultingClientId` will be an empty string.
## Value
A string.
## Examples
```js
self.addEventListener("fetch", (event) => {
console.log(event.resultingClientId);
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [Using Service Workers](/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers)
- [Service workers basic code example](https://github.com/mdn/dom-examples/tree/main/service-worker/simple-service-worker)
- [Using web workers](/en-US/docs/Web/API/Web_Workers_API/Using_web_workers)