Tom-M-Git / sysinfoapp_in_electron

A system info app in Electron which shows little information about the user's PC. Built for learning purposes for myself.
0 stars 0 forks source link

nodeIntegration #5

Open Tom-M-Git opened 4 years ago

Tom-M-Git commented 4 years ago

Due to the Node.js integration of Electron, there are some extra symbols inserted into the DOM like module, exports, require. This causes problems for some libraries since they want to insert the symbols with the same names.

To solve this, you can turn off node integration in Electron:

// In the main process.

const { BrowserWindow } = require('electron')
const win = new BrowserWindow({
  webPreferences: {
    nodeIntegration: false
  }
})
win.show()