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

> Will it be possible to get reference to, and message (unicast not broadcast) the client which originated the fetch event? It's my most important use case.

Yes, you can do this:

```js
self.addEventListener("fetch", function(e) {
  e.client.postMessage("To the client initiated this fetch."); 
  // It lands on the client's global object's navigator.serviceWorker.onmessage
});
```


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

Received on Friday, 6 March 2015 01:14:44 UTC