Re: [ServiceWorker] Promise on navigator.serviceWorker that resolves when page is controlled (#799)

@jeffposnick 

> there could be a new promise, perhaps named .controlled

This could be implemented as:

```js
const p = new Promise(r => {
  if (navigator.serviceWorker.controller) return r();
  navigator.serviceWorker.addEventListener('controllerchange', e => r());
});
```

I think we need more evidence that this is a common enough pattern to add to the platform.

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

Received on Thursday, 17 December 2015 16:23:30 UTC