Sfoglia il codice sorgente

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

Samuel Attard 6 anni fa
parent
commit
cbb3b10fb2
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  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')