Created
October 11, 2017 09:22
-
-
Save aofleejay/95c67d48ec9f3455cfa67e82e34093d8 to your computer and use it in GitHub Desktop.
Register a Service Worker
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) { | |
window.addEventListener('load', () => { | |
navigator.serviceWorker.register("/service-worker.js").then(register => { | |
console.log('Register succeeded in scope : ', register.scope) | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment