Created
December 3, 2017 15:05
-
-
Save KevCui/d4068d3ad0ddb581777af9a3887faed3 to your computer and use it in GitHub Desktop.
Post: Ship PWA Guided by Lighthouse
This file contains hidden or 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) { | |
navigator.serviceWorker.register('./sw.js') | |
.then(function(registration) { | |
console.log("Service Worker Registered", registration); | |
}) | |
.catch(function(err) { | |
console.log("Service Worker Failed to Register", err); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment