This commit is contained in:
Jason 2022-02-27 12:15:16 -05:00
parent 6199adb581
commit cddcdb3e9a
2 changed files with 30 additions and 2 deletions

View file

@ -1 +1,30 @@
# Ultraviolet Frontend
# ultraviolet-scripts
Core Ultraviolet scripts
# Configuration
Configure Ultraviolet for both client-hooking & service worker in `uv.config.js`
```javascript
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',
};
```
# Example Usage
```javascript
importScripts('/PATHTOSCRIPTS/uv.sw.js');
const sw = new UVServiceWorker();
self.addEventListener('fetch', event =>
event.respondWith(
sw.fetch(event)
)
);
```

1
uv

@ -1 +0,0 @@
Subproject commit 1684b5a0fce91c78277dfa9a98a4f7d3aff66428