Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
bachwebsite committed Apr 5, 2024
1 parent 2e96b9d commit 9d93682
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 0 deletions.
14 changes: 14 additions & 0 deletions uv/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*global UVServiceWorker,__uv$config*/
/*
* Stock service worker script.
* Users can provide their own sw.js if they need to extend the functionality of the service worker.
* Ideally, this will be registered under the scope in uv.config.js so it will not need to be modified.
* However, if a user changes the location of uv.bundle.js/uv.config.js or sw.js is not relative to them, they will need to modify this script locally.
*/
importScripts('uv.bundle.js');
importScripts('uv.config.js');
importScripts(__uv$config.sw || 'uv.sw.js');

const sw = new UVServiceWorker();

self.addEventListener('fetch', (event) => event.respondWith(sw.fetch(event)));
26 changes: 26 additions & 0 deletions uv/uv.bundle.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions uv/uv.bundle.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions uv/uv.client.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions uv/uv.client.js.map

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions uv/uv.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// This file overwrites the stock UV config.js

self.__uv$config = {
prefix: "/uv/service/",
encodeUrl: Ultraviolet.codec.xor.encode,
decodeUrl: Ultraviolet.codec.xor.decode,
handler: "/uv/uv.handler.js",
client: "/uv/uv.client.js",
bundle: "/uv/uv.bundle.js",
config: "/uv/uv.config.js",
sw: "/uv/uv.sw.js",
};
2 changes: 2 additions & 0 deletions uv/uv.handler.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions uv/uv.handler.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions uv/uv.sw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions uv/uv.sw.js.map

Large diffs are not rendered by default.

0 comments on commit 9d93682

Please sign in to comment.