Skip to content

Instantly share code, notes, and snippets.

@beebole

beebole/index(html)1.js

Last active Jul 25, 2017
Embed
What would you like to do?
Mobile offline
if ( 'serviceWorker' in navigator ) {
navigator.serviceWorker.register('sw.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment