Skip to content

Instantly share code, notes, and snippets.

Last active Jul 25, 2017
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