Selaa lähdekoodia

fix: specify nodeIntegration=true for Electron 5 compat (#257)

Samuel Attard 6 vuotta sitten
vanhempi
commit
cbb3b10fb2
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      main.js

+ 7 - 1
main.js

@@ -7,7 +7,13 @@ let mainWindow
 
 function createWindow () {
   // 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.loadFile('index.html')