Explorar o código

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

Samuel Attard %!s(int64=6) %!d(string=hai) anos
pai
achega
cbb3b10fb2
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  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')