Created
August 19, 2016 14:14
-
-
Save deanhume/bede2890e6e27f5c01a4cfac4498e4fa to your computer and use it in GitHub Desktop.
Register 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
<script> | |
// Register the service worker | |
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker.register('./service-worker.js').then(function(registration) { | |
// Registration was successful | |
console.log('ServiceWorker registration successful with scope: ', registration.scope); | |
}) | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment