ThorstenHans / ngx-electron

A simple Angular wrapper for electron's Renderer API
MIT License
429 stars 86 forks source link

contextIsolation is deprecated, but setting it to false throws null error #58

Open TheColorRed opened 3 years ago

TheColorRed commented 3 years ago

When contextIsolation is set to true, the following error is produced:

TypeError: Cannot read property 'send' of null

However, with it off/emitted, electron says:

(node:9944) electron: The default of contextIsolation is deprecated and will be changing from false to true in a future release of Electron. See https://github.com/electron/electron/issues/23506 for more information

  const win = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: true
    }
  })

Is there a way around this?

Nantris commented 3 years ago

You can't use nodeIntegration with contextIsolation - they're mutually exclusive.