From e88308a6228c063b2f0a4497b777064edcb56ef6 Mon Sep 17 00:00:00 2001 From: kamaji Date: Sat, 7 Feb 2026 22:23:32 -0600 Subject: [PATCH] Pre-cache capture and queue pages for offline support After the SW activates, fetch /capture and /queue in the background so they are in the runtime cache and available offline immediately without requiring manual navigation first. Co-Authored-By: Claude Opus 4.6 --- app/templates/base.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/templates/base.html b/app/templates/base.html index 1e3c911..0cd955d 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -89,6 +89,13 @@ .catch((error) => { console.error('Service Worker registration failed:', error); }); + + // Pre-cache key pages for offline support once SW is active + navigator.serviceWorker.ready.then(() => { + ['/capture', '/queue'].forEach(url => { + fetch(url).catch(() => {}); + }); + }); }); } else { console.warn('Service Workers not supported in this browser');