Update service-worker location

Fix service worker not found issue when running the application from a
different folder other than domain root.
This commit is contained in:
Pratik Borsadiya 2018-09-06 11:53:04 +05:30
parent 84dd9bab1c
commit 7d5b75e78c
4 changed files with 5 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -68,11 +68,11 @@ self.__precacheManifest = [
"url": "flags/ir.svg" "url": "flags/ir.svg"
}, },
{ {
"revision": "fc5025122339e41903ba", "revision": "23a22250de06d1793dc4",
"url": "app.js" "url": "app.js"
}, },
{ {
"revision": "fc5025122339e41903ba", "revision": "23a22250de06d1793dc4",
"url": "app.css" "url": "app.css"
} }
]; ];

View File

@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.4.1/workbox-sw.js"); importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.4.1/workbox-sw.js");
importScripts( importScripts(
"precache-manifest.272e05401f2b6535c2c0bd13398d615f.js" "precache-manifest.9fb68aa2f4c1d3847817b423aa5ac56d.js"
); );
/** /**

View File

@ -145,7 +145,7 @@ webui.directive("textarea", directiveTextarea);
if ("serviceWorker" in navigator && location.protocol === "https:") { if ("serviceWorker" in navigator && location.protocol === "https:") {
window.addEventListener("load", () => { window.addEventListener("load", () => {
navigator.serviceWorker navigator.serviceWorker
.register("/service-worker.js") .register("service-worker.js")
.then(registration => { .then(registration => {
console.log("SW registered: ", registration); console.log("SW registered: ", registration);
}) })