Initial commit: Portugais App

This commit is contained in:
2026-08-23 09:07:07 +00:00
commit bab625a670
15 changed files with 2638 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
const CACHE_NAME='pt-v5';
const urls=['/','/login.html'];
self.addEventListener('install',e=>{e.waitUntil(caches.open(CACHE_NAME).then(c=>c.addAll(urls)));self.skipWaiting()});
self.addEventListener('activate',e=>{e.waitUntil(caches.keys().then(n=>Promise.all(n.filter(x=>x!==CACHE_NAME).map(x=>caches.delete(x)))).then(()=>self.clients.claim()))});
self.addEventListener('fetch',e=>{if(e.request.method!=='GET')return;e.respondWith(fetch(e.request).then(r=>{const clone=r.clone();caches.open(CACHE_NAME).then(c=>c.put(e.request,clone));return r}).catch(()=>caches.match(e.request)))});