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

A few follow up questions.
* We are fine with code such as:
```js
client.focus().then(function() {
  client.focused === false;
});
```
It's very odd to have a method that can change the state of an object on an object that is meant to be a snapshot.

* ```WindowClient.focus()``` will fail in Chromium if it is not called inside a ```notificationclick``` event or called more than once. Do we still want to throw in that case? I'm afraid that it might break when reaching some edge cases like:
```js
clients.getAll().then(function(clients) {
  clients.forEach(function(c) {
    c.focus();
  });
});
```
If this code is called from inside a ```notificationclick``` and there is only one ```WindowClient```, it will work fine. If there are multiple ```WindowClient```, it will throw.

* ```Clients.openWindow()``` only takes an url and no options. It is fairly limited. Should we imitate ```window.open()``` API or should we improve that later for something more powerful but saner than ```window.open()```?

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

Received on Friday, 19 December 2014 16:32:40 UTC