From: hyunduk.kim Date: Wed, 8 Apr 2020 09:00:23 +0000 (+0900) Subject: Add the option to enable node integration in BrowserWindow X-Git-Tag: submit/tizen/20200423.110429~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b215c1ffd544a6042634db14c53b7a78d6f469b6;p=profile%2Fmobile%2Fapps%2Fweb%2Fwebapp-addon-setting.git Add the option to enable node integration in BrowserWindow To use node in renderer in case of electron app in m76, nodeIntegration must be set as true explicitly when creating an instance of BrowserWindow. Change-Id: I13126b22c843c177821c4670d6969bf8425e9251 Signed-off-by: hyunduk.kim --- diff --git a/main.js b/main.js index 13a9d26..1e074a3 100755 --- a/main.js +++ b/main.js @@ -21,7 +21,13 @@ app.on('window-all-closed', function() { app.on('ready', function() { console.log('ready'); // Create the browser window. - mainWindow = new BrowserWindow({width: 800, height: 600}); + mainWindow = new BrowserWindow({ + width: 800, + height: 600, + webPreferences: { + nodeIntegration: true + } + }); // and load the index.html of the app. mainWindow.loadURL('file://' + __dirname + '/index.html');