new file - close check
This commit is contained in:
20
zuss/app.js
20
zuss/app.js
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user