使用Electron支持的命令行开关 可以在app 模块的ready事件生效之前,使用app.commandLine.appendSwitch将它们附加到您的应用程序的主要脚本中 const { app } = require('electron') app.commandLine.appendSwitch('ignore-certificate-errors') app.whenReady().then(() => { // 在这里写入你的代码 })