diff options
| author | EuAndreh <eu@euandre.org> | 2024-11-01 07:06:35 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2024-11-01 07:06:35 -0300 |
| commit | 6aab6760eec06bd789adf3cecc8678f28311c6a9 (patch) | |
| tree | e560b09b0a491f6f0a2d68bc52e53f2bc5c52bb2 /src/content | |
| parent | WIP: Init work on HTML (diff) | |
| download | chat.papo.im-6aab6760eec06bd789adf3cecc8678f28311c6a9.tar.gz chat.papo.im-6aab6760eec06bd789adf3cecc8678f28311c6a9.tar.xz | |
Use importScripts() instead of generating the service-worker.js file
Diffstat (limited to 'src/content')
| -rw-r--r-- | src/content/service-worker.js | 8 | ||||
| -rw-r--r-- | src/content/sw.js | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/content/service-worker.js b/src/content/service-worker.js new file mode 100644 index 0000000..1afe76c --- /dev/null +++ b/src/content/service-worker.js @@ -0,0 +1,8 @@ +importScripts("sw.js", "images.js"); + +main({ + self, + caches, + clients, + IMG_PATHS, +}); diff --git a/src/content/sw.js b/src/content/sw.js index 51089f2..c86cb43 100644 --- a/src/content/sw.js +++ b/src/content/sw.js @@ -1,5 +1,3 @@ -const IMG_PATHS = []; - const CACHE_NAME = "static-shared-assets"; const leafValues = tree => @@ -114,7 +112,7 @@ const STRATEGIES = [ "index.html", "style.css", "papo.js", - ...IMG_PATHS, + // ...IMG_PATHS, ]), }, { @@ -211,7 +209,8 @@ const main = ({ clients, out = console.log, err = console.warn, -} = {}) => +} = {}) => { + return; // FIXME registerListeners({ self, caches, @@ -220,6 +219,7 @@ const main = ({ out, err, }); +}; // handy resources for pushes: // https://web.dev/articles/offline-cookbook |
