Created
May 27, 2017 18:53
-
-
Save Tiorzfk/f91535c1c508002c49ea8a63e152d3cc 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
if ('serviceWorker' in navigator) { | |
window.addEventListener('load', function() { | |
navigator.serviceWorker.register('/sw.js') | |
.then(function(registration) { | |
// Registration was successful | |
console.log('ServiceWorker registration successful '); | |
}).catch(function(err) { | |
// registration failed :( | |
console.log('ServiceWorker registration failed: ', err); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment