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

By the way, about:blank replacement windows are in theory already exposed, even without reserved Client ID.  Consider this page:

```
<iframe src="frame.html" id="frame"></iframe>
<script>
var f = document.getElementById('frame');
f.contentWindow.foo = 'foo'
</script>
```

here the `.foo` global is set on the initial about:blank window.  This window is then reused when "frame.html" loads.  The "frame.html" page will see `.foo` on its global.

Consider if "frame.html" is delayed in loading.  Perhaps a service worker purposefully does this.  In this case:

1. A `clients.matchAll()` should theoretically return a Client for the initial about:blank before the load completes because it is same origin.
2. A later `clients.matchAll()` should then return the same Client for the "frame.html" window (because it got reused).

I'm intending to write a test for this, but I'm unsure if I should upstream it to WPT yet or not.  What do people think?

-- 
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-308524782

Received on Wednesday, 14 June 2017 18:52:11 UTC