register service worker at relative scope

Co-Authored-By: Ian Reinhart Geiser <geiseri@geekcentral.pub>
This commit is contained in:
Dean Sheather 2019-05-27 23:27:05 -04:00
parent a2ad3d4ff4
commit 46207cfe10
No known key found for this signature in database
GPG Key ID: B574DF7CAFDCFAA3

View File

@ -29,7 +29,7 @@
if ("serviceWorker" in navigator) {
// Use the window load event to keep the page load performant
window.addEventListener("load", () => {
navigator.serviceWorker.register("/service-worker.js");
navigator.serviceWorker.register('service-worker.js', {scope: './'});
});
}
</script>