[w3c/ServiceWorker] should document.open() inherit the controller (#1313)

What should happen if the current window is controlled by a service worker and script then calls `document.open()`?  Should the service worker controller by inherited or not?

Per the html spec a new window should be created for `document.open()`.  AFAIK, though, only firefox implements this and there is some discussion around aligning with the behavior where the window is preserved.  @annevk has been looking at this recently.

Even with that in mind, though, should the controller be preserved or cleared?

I wrote a demo here:

https://sw-document-open.glitch.me/

The iframe shows its controller after the `document.open()`.  You can also open the console to see if the "dynamic.js" script load inserted by the `document.write()` is intercepted.

Results are:

* Firefox: no controller, no dynamic.js fetch event
* Chrome: controller is inherited, dynamic.js fetch event is received
* Safari: controller is inherited, dynamic.js fetch event is received
* Edge: no controller, no dynamic.js fetch event

What is the desired behavior?  My gut feeling is that it should probably be inherited similar to what we do for about:blank iframes, etc.

-- 
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/1313

Received on Tuesday, 15 May 2018 15:29:03 UTC