const mainWindow = new BrowserWindow({
webPreferences: {
webSecurity: false
}
})
const startUrl =
process.env.NODE_ENV === 'dev'
? 'http://localhost:3000'
: path.join(__dirname, "/build/index.html");
mainWindow.loadURL(startUrl);
需要設定webSecurity: false。