gpt4 book ai didi

javascript - NodeIntegration不起作用[Electron/js]

转载 作者:行者123 更新时间:2023-12-03 12:41:41 27 4
gpt4 key购买 nike

当我尝试在Electron中启用Node集成时,出现了此错误:

enter image description here

如果删除了Node集成,它将再次起作用。

function createWindow () {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 1500,
height: 800,
autoHideMenuBar: true,
webPreferences: {
nodeIntegration: true,
preload: path.join(__dirname, 'preload.js')
}
})

最佳答案

内容安全策略存在问题。您可以尝试使用所使用的外部样式(例如Bootstrap,FontAwesome等)来设置style-src策略。

关于javascript - NodeIntegration不起作用[Electron/js],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60189118/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com