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 <noreply@anthropic.com>
This commit is contained in:
@@ -89,6 +89,13 @@
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('Service Worker registration failed:', 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 {
|
} else {
|
||||||
console.warn('Service Workers not supported in this browser');
|
console.warn('Service Workers not supported in this browser');
|
||||||
|
|||||||
Reference in New Issue
Block a user