Skip to content

Instantly share code, notes, and snippets.

@anteburazer
Created June 5, 2017 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anteburazer/48e875ed2394fe4af52d90695a326b32 to your computer and use it in GitHub Desktop.
Save anteburazer/48e875ed2394fe4af52d90695a326b32 to your computer and use it in GitHub Desktop.
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('/service-worker.js')
.then(function(registration) {
console.log('Service Worker registered');
}).catch(function(err) {
console.log('Service Worker registration failed: ', err);
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment