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 --- res/client.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'res/client.js') diff --git a/res/client.js b/res/client.js index 5c52461..ba579ba 100644 --- a/res/client.js +++ b/res/client.js @@ -1399,7 +1399,11 @@ var client_Main = function() { return _gthis.isPageUnloading = true; }); window.addEventListener("blur",function() { - return _gthis.isPageVisible = false; + var tmp = window.document.activeElement; + if((tmp != null ? tmp.tagName : null) == "IFRAME") { + return; + } + _gthis.isPageVisible = false; }); window.addEventListener("focus",function() { return _gthis.isPageVisible = true; @@ -1744,7 +1748,7 @@ client_Main.prototype = { var data = JSON.parse(e.data); if(this.config != null && this.config.isVerbose) { var t = data.type; - haxe_Log.trace("Event: " + data.type,{ fileName : "src/client/Main.hx", lineNumber : 486, className : "client.Main", methodName : "onMessage", customParams : [Reflect.field(data,t.charAt(0).toLowerCase() + HxOverrides.substr(t,1,null))]}); + haxe_Log.trace("Event: " + data.type,{ fileName : "src/client/Main.hx", lineNumber : 489, className : "client.Main", methodName : "onMessage", customParams : [Reflect.field(data,t.charAt(0).toLowerCase() + HxOverrides.substr(t,1,null))]}); } client_JsApi.fireEvents(data); switch(data.type) { -- cgit v1.2.3