Add ServiceWorker

This commit is contained in:
nemunaire 2018-06-14 20:53:21 +02:00
commit f7c213102f
2 changed files with 78 additions and 0 deletions

8
app.js
View file

@ -202,3 +202,11 @@ window.onpopstate = function(event) {
return v.length > 0;
}), true);
}
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js').then(function(registration) {
console.log('Service worker registration succeeded:', registration);
}).catch(function(error) {
console.log('Service worker registration failed:', error);
});
}