Add trailing slash to service worker scope
This will ensure it always matches or is underneath the allowed service worker scope. Fixes #2076.
This commit is contained in:
parent
fef619aef8
commit
938b460685
@ -10,7 +10,7 @@ if ("serviceWorker" in navigator) {
|
|||||||
const path = normalize(`${options.csStaticBase}/dist/serviceWorker.js`)
|
const path = normalize(`${options.csStaticBase}/dist/serviceWorker.js`)
|
||||||
navigator.serviceWorker
|
navigator.serviceWorker
|
||||||
.register(path, {
|
.register(path, {
|
||||||
scope: options.base || "/",
|
scope: (options.base ?? "") + "/",
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("[Service Worker] registered")
|
console.log("[Service Worker] registered")
|
||||||
|
Reference in New Issue
Block a user