diff options
| author | RblSb <msrblsb@gmail.com> | 2025-05-02 17:17:00 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2025-05-02 17:17:00 +0300 |
| commit | 4b48de4f824ce48f1466014a9e9aa24023212181 (patch) | |
| tree | e1b52ce890f059bff3ca33e5ddcee07d1f51ec63 /src/client/Main.hx | |
| parent | 047a2b3d175cd836d2abc2c5e80371b13bb0a6cc (diff) | |
Ignore window.onblur for iframe clicks
closes #63
Diffstat (limited to 'src/client/Main.hx')
| -rw-r--r-- | src/client/Main.hx | 5 |
1 files changed, 4 insertions, 1 deletions
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; |
