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

I don't think the snapshot nature of `Client` is an issue here. Windows & workers have no access to the client object, so they can't listen to its message events.

The client is a static representation of the window/sharedworker/dedicatedworker. Client exists because `WindowProxy` can't be used for obvious reasons, that's why I thought `window.onmessage` made sense as a message destination.

Now that `getAll()` only returns window clients by default, we could have `getAll({type: 'all'})` return a mix of `WindowClient`, `DedicatedWorker` & `SharedWorker`. `WindowClient` would `postMessage` to `window.onmessage`, because it's a worker-safe `WindowProxy`.

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

Received on Wednesday, 21 January 2015 15:22:06 UTC