From: SangYong Park Date: Fri, 4 Dec 2020 04:55:37 +0000 (+0900) Subject: Using native window open X-Git-Tag: submit/tizen/20210120.160025^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c0a8c5c989b12c33e1949597d0050e2e0291f21;p=platform%2Fframework%2Fweb%2Fwrtjs.git Using native window open window.open uses electron js logic when renderer was integrated with node. (node is integrated in renderer when addon is enabled. and default webapp do not use node in renderer side.). It has some compatibility issue. so, use native window open always. related: https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/248981/ Change-Id: I8d786b2d9d1ba97796217f0b2cb2371e89b80479 Signed-off-by: SangYong Park --- diff --git a/wrt_app/browser/wrt_window.ts b/wrt_app/browser/wrt_window.ts index 2ac5a144..ebb74234 100644 --- a/wrt_app/browser/wrt_window.ts +++ b/wrt_app/browser/wrt_window.ts @@ -29,14 +29,13 @@ WRTWindow.prototype._init = function () { if (typeof this.setup === 'function') this.setup(); this.constructor = BrowserWindow; - let self = this; this.webContents.on('new-window', (event: Electron.NewWindowWebContentsEvent, url: string, frameName: string, disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'), options: any) => { event.preventDefault(); - if (!options.webContents || options.webContents === self) { + if (!options.webContents) { options.webContents = WRTWebContents.create(); options.webContents.loadURL(url); } diff --git a/wrt_app/src/web_application.ts b/wrt_app/src/web_application.ts index 147ff8e4..fbaff443 100755 --- a/wrt_app/src/web_application.ts +++ b/wrt_app/src/web_application.ts @@ -244,7 +244,8 @@ export class WebApplication { show: false, webPreferences: { nodeIntegration: options.isAddonAvailable, - nodeIntegrationInWorker: false + nodeIntegrationInWorker: false, + nativeWindowOpen: true, }, webContents: WRTWebContents.create(), };