These web apis for window open on main process.
API :
- addonAPI.window.open(url)
Change-Id: I1d0e45065b2a412ec1702efb5fec6e2e507e6bb6
Signed-off-by: Aron kim <aron.kim@samsung.com>
'use strict';
import { dialog, BrowserWindow } from 'electron';
'use strict';
import { dialog, BrowserWindow } from 'electron';
+import * as WRTWebContents from '../../../browser/wrt_web_contents';
+import { WRTWindow } from '../../../browser/wrt_window';
+
export const loadURL= function (winId: number, url: string) {
let window = BrowserWindow.fromId(winId);
export const loadURL= function (winId: number, url: string) {
let window = BrowserWindow.fromId(winId);
window.webContents.executeJavaScript(string, true);
};
window.webContents.executeJavaScript(string, true);
};
+export const open = function (url: string) {
+ let window = new WRTWindow(
+ { webPreferences: {
+ nodeIntegration: true,
+ nodeIntegrationInSubFrames: true,
+ nodeIntegrationInWorker: false,
+ nativeWindowOpen: true,
+ },
+ webContents: WRTWebContents.create(),
+ });
+ window.loadURL(url);
+ return window.id;
+};