-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e96b9d
commit 9d93682
Showing
10 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.