Revelav3/public/sw.js
2023-02-14 00:58:04 +00:00

14 lines
497 B
JavaScript

importScripts("./uv/uv.bundle.js");
importScripts("./uv/uv.config.js");
importScripts("./uv/uv.sw.js");
importScripts("./osana/osana.worker.js");
const UV = new UVServiceWorker();
const Osana = new OsanaServiceWorker();
self.addEventListener("fetch", (event) => {
if (event.request.url.startsWith(location.origin + "/service/go/"))
event.respondWith(UV.fetch(event));
if (event.request.url.startsWith(location.origin + "/service/~osana/"))
event.respondWith(Osana.fetch(event));
});