From e1bda360f431bd0a31f11340a593084f0ae67085 Mon Sep 17 00:00:00 2001
From: thrhymes
Date: Wed, 24 Dec 2025 21:38:27 +0100
Subject: [PATCH] up to 7
---
zuss/app.js | 28 +++++++++++++++++++++-------
zuss/index.html | 2 +-
zuss/manifest.webmanifest | 3 +--
zuss/sw.js | 4 ++--
zuss/version.json | 2 +-
5 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/zuss/app.js b/zuss/app.js
index 2cec45f..965dc2f 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.6";
+const APP_VERSION = "2025.12.24.8";
const TOKEN = "T9e7WESBXxy6rSD";
const BASE = "https://home.x-s.at";
const SHARE_DAV = `${BASE}/public.php/dav/files/${TOKEN}`;
@@ -326,6 +326,25 @@ async function registerSW() {
}
}
+function closeAushang(){
+ try { window.close(); } catch {}
+ // Some browsers block close() once we navigated to pdf.js and back; fallback to back/blank
+ setTimeout(() => {
+ if (document.visibilityState === "hidden") return; // tab closed or navigating
+ const ref = document.referrer || "";
+ const cameFromPdf = ref.includes("/pdfjs/");
+ if (ref && !cameFromPdf) {
+ history.back();
+ setTimeout(() => {
+ if (document.visibilityState === "hidden") return;
+ location.href = "about:blank";
+ }, 180);
+ } else {
+ location.href = "about:blank";
+ }
+ }, 140);
+}
+
function applyTheme(t){
document.documentElement.setAttribute("data-theme", t);
localStorage.setItem("wfw_theme", t);
@@ -377,12 +396,7 @@ document.addEventListener("click", (e) => {
document.addEventListener("DOMContentLoaded", async () => {
$("refreshBtn").addEventListener("click", (e) => { e.preventDefault(); loadList(); });
- $("closeBtn").addEventListener("click", (e) => {
- e.preventDefault();
- // Kiosk-ish: close tab if possible, else just go back
- window.close();
- setTimeout(() => { history.back(); }, 150);
- });
+ $("closeBtn").addEventListener("click", (e) => { e.preventDefault(); closeAushang(); });
initTheme();
$("themeBtn").addEventListener("click", () => {
const current = document.documentElement.getAttribute("data-theme") || "dark";
diff --git a/zuss/index.html b/zuss/index.html
index 2cd8969..1c896b7 100644
--- a/zuss/index.html
+++ b/zuss/index.html
@@ -168,6 +168,6 @@
-
+
|