From: Surya Kumar Date: Fri, 6 Mar 2020 07:11:20 +0000 (+0530) Subject: Suppress a macOS hack present in electron to gain webview focus X-Git-Tag: submit/tizen_5.5/20200316.025242^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eef98a54cb73e79716731a799194035390ba63a2;p=platform%2Fframework%2Fweb%2Fwrtjs.git Suppress a macOS hack present in electron to gain webview focus A hack used by electron meant for macOS & extended for other platforms contingently is causing behavior difference from XWALK. Since that's the only consumer of 'load-url', removed all event listeners. Focus will anyway be gained by WebContents on their respective show() calls. Fixes P200228-07034 & P200113-07900. Change-Id: Ic67f3e5d74cdf47b909134ba7734189af1aa5a95 Signed-off-by: Surya Kumar --- diff --git a/wrt_app/browser/wrt_window.js b/wrt_app/browser/wrt_window.js index 004f26d2..e072959c 100644 --- a/wrt_app/browser/wrt_window.js +++ b/wrt_app/browser/wrt_window.js @@ -22,6 +22,9 @@ Object.setPrototypeOf(WRTWindow.prototype, BrowserWindow.prototype) WRTWindow.prototype._init = function () { BrowserWindow.prototype._init.call(this) + // This removes a macOS specific hack present in electron + // that causes side effects on Tizen + this.webContents.removeAllListeners('load-url') if (typeof this.setup === 'function') this.setup() this.constructor = BrowserWindow