Given this registration code, which page URLs will this Service Worker
control?
navigator.serviceWorker.register('/sw.js', {
scope: '/foo/'
});
- /
- /sw.js
- /foo
- /foo.html
- /foo/
- /foo/bar/index.html
- /foo/bar
ANSWER
- /foo/
- /foo/bar/index.html
- /foo/bar
The `Service Worker` will control any page URL that begins with the scope. Remember, the trailing slash is important!