Re: [w3c/ServiceWorker] consider Client behavior for windows where initial about:blank is replaced with a loaded document (#1091)

> Correct, but I think this behavior is what we've agreed on in the spec so far, right?

Yes. I think so.

> Honestly I'm not sure any more. I thought it would have used the client for the global of the script that made the change, but maybe this has changed recently with @domenic's changes.

IIRC, it wasn't changed.

> In any case, I agree it should be some existing Client which we determined to have "caused" the navigation to start.

I think the initial about:blank case isn't different from other cases. Setting src (both declarartively or from script) triggers a navigate of the *nested browsing context*. The nested browsing context's active document's client being the request's client seems reasonable.

> And the main reason I see for not just putting an initial about:blank client in reservedClientId is the issue with postMessage() not being queued until the final load like you get with a real reserved client.

I'd like to clarify if we were on the same page about this. I didn't mean to put an initial about:blank client in reservedClientId. It was about whether to expose the reserved environment made anyway for the http fetch of the navigate request (because all the normal navigate fetch would expose the reserved environment.)

It seems we're back to the f2f decision considering the about:blank is to be the final client and exposing the reserved client is too complex. For this, devs should be able to detect it's the initial about:blank case. I now better understand why you proposed initialClientId. I was thinking about using clientId instead of adding a new property like:

```js
clients.get(fetchEvent.clientId).then(client => { /* client.url == 'about:blank' && it's a navigate of nested browsing context */ });
```

Hmm.. I think we still can't distinguish it from a non-initial about:blank case if the session history has other documents in the list. E.g. [document1, document2, about:blank]. So, should we add initialClientId?

-- 
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/1091#issuecomment-310557038

Received on Friday, 23 June 2017 02:52:41 UTC