Created
February 22, 2019 06:48
-
-
Save cheshirewara/fcb49a17d814488687ad3f2247b93b7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var superpwa_sw = {"url":"/serviceWorker.js"}; | |
if ('serviceWorker' in navigator) { | |
window.addEventListener('load', function() { | |
navigator.serviceWorker.register(superpwa_sw.url) | |
.then(function(registration) { console.log('PWA service worker ready'); registration.update(); }) | |
.catch(function(error) { console.log('Registration failed with ' + error); }); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment