mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-30 00:55:20 +01:00
Set nodeIntegration for webview to use ipc, process and require in renderer process
This commit is contained in:
parent
de131927e2
commit
b5d1bba517
@ -203,7 +203,6 @@ async function createWindow() {
|
||||
defaultWidth: 1000,
|
||||
defaultHeight: 563
|
||||
})
|
||||
// mainWindow = new BrowserWindow({
|
||||
const mainOpts: BrowserWindowConstructorOptions = {
|
||||
titleBarStyle: 'hidden',
|
||||
x: mainWindowState.x,
|
||||
@ -211,7 +210,12 @@ async function createWindow() {
|
||||
width: mainWindowState.width,
|
||||
height: mainWindowState.height,
|
||||
useContentSize: true,
|
||||
icon: path.resolve(__dirname, '../../build/icons/256x256.png')
|
||||
icon: path.resolve(__dirname, '../../build/icons/256x256.png'),
|
||||
webPreferences: {
|
||||
// It is required to use ipcRenderer in renderer process.
|
||||
// But it is not secure, so if you want to disable this option, please use preload script.
|
||||
nodeIntegration: true
|
||||
}
|
||||
}
|
||||
const config: Config = {
|
||||
windowOpts: mainOpts,
|
||||
|
Loading…
x
Reference in New Issue
Block a user