Holy-Unblocker/views/uv/sw.js
2024-07-10 16:39:17 -07:00

17 lines
448 B
JavaScript

importScripts("../epoxy/index.js");
importScripts("uv.bundle.js");
importScripts("uv.config.js");
importScripts(__uv$config.sw || "uv.sw.js");
const uv = new UVServiceWorker();
self.addEventListener("fetch", (event) => {
event.respondWith(
(async () => {
if (event.request.url.startsWith(location.origin + __uv$config.prefix)) {
return await uv.fetch(event);
}
return await fetch(event.request);
})()
);
});