Re: [w3c/ServiceWorker] when will navigation `FetchEvent.resultingClientId` have a reserved client and not an initial about:blank client? (#1228)

> When should the initial about:blank conceptually exist?

The initial about:blank in the spec is created when a browsing context is created as you pointed. This applies to any browsing contexts: top-level, nested, and auxiliary. For top-level navigations within the same browsing context, the initial about:blank client is always replaced by a reserved client (which we decided to not expose to script) as they have different origins.

> It seems this means we should always have an active about:blank document when performing a navigation FetchEvent? Is this right?

For the initial navigation, I think that's true. For an iframe and auxiliary window with the same origin to the parent frame, the active about:blank document should be the landing client. For the top-level browsing context, that'd be replaced by a new landing client.

> Or is there something in the spec which implies we should create a separate reserved Client for things like top level navigations?

The [environment](https://html.spec.whatwg.org/#environment) created in https://html.spec.whatwg.org/#process-a-navigate-fetch step 4 is the reserved client for a navigation request. The environment itself should not be exposed to script as we decided, but `fetchEvent.resultingClientId` should convey either this environment's id or the initial about:blank client's id depending on the cases. I'm planning to spec that in Handle Fetch.

-- 
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/1228#issuecomment-345132444

Received on Friday, 17 November 2017 03:07:21 UTC