debugging service workers sucks it seems

This commit is contained in:
Pagwin 2025-01-03 21:52:08 -05:00
parent ac458355af
commit 5425303925
No known key found for this signature in database
GPG key ID: 81137023740CA260
2 changed files with 3 additions and 0 deletions

2
TODO
View file

@ -1,3 +1,5 @@
- get demo working on chrome
- make demo use class or attr instead of checkbox
- add button to save articles for offline reading - add button to save articles for offline reading
- post jump points and table of contents (be wary of having this take up too much space on mobile) probably done with position: sticky in some way - post jump points and table of contents (be wary of having this take up too much space on mobile) probably done with position: sticky in some way
- refer to implementation here https://blog.kizu.dev/repetition-and-attribution/ - refer to implementation here https://blog.kizu.dev/repetition-and-attribution/

View file

@ -29,6 +29,7 @@ async function fetchResponse(event) {
//self.addEventListener('activate', (event) => event.waitUntil(self.clients.claim())); //self.addEventListener('activate', (event) => event.waitUntil(self.clients.claim()));
self.addEventListener('fetch', (event) => { self.addEventListener('fetch', (event) => {
console.log("Fetch:", fetch.request.url);
if (!event.request.url.endsWith(".html") || event.request.url.indexOf(".") !== -1) return; if (!event.request.url.endsWith(".html") || event.request.url.indexOf(".") !== -1) return;
//https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith //https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith
event.respondWith(fetchResponse(event)); event.respondWith(fetchResponse(event));