Re: Push API and Service Workers

On Tue, Oct 21, 2014 at 7:25 AM, Erik Corry <erikcorry@google.com> wrote:
> * Push doesn't actually need SW's ability to intercept network
> communications on behalf of a web page.
> * You can imagine a push-handling SW that does all sorts of
> complicated processing of notifications, downloading things to a local
> database, but does not cache/intercept a web page.
> * This ties into the discussion of whether it should be possible to
> register a SW without giving it a network-intercept namespace

As was discussed over in
<https://github.com/slightlyoff/ServiceWorker/issues/445#issuecomment-60304515>
earlier today, you need a scope for all uses of SW, because you need
to *request permission* on a *page*, not within a SW (so the user has
appropriate context on whether to grant the permission or not), and
the scope maps the page to the SW that the registration is for.

(The permission grant is actually per-origin, not per-scope/SW, but
the registration itself is per-scope/SW, and it has to be done from
within a page context because there *might* be a permission grant
needed.)

~TJ

Received on Thursday, 23 October 2014 21:27:57 UTC