Intent to Implement and Ship: FetchEvent.clientId and Clients.get(id) for Service Worker

336 views
Skip to first unread message

jungke...@samsung.com

unread,
Jan 11, 2016, 12:33:53 AM1/11/16
to blink-dev
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.

Dimitri Glazkov

unread,
Jan 12, 2016, 1:08:31 PM1/12/16
to jungke...@samsung.com, blink-dev
LGTM1

:DG<

Jochen Eisinger

unread,
Jan 12, 2016, 1:40:15 PM1/12/16
to Dimitri Glazkov, jungke...@samsung.com, blink-dev
lgtm2

Chris Harrelson

unread,
Jan 12, 2016, 2:52:35 PM1/12/16
to Jochen Eisinger, Dimitri Glazkov, jungke...@samsung.com, blink-dev
LGTM3

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Reply all
Reply to author
Forward
0 new messages