Re: [fetch] Add dialogWindow to the API (#70)

Requests have an additional "dialog window" field, initially null.

`new Request()`:
* If request's client is a `Window` object, set request's dialog window to request's client.

`FetchEvent`'s `Request` objects are unadjusted. (E.g., a fetch from a window will result in a request with both its client and dialog window set to that window.)

That's the easy part. The hard part is what `new Request(someOtherRequest)` (which `fetch()` et al use underneath) does. My proposal is to simply copy the dialog window (client will be set to the "current" global as before) as long as the dialog window object is same-origin with the client object. 

This gets somewhat weird with multiple browsing contexts that can reach each other, but at least does not get cross-origin weird (document.domain and potentially structured cloning). It also does not seem that harmful since all of those windows could make the same fetch anyway and the user would be none-the-wiser. It's just fundamentally broken to have the network spawn dialogs, even though there are some use cases for it.

I'm going to specify this and try to make the specification more clear about network-spawned dialogs in general.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/70#issuecomment-119229744

Received on Tuesday, 7 July 2015 15:00:07 UTC