Core Ultraviolet scripts
Configure Ultraviolet for both client-hooking & service worker in uv.config.js
self.__uv$config = {
bare: '/bare/',
prefix: '/service/',
encodeUrl: Ultraviolet.codec.xor.encode,
decodeUrl: Ultraviolet.codec.xor.decode,
handler: '/uv.handler.js',
bundle: '/uv.bundle.js',
config: '/uv.config.js',
};
importScripts('/PATHTOSCRIPTS/uv.sw.js');
const sw = new UVServiceWorker();
self.addEventListener('fetch', event =>
event.respondWith(
sw.fetch(event)
)
);