Make the server installable as a home-screen PWA
Adds a web manifest, hand-drawn cup+frame icons, and a presence-only service worker (no offline caching) so mobile browsers offer "Add to Home Screen" for the server UI.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// Presence-only service worker: satisfies the "installable" requirement
|
||||
// (Chrome/Android in particular checks for a controlling SW with a fetch
|
||||
// handler) without adding an offline cache -- every request just goes to
|
||||
// the network as normal. Served from / (see app/main.py's /sw.js route)
|
||||
// so its scope covers the whole app, not just /static/.
|
||||
self.addEventListener("install", () => self.skipWaiting());
|
||||
self.addEventListener("activate", (event) => event.waitUntil(self.clients.claim()));
|
||||
self.addEventListener("fetch", (event) => event.respondWith(fetch(event.request)));
|
||||
Reference in New Issue
Block a user