From 03dd94596ce0f682e19a82e4ab84df27ae508d75 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Mon, 23 Sep 2019 16:59:38 -0500 Subject: [PATCH] Disable window throttling at the Chromium layer, Electron backgroundThrottling is broken #1467 --- app/src/browser/application.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/browser/application.ts b/app/src/browser/application.ts index 3016b08d5..ed100249c 100644 --- a/app/src/browser/application.ts +++ b/app/src/browser/application.ts @@ -260,6 +260,11 @@ export default class Application extends EventEmitter { setupJavaScriptArguments() { app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required'); app.commandLine.appendSwitch('js-flags', '--harmony'); + + // BG TODO: This is required because `webPreferences.backgroundThrottling` is + // broken. Will be fixed by https://github.com/electron/electron/pull/20239. + // Note this impacts all windows so we should change it back when possible. + app.commandLine.appendSwitch('disable-background-timer-throttling'); } openWindowsForTokenState() { @@ -394,13 +399,14 @@ export default class Application extends EventEmitter { }); this.on('application:view-getting-started', () => { - const helpUrl = 'https://foundry376.zendesk.com/hc/en-us/sections/115000521592-Getting-Started'; + const helpUrl = + 'https://foundry376.zendesk.com/hc/en-us/sections/115000521592-Getting-Started'; shell.openExternal(helpUrl); }); - this.on('application:view-faq', () => { - const helpUrl = 'https://foundry376.zendesk.com/hc/en-us/sections/115000521892-Frequently-Asked-Questions'; + const helpUrl = + 'https://foundry376.zendesk.com/hc/en-us/sections/115000521892-Frequently-Asked-Questions'; shell.openExternal(helpUrl); });