[w3c/ServiceWorker] [Feature request] Expose parent client ID for iframe navigations (#1556)

Ref: https://lists.w3.org/Archives/Public/public-webapps/2020OctDec/0028.html

We have a use case that involves serving local Blobs via a map of URL to Blob. (This is part of previewing locally developed content in our web-based game development IDE.) For example the map might associate `myimage.png` with a `Blob` of a PNG image. Then this can be served for a request to `example.com/myimage.png`. The map is stored per client ID, so each client has its own independent map of blobs to serve.

We'd like this to propagate through iframes too - so if a client using that map opens a (same-origin, same path) iframe, then content in that iframe can also successfully request `example.com/myimage.png`.

However when loading an iframe, its `navigate` request reaches the Service Worker with an empty `clientId`, instead only having a `resultingClientId`. However I need to know the `clientId` of the parent client, so I can propagate the parent's map of blobs to also apply to the `resultingClientId`. But it seems there's no way to get the parent client ID from an iframe's `FetchEvent`.

Perhaps there could be a `parentClientId` field on `FetchEvent` to cover this?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1556

Received on Thursday, 10 December 2020 11:58:38 UTC