2020-12-03 10:58:08 +00:00
|
|
|
if('serviceWorker' in navigator) {
|
|
|
|
var refreshing;
|
|
|
|
navigator.serviceWorker.addEventListener('controllerchange', () => {
|
|
|
|
if (refreshing) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
refreshing = true;
|
|
|
|
window.location.reload();
|
|
|
|
});
|
|
|
|
navigator.serviceWorker.register('/sw.js');
|
|
|
|
}
|