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.
9 lines
580 B
JavaScript
9 lines
580 B
JavaScript
// 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)));
|