mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-30 17:15:16 +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,
|
defaultWidth: 1000,
|
||||||
defaultHeight: 563
|
defaultHeight: 563
|
||||||
})
|
})
|
||||||
// mainWindow = new BrowserWindow({
|
|
||||||
const mainOpts: BrowserWindowConstructorOptions = {
|
const mainOpts: BrowserWindowConstructorOptions = {
|
||||||
titleBarStyle: 'hidden',
|
titleBarStyle: 'hidden',
|
||||||
x: mainWindowState.x,
|
x: mainWindowState.x,
|
||||||
@ -211,7 +210,12 @@ async function createWindow() {
|
|||||||
width: mainWindowState.width,
|
width: mainWindowState.width,
|
||||||
height: mainWindowState.height,
|
height: mainWindowState.height,
|
||||||
useContentSize: true,
|
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 = {
|
const config: Config = {
|
||||||
windowOpts: mainOpts,
|
windowOpts: mainOpts,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user