Contact emails
Spec
- FetchEvent.clientId
- Clients.get(id)
Summary
FetchEvent.clientId is an API that returns the id of the client that initiated the fetch request. For a navigation request, this attribute returns null.
Clients.get(id) is an API that returns a promise that resolves with a Client object that represents the client whose id matches the given id.
Motivation
Developers would like to get a reference to and message back to the client (via the corresponding Client object) which originated the fetch event. To support this usage, FetchEvent.clientId provides the id of the fetch event's client, and Clients.get(id) provides a way to get a copy of the Client object for a given id. Without these APIs, developers had to use Clients.matchAll() to iterate all the clients within the origin and attempt to match a client using other information such as frame type, url, pre-stored id, etc.
Compatibility Risk
Firefox: Implemented and Shipping (45.0)
Web developers: Positive
Describe the degree of compatibility risk you believe this change poses
Low - There's a working draft or equivalent spec, and this is implemented in Firefox 45.0. Strong interest from developers.
Ongoing technical constraints
None
Will this feature be supported on all five Blink platforms (Windows, Mac, Linux, Chrome OS, and Android)?
Yes
OWP launch tracking bug
- FetchEvent.clientId
- Clients.get(id)
Entry in Chromium Dashboard
Requesting approval to ship?
Yes - features are relatively small.