fix(pwa) fix loading the service worker
We typically use a base URL for static assets using a CDN so loading the worker from there won't work since it's a different origin. Using a URL relative to the origin of the page will make it be loaded from the right place.
This commit is contained in:
parent
fbfaed07b2
commit
d5b2da02c1
|
@ -25,7 +25,7 @@
|
|||
|
||||
if (shouldRegisterWorker) {
|
||||
navigator.serviceWorker
|
||||
.register('pwa-worker.js')
|
||||
.register('/pwa-worker.js')
|
||||
.then(reg => {
|
||||
console.log('Service worker registered.', reg);
|
||||
})
|
||||
|
@ -33,7 +33,7 @@
|
|||
console.log(err);
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
// IE11 and earlier can be identified via their user agent and be
|
||||
|
|
Loading…
Reference in New Issue