Fix scope
This commit is contained in:
@@ -6,7 +6,16 @@
|
||||
// Then move it into src and vite will bundle it automatically.
|
||||
onMount(() => {
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register(`${base}/service-worker.js`);
|
||||
navigator.serviceWorker
|
||||
.register(`${base}/service-worker.js`, {
|
||||
scope: `${base}/`
|
||||
})
|
||||
.then(function (registration) {
|
||||
console.log('Registration successful, scope is:', registration.scope);
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log('Service worker registration failed, error:', error);
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user