Commit 68fa5d52 authored by Guus Hoekman's avatar Guus Hoekman

pwa fixes

parent cf090b06
Pipeline #76889662 passed with stage
in 1 minute and 30 seconds
......@@ -41,25 +41,6 @@
});
</script>
<!-- Progressive web app service worker -->
<script>
// Check compatibility for the browser we're running this in
if ("serviceWorker" in navigator) {
if (navigator.serviceWorker.controller) {
console.log("[PWA Builder] active service worker found, no need to register");
} else {
// Register the service worker
navigator.serviceWorker
.register("/serviceWorker.js", {
scope: "/"
})
.then(function (reg) {
console.log("[PWA Builder] Service worker has been registered for scope: " + reg.scope);
});
}
}
</script>
<!-- Google Analytics... sorry -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-90365352-11"></script>
<script>
......
......@@ -110,3 +110,22 @@ title: Home
var lastUpdated = new Date(2015, 11, 20);
</script>
<script src="js/seasonTable.js"></script>
<!-- Progressive web app service worker -->
<script>
// Check compatibility for the browser we're running this in
if ("serviceWorker" in navigator) {
if (navigator.serviceWorker.controller) {
console.log("[PWA Builder] active service worker found, no need to register");
} else {
// Register the service worker
navigator.serviceWorker
.register("serviceWorker.js", {
scope: "/"
})
.then(function (reg) {
console.log("[PWA Builder] Service worker has been registered for scope: " + reg.scope);
});
}
}
</script>
\ No newline at end of file
......@@ -3,7 +3,7 @@
const CACHE = "pwabuilder-page";
// TODO: replace the following with the correct offline fallback page i.e.: const offlineFallbackPage = "offline.html";
const offlineFallbackPage = "/offline.html";
const offlineFallbackPage = "offline.html";
// Install stage sets up the offline page in the cache and opens a new cache
self.addEventListener("install", function (event) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment