Replies: 1 comment 3 replies
-
win = new BrowserWindow({
title: 'Main window',
icon: join(process.env.PUBLIC, 'favicon.ico'),
webPreferences: {
preload,
// Warning: Enable nodeIntegration and disable contextIsolation is not secure in production
// Consider using contextBridge.exposeInMainWorld
// Read more on https://www.electronjs.org/docs/latest/tutorial/context-isolation
- nodeIntegration: true,
- contextIsolation: false,
},
}) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I keep getting an error when I add contextbridge in the preload.
Unable to load preload script: \electron-vite-project\dist-electron\preload\index.js
node:electron/js2c/renderer_init:2 Error: contextBridge API can only be used when contextIsolation is enabled.
I tried to enable contextisolation from the main process, but did not work.
Any suggestion on how to resolve this issue. I have Electron 24.1.3
Thanks
Beta Was this translation helpful? Give feedback.
All reactions