From a480ecaf65fbfda8dd0520f59d036b3fde0b877b Mon Sep 17 00:00:00 2001 From: cpu Date: Sat, 22 Mar 2025 22:31:00 +0100 Subject: [PATCH] Initial commit --- manifest.json | 10 +++++----- sw.js | 9 +++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index 685bf49..aec2917 100644 --- a/manifest.json +++ b/manifest.json @@ -1,13 +1,13 @@ { - "name": "Game Timer PWA", - "short_name": "Game Timer", + "name": "Game Timer", + "short_name": "Timer", "description": "Multi-player chess-like timer with carousel navigation", - "start_url": "/index.html", + "start_url": "/", "id": "/index.html", "display": "standalone", "display_override": ["window-controls-overlay", "standalone", "minimal-ui"], - "background_color": "#f5f5f5", - "theme_color": "#2c3e50", + "background_color": "#ffffff", + "theme_color": "#000000", "icons": [ { "src": "/icons/android-chrome-192x192.png", diff --git a/sw.js b/sw.js index 6ca8ad8..479125d 100644 --- a/sw.js +++ b/sw.js @@ -70,6 +70,15 @@ self.addEventListener('activate', event => { ); }); +self.addEventListener('fetch', (event) => { + console.log('[ServiceWorker] Fetch'); + event.respondWith( + caches.match(event.request).then((cachedResponse) => { + return cachedResponse || fetch(event.request); + }) + ); +}); + // Helper function to determine if a response should be cached function shouldCacheResponse(request, response) { // Only cache GET requests