From e3c69b618838c987666cab1d547ebbebb53c434a Mon Sep 17 00:00:00 2001 From: thrhymes Date: Wed, 24 Dec 2025 22:02:43 +0100 Subject: [PATCH] closed the chapter on close --- zuss/app.js | 14 +++++++++++--- zuss/index.html | 2 +- zuss/sw.js | 5 ++--- zuss/version.json | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/zuss/app.js b/zuss/app.js index d17812b..e1ca348 100644 --- a/zuss/app.js +++ b/zuss/app.js @@ -4,7 +4,7 @@ * - Install/Update Overlay mit beforeinstallprompt.prompt() */ -const APP_VERSION = "2025.12.24.10"; +const APP_VERSION = "2025.12.24.11"; const TOKEN = "T9e7WESBXxy6rSD"; const BASE = "https://home.x-s.at"; const SHARE_DAV = `${BASE}/public.php/dav/files/${TOKEN}`; @@ -331,8 +331,16 @@ async function registerSW() { } function closeAushang(){ - const ret = encodeURIComponent(location.pathname + location.search); - window.location.href = `./close.html?return=${ret}`; + try { window.close(); } catch {} + // Fallbacks: first try history back, then blank + setTimeout(() => { + if (document.visibilityState === "hidden") return; // tab closed + history.back(); + setTimeout(() => { + if (document.visibilityState === "hidden") return; + location.replace("about:blank"); + }, 200); + }, 120); } function applyTheme(t){ diff --git a/zuss/index.html b/zuss/index.html index 69a7d08..c52038b 100644 --- a/zuss/index.html +++ b/zuss/index.html @@ -169,6 +169,6 @@ - + diff --git a/zuss/sw.js b/zuss/sw.js index 7a8eb75..4ceeb52 100644 --- a/zuss/sw.js +++ b/zuss/sw.js @@ -1,9 +1,8 @@ -const CACHE = "wfw-aushang-2025.12.24.10"; +const CACHE = "wfw-aushang-2025.12.24.11"; const ASSETS = [ "/zuss/", "/zuss/index.html", - "/zuss/close.html", "/zuss/app.js", "/zuss/manifest.webmanifest", "/zuss/version.json", @@ -41,7 +40,7 @@ self.addEventListener("fetch", (event) => { return fresh; } catch { const cached = await caches.match(req); - return cached || new Response('{"version":"2025.12.24.10"}', { headers: { "Content-Type": "application/json" } }); + return cached || new Response('{"version":"2025.12.24.11"}', { headers: { "Content-Type": "application/json" } }); } })()); return; diff --git a/zuss/version.json b/zuss/version.json index 6b1b196..cb0ce78 100644 --- a/zuss/version.json +++ b/zuss/version.json @@ -1 +1 @@ -{ "version": "2025.12.24.10" } +{ "version": "2025.12.24.11" }