- From: Monica Chintala <notifications@github.com>
- Date: Wed, 15 Jul 2026 11:05:59 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/ServiceWorker/pull/1832/review/4706899225@github.com>
@monica-ch commented on this pull request.
> @@ -1705,12 +1705,16 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
<h4 id="fetch-event-clientid">{{FetchEvent/clientId|event.clientId}}</h4>
<dfn attribute for="FetchEvent"><code>clientId</code></dfn> attribute *must* return the value it was initialized to. When an <a>event</a> is created the attribute *must* be initialized to the empty string.
+
+ Note: {{FetchEvent/clientId}} is |request|'s [=request/client=]'s [=environment/id=] for [=subresource requests=], and the empty string otherwise (including for [=non-subresource requests=] such as [=navigation requests=], or when |request|'s [=request/client=] is null). See {{FetchEvent/resultingClientId}} for the environment associated with the resulting document of a [=navigation request=].
Thanks @yoshisatoyanagisawa, you're right, my earlier text was too narrow.
For context, Gecko and WebKit currently leave clientId empty for navigation, but [Gecko's own code](https://searchfox.org/firefox-main/source/dom/serviceworkers/ServiceWorkerOp.cpp) has a TODO calling this a temporary limitation (bug 1487534) so the intended direction across engines is Blink's. Aligning the spec there.
Changes pushed yesterday on fetch-event-client-id-fixes:
Algorithm step: dropped the subresource restriction now reads "If client is not null, initialize e's clientId to client's environment id."
clientId Note: rewritten to say clientId reflects the initiating client whenever one exists, empty only when request's client is null.
Minor editorial cleanup on the clientId and resultingClientId Notes.
resultingClientId and replacesClientId algorithm steps untouched they already match Blink's behavior per your description. PTAL.
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1832#discussion_r3589671684
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/ServiceWorker/pull/1832/review/4706899225@github.com>
Received on Wednesday, 15 July 2026 18:06:03 UTC