new file - close check

This commit is contained in:
thrhymes
2025-12-24 21:44:53 +01:00
parent e1bda360f4
commit 89de32ee25
5 changed files with 56 additions and 21 deletions

View File

@@ -4,7 +4,7 @@
* - Install/Update Overlay mit beforeinstallprompt.prompt()
*/
const APP_VERSION = "2025.12.24.8";
const APP_VERSION = "2025.12.24.9";
const TOKEN = "T9e7WESBXxy6rSD";
const BASE = "https://home.x-s.at";
const SHARE_DAV = `${BASE}/public.php/dav/files/${TOKEN}`;
@@ -327,22 +327,8 @@ 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);
const ret = encodeURIComponent(location.pathname + location.search);
window.location.href = `./close.html?return=${ret}`;
}
function applyTheme(t){