mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-12 19:40:02 -04:00
21 lines
647 B
JavaScript
21 lines
647 B
JavaScript
importScripts("/epoxy/index.js");
|
|
importScripts("/libcurl/index.js");
|
|
importScripts("/uv/uv.bundle.js");
|
|
importScripts("/uv/uv.config.js");
|
|
importScripts(__uv$config.sw || "/uv/uv.sw.js");
|
|
const uv = new UVServiceWorker();
|
|
self.addEventListener("fetch", function (event) {
|
|
if (event.request.url.startsWith(location.origin + __uv$config.prefix)) {
|
|
event.respondWith(
|
|
(async function () {
|
|
return await uv.fetch(event);
|
|
})()
|
|
);
|
|
} else {
|
|
event.respondWith(
|
|
(async function () {
|
|
return await fetch(event.request);
|
|
})()
|
|
);
|
|
}
|
|
});
|