Last active
March 3, 2019 13:13
-
-
Save adrienZ/9a42a57dd3e79e31a149fe1e6d6a74ef to your computer and use it in GitHub Desktop.
Service Worker registration
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('/service-worker.js') | |
| .then(function(registration) { | |
| console.log('Registration successful, scope is:', registration.scope); | |
| }) | |
| .catch(function(error) { | |
| console.log('Service worker registration failed, error:', error); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment