diff options
author | alyx <alyx@aleteoryx.me> | 2022-06-02 00:26:49 +0000 |
---|---|---|
committer | Aleteoryx <alyx@aleteoryx.me> | 2022-06-02 00:26:49 +0000 |
commit | c1e64bf0ccdaeb1b676f1a53967b0d0448e1ca44 (patch) | |
tree | 923762a989184bb6a13054d0ca668c85c53db94e /index.html | |
parent | b1ec23e3579b1528e6e7eb12f5c9f89793b5390e (diff) | |
download | RRCUtils-c1e64bf0ccdaeb1b676f1a53967b0d0448e1ca44.tar.gz RRCUtils-c1e64bf0ccdaeb1b676f1a53967b0d0448e1ca44.tar.bz2 RRCUtils-c1e64bf0ccdaeb1b676f1a53967b0d0448e1ca44.zip |
basic PWA things, fixed the searcher again
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -2,9 +2,22 @@ <html> <head> <title>Placeholder</title> + <link rel="manifest" href="/pwathings/manifest.json" /> + <link rel="manifest" href="/pwathings/manifest.json" /> + <script> + var reg; + window.addEventListener("load", async function() { + reg = await navigator.serviceWorker.getRegistrations(); + if (reg.length) document.getElementById("enabler").innerText = "Click to refresh the Service Worker!"; + }); + const reloader = () => Promise.all(reg.map(r => r.unregister())).then(() => navigator.serviceWorker.register('/worker.js', {scope: '/'})); + </script> </head> <body> - <a href="/searcher">Chip Searcher</a> - <a href="/grapher">Chip Grapher</a> + <ul> + <li><a href="/searcher">Chip Searcher</a></li> + <li><a href="/grapher">Chip Grapher</a></li> + <li><button id="enabler" onclick="reloader();">Click to enable offline use!</button></li> + </ul> </body> </html>
\ No newline at end of file |