Revelav3/static/sw.js
2022-08-30 11:48:12 -04:00

10 lines
No EOL
416 B
JavaScript

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));
});