testing to see if the easy answer works
This commit is contained in:
parent
25a76f76a6
commit
d1c78badc4
1 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
||||||
self.addEventListener("fetch", event =>{
|
self.addEventListener("fetch", event =>{
|
||||||
event.respondWith(new Response("hi"));
|
|
||||||
|
event.respondWith((async ()=>{
|
||||||
|
const resp = await fetch(event.request);
|
||||||
|
const body = await resp.body.text();
|
||||||
|
new Response(body.replace("<body>", '<body class="toggled">'), {
|
||||||
|
...resp
|
||||||
|
});
|
||||||
|
})());
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue