Re: [w3c/ServiceWorker] Allow overlapping scopes (#1085)

> In the above example I would like root-sw.js gets all fetch events on the origin, except for anything under /path/, which then goes to path-sw.js

At the moment, the scope of a SW decides which clients it'll control. Then, fetches from controlled clients triggers fetch events in the controlling service worker. This is how you can get fetch events for urls that are on other origins, despite those urls being clearly out of scope.

But, in terms of deciding which service worker gets control, the longest matching scope wins, as @delapuente says.

Does this cover your use cases? Do you want an img fetch for `/foo/cat.jpg` from page `/` to go via the service worker controlling the page, or the SW scoped to `/foo/`? If it's the latter, that would need to be a new thing, like making foreign fetch work in the same origin or something.

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

Received on Thursday, 30 March 2017 04:47:14 UTC