From 6aec78e15303a26764cbb7deebfa1f691c930bcc Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sun, 3 May 2020 12:49:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/index.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index 979e5c9f..022e0154 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -22,6 +22,18 @@ app.on('second-instance', (event, argv, cwd) => { const isDev = global.isDev = process.env.NODE_ENV !== 'production' const { navigationUrlWhiteList } = require('../common/config') +const { getAppSetting, parseEnv, getWindowSizeInfo } = require('./utils') +const { isMac, isLinux } = require('../common/utils') + +global.envParams = parseEnv() + + +// https://github.com/electron/electron/issues/22691 +app.commandLine.appendSwitch('wm-window-animations-disabled') + +// https://github.com/electron/electron/issues/18397 +app.allowRendererProcessReuse = true + app.on('web-contents-created', (event, contents) => { contents.on('will-navigate', (event, navigationUrl) => { @@ -50,22 +62,12 @@ app.on('web-contents-created', (event, contents) => { }) }) -// https://github.com/electron/electron/issues/22691 -app.commandLine.appendSwitch('wm-window-animations-disabled') - -// https://github.com/electron/electron/issues/18397 -app.allowRendererProcessReuse = !isDev - -const { getAppSetting, parseEnv, getWindowSizeInfo } = require('./utils') - -global.envParams = parseEnv() require('../common/error') require('./events') require('./rendererEvents') const winEvent = require('./rendererEvents/winEvent') const autoUpdate = require('./utils/autoUpdate') -const { isMac, isLinux } = require('../common/utils') let winURL