From e330cff7d412b5d1c0aa88a24bc2523666c4965d Mon Sep 17 00:00:00 2001 From: Hunlongyu Date: Tue, 27 Oct 2020 11:43:11 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=A6=20electron=20=E4=BC=98=E5=8C=96,?= =?UTF-8?q?=20=E5=BF=BD=E7=95=A5=E8=AF=81=E4=B9=A6=E9=94=99=E8=AF=AF,=20?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=B2=99=E7=9B=92.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/background.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/background.js b/src/background.js index ac0a933..ed843b8 100644 --- a/src/background.js +++ b/src/background.js @@ -7,8 +7,8 @@ import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer' import { initUpdater } from './lib/update/update' const isDevelopment = process.env.NODE_ENV !== 'production' -// 允许跨域 -app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors') +app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors') // 允许跨域 +app.commandLine.appendSwitch('--ignore-certificate-errors', 'true') // 忽略证书相关错误 let win let mini @@ -52,6 +52,7 @@ function createMini () { frame: false, resizable: true, webPreferences: { + sandbox: false, webSecurity: false, enableRemoteModule: true, nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION @@ -76,6 +77,7 @@ if (process.platform === 'darwin') { } if (process.platform === 'Linux') { app.disableHardwareAcceleration() + app.commandLine.appendSwitch('--no-sandbox') // linux 关闭沙盒模式 } app.allowRendererProcessReuse = true