-
WFW-Aushang
-
-
-
+
Installiere mich!
+
+
+
-
-
-
-
-
-
-
+
diff --git a/zuss/manifest.webmanifest b/zuss/manifest.webmanifest
index 15f9b99..41b80e0 100644
--- a/zuss/manifest.webmanifest
+++ b/zuss/manifest.webmanifest
@@ -1,9 +1,9 @@
{
"name": "WFW-Aushang",
"short_name": "WFW-Aushang",
- "start_url": "/zuss/",
+ "start_url": "/zuss/?source=pwa",
"scope": "/zuss/",
- "display": "fullscreen",
+ "display": "standalone",
"orientation": "portrait",
"background_color": "#0b1020",
"theme_color": "#0b1020",
@@ -12,3 +12,4 @@
{ "src": "/zuss/icons/icon-512.png", "sizes": "512x512", "type": "image/png" }
]
}
+
diff --git a/zuss/sw.js b/zuss/sw.js
index 460b24e..574b7aa 100644
--- a/zuss/sw.js
+++ b/zuss/sw.js
@@ -1,5 +1,4 @@
-// Simple offline cache for kiosk usage
-const CACHE = "wfw-aushang-2025.12.24.2";
+const CACHE = "wfw-aushang-2025.12.24.6";
const ASSETS = [
"/zuss/",
@@ -12,48 +11,51 @@ const ASSETS = [
];
self.addEventListener("install", (event) => {
- event.waitUntil(
- caches.open(CACHE).then((c) => c.addAll(ASSETS)).then(() => self.skipWaiting())
- );
+ event.waitUntil((async () => {
+ const cache = await caches.open(CACHE);
+ await cache.addAll(ASSETS);
+ self.skipWaiting();
+ })());
});
self.addEventListener("activate", (event) => {
- event.waitUntil(
- (async () => {
- const keys = await caches.keys();
- await Promise.all(keys.map(k => (k === CACHE ? null : caches.delete(k))));
- await self.clients.claim();
- })()
- );
+ event.waitUntil((async () => {
+ const keys = await caches.keys();
+ await Promise.all(keys.map(k => (k === CACHE ? null : caches.delete(k))));
+ self.clients.claim();
+ })());
});
-// Network-first for version.json + list, cache-first for static assets
self.addEventListener("fetch", (event) => {
- const url = new URL(event.request.url);
+ const req = event.request;
+ const url = new URL(req.url);
- // Only handle same-origin requests
- if (url.origin !== self.location.origin) return;
-
- const isVersion = url.pathname.endsWith("/zuss/version.json");
-
- if (isVersion) {
- event.respondWith(
- fetch(event.request, { cache: "no-store" }).catch(() => caches.match(event.request))
- );
+ // Network-first for version.json (so updates are found)
+ if (url.pathname.endsWith("/zuss/version.json")) {
+ event.respondWith((async () => {
+ try {
+ const fresh = await fetch(req, { cache: "no-store" });
+ const cache = await caches.open(CACHE);
+ cache.put(req, fresh.clone());
+ return fresh;
+ } catch {
+ const cached = await caches.match(req);
+ return cached || new Response('{"version":"2025.12.24.6"}', { headers: { "Content-Type": "application/json" } });
+ }
+ })());
return;
}
- // Cache-first for our own static assets
+ // Cache-first for app shell
if (url.pathname.startsWith("/zuss/")) {
- event.respondWith(
- caches.match(event.request).then((cached) => {
- if (cached) return cached;
- return fetch(event.request).then((resp) => {
- const copy = resp.clone();
- caches.open(CACHE).then((c) => c.put(event.request, copy));
- return resp;
- });
- })
- );
+ event.respondWith((async () => {
+ const cached = await caches.match(req);
+ if (cached) return cached;
+ const fresh = await fetch(req);
+ const cache = await caches.open(CACHE);
+ cache.put(req, fresh.clone());
+ return fresh;
+ })());
+ return;
}
});
diff --git a/zuss/version.json b/zuss/version.json
index 5338ccd..ae178e3 100644
--- a/zuss/version.json
+++ b/zuss/version.json
@@ -1 +1 @@
-{ "version": "2025.12.24.2" }
\ No newline at end of file
+{ "version": "2025.12.24.6" }