sw enhancement

This commit is contained in:
2024-09-18 13:50:23 +02:00
parent c1e418c23b
commit 43bf13a7f0

View File

@@ -154,6 +154,8 @@
} }
console.log('Latest Service Worker Version: ' + serviceWorkerVersion); console.log('Latest Service Worker Version: ' + serviceWorkerVersion);
console.log('Active Service Worker and Version: ' + reg.active.scriptURL); console.log('Active Service Worker and Version: ' + reg.active.scriptURL);
const isMatch = reg.active.scriptURL.endsWith(serviceWorkerVersion)
console.log('On Latest Service Woprker: ' + isMatch);
if (!reg.active && (reg.installing || reg.waiting)) { if (!reg.active && (reg.installing || reg.waiting)) {
// No active web worker and we have installed or are installing // No active web worker and we have installed or are installing
// one for the first time. Simply wait for it to activate. // one for the first time. Simply wait for it to activate.