Add ServiceWorker
This commit is contained in:
parent
efe6250f38
commit
f7c213102f
2 changed files with 78 additions and 0 deletions
8
app.js
8
app.js
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue