Re: [ServiceWorker] ServiceWorkerClient to Client (#588)

@annevk: 

> It seems like an interesting idea to make Client available everywhere, I had not actually considered that. I was mostly suggesting to remove the "ServiceWorker" prefix since they were scoped to service workers anyway. But this makes sense if we want the ability to open new windows using `new Client` elsewhere.

Ohh, I thought that's what you were asking for. Happy to keep it ServiceWorker specific.

> Also, the `postMessage()` setup only works if these objects are in a service worker since the other side is expected to use the `ServiceWorker` object, no?

If we're making this ServiceWorker specific, can we make `postMessageEvent.source` point back to the ServiceWorker it originated from?

> I don't really like `update`. I thought the idea was to require polling given the expected longevity of a service worker?

I was looking to solve this issue:

```js
client.focused; // false
client.focus().then(function() {
  client.focused; // still false
});
```

But perhaps "it's a snapshot, deal with it" is good enough. The focus method resolving is indication enough.

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

Received on Monday, 15 December 2014 13:13:58 UTC