Några uppdrag vi jobbat med

Till toppen
if ('serviceWorker' in navigator) { navigator.serviceWorker.getRegistrations().then(function(registrations) { for(let registration of registrations) { registration.unregister(); } }); // console.log("Will the service worker register?"); navigator.serviceWorker.register('/service-worker.js') .then(function(reg){ console.log("Yes, it did."); }) .catch(function(err) { console.log("No it didn't. This happened: ", err) }); }