From: Surya Kumar Date: Tue, 24 Nov 2020 07:21:23 +0000 (+0530) Subject: [M85] Suppress a macOS hack present in electron to gain webview focus X-Git-Tag: submit/tizen/20201201.021341^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=40e496ec570bbf6b9398438261e414cab84e763b;p=platform%2Fframework%2Fweb%2Fwrtjs.git [M85] 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. Reference: https://review.tizen.org/gerrit/226898 Change-Id: Ife2e6fd54c146596becd5cd00fb86797a9dc6cae Signed-off-by: Surya Kumar --- diff --git a/wrt_app/browser/wrt_window.ts b/wrt_app/browser/wrt_window.ts index 41c16901..2ac5a144 100644 --- a/wrt_app/browser/wrt_window.ts +++ b/wrt_app/browser/wrt_window.ts @@ -23,6 +23,9 @@ Object.setPrototypeOf(WRTWindow.prototype, BrowserWindow.prototype); WRTWindow.prototype._init = function () { (BrowserWindow.prototype as any)._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;