feature: activate sw
This commit is contained in:
parent
354807c512
commit
1d1f8de324
@ -1,11 +1,11 @@
|
||||
// if('serviceWorker' in navigator) {
|
||||
// var refreshing;
|
||||
// navigator.serviceWorker.addEventListener('controllerchange', () => {
|
||||
// if (refreshing) {
|
||||
// return;
|
||||
// }
|
||||
// refreshing = true;
|
||||
// window.location.reload();
|
||||
// });
|
||||
// navigator.serviceWorker.register('/sw.js');
|
||||
// }
|
||||
if('serviceWorker' in navigator) {
|
||||
var refreshing;
|
||||
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
||||
if (refreshing) {
|
||||
return;
|
||||
}
|
||||
refreshing = true;
|
||||
window.location.reload();
|
||||
});
|
||||
navigator.serviceWorker.register('/sw.js');
|
||||
}
|
Loading…
Reference in New Issue
Block a user