10 lines
294 B
JavaScript
10 lines
294 B
JavaScript
self.addEventListener("fetch", event =>{
|
|
|
|
event.respondWith((async ()=>{
|
|
const resp = await fetch(event.request);
|
|
const body = await resp.body.text();
|
|
new Response(body.replace("<body>", '<body class="toggled">'), {
|
|
...resp
|
|
});
|
|
})());
|
|
})
|