summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhyunduk.kim <hyunduk.kim@samsung.com>2020-04-08 17:54:42 +0900
committerhyunduk.kim <hyunduk.kim@samsung.com>2020-04-08 17:54:42 +0900
commitf2491b13996b07e529a06cb6053056c4b192204e (patch)
treedc77c0df529d3c2f8e2c584933ec892a3258df2b
parent9a743a9a434744f6b68fb6dd7c6e2972599f7339 (diff)
downloadwebapp-addon-setting-f2491b13996b07e529a06cb6053056c4b192204e.tar.gz
webapp-addon-setting-f2491b13996b07e529a06cb6053056c4b192204e.tar.bz2
webapp-addon-setting-f2491b13996b07e529a06cb6053056c4b192204e.zip
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: I362126f9f2702c917bc94f802f2097665a14f380 Signed-off-by: hyunduk.kim <hyunduk.kim@samsung.com>
-rwxr-xr-xmain.js8
1 files changed, 7 insertions, 1 deletions
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');