Skip to content

Instantly share code, notes, and snippets.

View helloguille's full-sized avatar

Guillermo Gonzalez helloguille

View GitHub Profile
CODE IN PAGE:
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function(err) {
console.log('ServiceWorker registration failed: ', err);
});
});