Re: [ServiceWorker] Add an API to take over uncontrolled pages (or pages controlled by another service worker) (#586)

> If the returned registration is unequal to the calling SW's registration, it'll be discarded in the next step. If the returned registration is equal to the calling SW's registration, but there's no active worker, wouldn't we have already failed in step 1?

Right. The returned registrations without an active worker are ignored in step 3.1.2.

> Or, is the issue that states may have changed between step 1 and 3.1.3? We should probably ensure that the calling worker is still active once we get to 3.1.3, and reject if it isn't.

Getting to 3.1.3 already ensures the calling service worker is still an active worker. The only chance an active worker becomes not active would be to be terminated by the user agent, which effectively aborts the script currently running in the worker.

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

Received on Monday, 2 February 2015 06:42:15 UTC