From 4b48de4f824ce48f1466014a9e9aa24023212181 Mon Sep 17 00:00:00 2001 From: RblSb Date: Fri, 2 May 2025 17:17:00 +0300 Subject: Ignore window.onblur for iframe clicks closes #63 --- src/client/Main.hx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/Main.hx b/src/client/Main.hx index 9a4c809..d3d1ce2 100644 --- a/src/client/Main.hx +++ b/src/client/Main.hx @@ -117,7 +117,10 @@ class Main { document.addEventListener("click", onFirstInteraction); window.addEventListener("beforeunload", () -> isPageUnloading = true); - window.addEventListener("blur", () -> isPageVisible = false); + window.addEventListener("blur", () -> { + if (document.activeElement?.tagName == "IFRAME") return; + isPageVisible = false; + }); window.addEventListener("focus", () -> isPageVisible = true); document.addEventListener("visibilitychange", () -> { isPageVisible = document.visibilityState == VISIBLE; -- cgit v1.2.3