scope pattern matching
@wanderview is already working on this.
Since Sep 8, 2020.
- Dominant language
- Bikeshed
- Stars
- 3.6k
- Forks
- 324
- Avg merge
- 14d 22h
- Merged PRs (30d)
- 1
Description
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.
// 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.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.