Re: [slightlyoff/ServiceWorker] When does the openWindow promise resolve? (#728)

@annevk I'm thinking of defining a task source called _client message queue_ on `Window` object and `WorkerGlobalScope` object. Then, `client.postMessage()` add a task to the _client message queue_ which is consumed by the even loop of those globals when the task source is enabled (like what `MessagePort` does). Enabling the task source can be done by invoking the _start client message_ algorithm from the three call sites: on `DOMContentLoaded` (or `onload`?), `onmessage` assignment, and `navigator.serviceWorker.startMessages()`.

I was thinking of defining the task source in the _service worker client_ which is a type of environment settings object, but then it can't cover the `DOMContentLoaded` case.

If the above outline makes sense, I'll make a PR to HTML.

/cc @domenic

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/728#issuecomment-225845119

Received on Tuesday, 14 June 2016 10:44:50 UTC