Files
tomsjavajive/sw.js
T
myron 7dfec466a1 Disable service worker and clear all caches
SW was caching shop pages and JS files, serving stale versions without
the inline onclick handler. Replacing with self-unregistering SW.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14 20:23:36 +00:00

10 lines
348 B
JavaScript

// Unregister this service worker and clear all caches
self.addEventListener('install', () => self.skipWaiting());
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys()
.then(keys => Promise.all(keys.map(key => caches.delete(key))))
.then(() => self.registration.unregister())
);
});