I got this error when I tried to enable the integration of Node in Electron:
If I remove the Node integration, it works again.
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')
}
})
There is an issue with the Content Security Policy. You can try to set style-src policy with the external styles you are using (such as Bootstrap, FontAwesome and so on).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.