// Clean-up for returning visitors. An earlier version of this site may have registered a // service worker in their browser; this file replaces it, clears its caches and removes // itself. Visitors who never had one are not affected: nothing registers this file. self.addEventListener('install', () => self.skipWaiting()) self.addEventListener('activate', (event) => { event.waitUntil( (async () => { const names = await caches.keys() await Promise.all(names.map((name) => caches.delete(name))) await self.registration.unregister() const windows = await self.clients.matchAll({ type: 'window' }) windows.forEach((client) => client.navigate(client.url)) })() ) })