Re: [ServiceWorker] Clients & postMessage (#609)

@annevk @slightlyoff & I had a meeting last night about this stuff. The conclusions were:

* Client & ServiceWorker objects should have an ID (#634 & #635)
* It's ok for `Client` to remain a snapshot, even if `ServiceWorker` becomes live, given the difference in environments
* `serviceWorkerInstance.postMessage` lands at `self.onmessage` within the ServiceWorker. The `messageEvent.source` will be an instance of `WindowClient` or `Client` depending on the sender
* `clientInstance.postMessage` will land at `navigator.serviceWorker.onmessage`. The `messageEvent.source` will be an instance of `ServiceWorker` representing the sender.

The `postMessage` stuff will need to be specced more like `BroadcastChannel` than ports, since they're not 1:1.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/609#issuecomment-75739069

Received on Tuesday, 24 February 2015 11:18:44 UTC