Re: [slightlyoff/ServiceWorker] spec exactly how to order non-window Client objects (#887)

I missed these comments during the F2F sorry!

I think the common case is:

```js
// in reaction to a notification click:
clients.matchAll().then(allClients => {
  const client = allClients.find(c => new URL(c.url).pathname == '/chat/');
  if (client) return client.focus();
  return clients.openWindow('/chat/');
});
```

If the user had two `/chat/` tabs open, one of them focused, it'd be weird to take focus from one `/chat/` tab to another. And it seems desirable to focus the most recently used `/chat/` tab, but that's not essential.

I'd be happy if the order was:

* Currently focused window, if any
* Windows
* Non-windows

And add a note to encourage browsers to order the windows & non-windows on relevancy descending.

This would allow browsers to give priority to a visible window on an active desktop etc.

WDYT @beverloo?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/887#issuecomment-237244865

Received on Wednesday, 3 August 2016 14:54:01 UTC