This commit is contained in:
2024-03-09 20:01:50 +08:00
parent 7571cc8e43
commit b8f692d432

15
eh_gallery_script.sw.js Normal file
View File

@@ -0,0 +1,15 @@
self.addEventListener("fetch", async (e) => {
const r = e.request;
const u = new URL(r.url);
if (u.hostname == "e-hentai.org" || u.hostname == 'exhentai.org') return;
const cache = await caches.open("eh_tag_img");
const response = await cache.match(r);
if (response) {
return response;
}
const res = await fetch(r);
if (res.ok) {
await cache.put(r, res.clone());
}
return res;
})