Created
October 25, 2017 13:03
-
-
Save evemilano/3c9e606faf98a8a75d0540bf8fe95dd3 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
<script> | |
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker.register('/sw.js') | |
.then(function(registration) { | |
console.log('Registration successful, scope is:', registration.scope); | |
}) | |
.catch(function(error) { | |
console.log('Service worker registration failed, error:', error); | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Guida: https://www.evemilano.com/2017/10/progressive-web-app/