Using native window open 95/248995/2
authorSangYong Park <sy302.park@samsung.com>
Fri, 4 Dec 2020 04:55:37 +0000 (13:55 +0900)
committerSangYong Park <sy302.park@samsung.com>
Mon, 7 Dec 2020 04:47:16 +0000 (13:47 +0900)
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 <sy302.park@samsung.com>
wrt_app/browser/wrt_window.ts
wrt_app/src/web_application.ts

index 2ac5a14..ebb7423 100644 (file)
@@ -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);
     }
index 147ff8e..fbaff44 100755 (executable)
@@ -244,7 +244,8 @@ export class WebApplication {
       show: false,
       webPreferences: {
         nodeIntegration: options.isAddonAvailable,
-        nodeIntegrationInWorker: false
+        nodeIntegrationInWorker: false,
+        nativeWindowOpen: true,
       },
       webContents: WRTWebContents.create(),
     };