[w3c/ServiceWorker] scope pattern matching (#1468)

I'd like to propose some improvements to how service worker scopes match against client URLs.  For example, the proposal would allow sites to match exact URLs instead of always using substring matching.

```javascript
    // Service worker controlling '/' exactly.
    navigator.serviceWorker.register('/root-sw.js', {
     scope: new URLPattern({
      baseUrl: self.location,
      path: '/'
     })
    });

    // Product hosted at '/sub/path/product' is not controlled.
```

The full explainer is a bit long, so I have published it in a separate repo for now:

https://github.com/wanderview/service-worker-scope-pattern-matching/blob/master/explainer.md

I'm hoping to discuss this at the face-to-face meeting at TPAC 2019.

This proposal is related to other issues such as #1272 and #287, but I filed this as a separate issue to have a clean discussion of this proposal.  This proposal is orthogonal to declarative routing (since that takes place after scope matching.)

-- 
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/1468

Received on Wednesday, 4 September 2019 21:33:21 UTC