mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-13 03:50:02 -04:00
20 lines
611 B
JavaScript
20 lines
611 B
JavaScript
importScripts('/epoxy/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);
|
|
})()
|
|
);
|
|
}
|
|
});
|