Initial commit
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "Game Timer PWA",
|
"name": "Game Timer",
|
||||||
"short_name": "Game Timer",
|
"short_name": "Timer",
|
||||||
"description": "Multi-player chess-like timer with carousel navigation",
|
"description": "Multi-player chess-like timer with carousel navigation",
|
||||||
"start_url": "/index.html",
|
"start_url": "/",
|
||||||
"id": "/index.html",
|
"id": "/index.html",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"display_override": ["window-controls-overlay", "standalone", "minimal-ui"],
|
"display_override": ["window-controls-overlay", "standalone", "minimal-ui"],
|
||||||
"background_color": "#f5f5f5",
|
"background_color": "#ffffff",
|
||||||
"theme_color": "#2c3e50",
|
"theme_color": "#000000",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "/icons/android-chrome-192x192.png",
|
"src": "/icons/android-chrome-192x192.png",
|
||||||
|
|||||||
9
sw.js
9
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
|
// Helper function to determine if a response should be cached
|
||||||
function shouldCacheResponse(request, response) {
|
function shouldCacheResponse(request, response) {
|
||||||
// Only cache GET requests
|
// Only cache GET requests
|
||||||
|
|||||||
Reference in New Issue
Block a user