Skip to content

Commit

Permalink
feat: use UV version 1.0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinLiquid authored Jan 29, 2024
1 parent 159787b commit ad38f19
Show file tree
Hide file tree
Showing 14 changed files with 43,623 additions and 41,266 deletions.
20 changes: 16 additions & 4 deletions public/uv-sw.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
// @ts-nocheck
/*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/uv.sw.js');

importScripts(`uv.config.js`);

const params = new URL(self.location.href).searchParams
const serverURL = atob(params.get('url'));
const sw = new UVServiceWorker(serverURL);
self.__uv$config.bare = `${serverURL}/bare/`

importScripts('uv.bundle.js');
importScripts(__uv$config.sw || 'uv.sw.js');

const sw = new UVServiceWorker();

self.addEventListener('fetch', event => event.respondWith(sw.fetch(event)));
self.addEventListener('fetch', (event) => event.respondWith(sw.fetch(event)));
Loading

0 comments on commit ad38f19

Please sign in to comment.