diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2022-07-24 15:05:17 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2022-07-25 13:54:04 +0200 |
| commit | b1e5893713be7e9c725e0dddffe748130cdb6b2e (patch) | |
| tree | 0715fefb337ad467131b2c5485d218f919968fba /gui/src | |
| parent | 51176121fa7770fd4c7fea3e515221f9e81976f4 (diff) | |
| download | mullvadvpn-b1e5893713be7e9c725e0dddffe748130cdb6b2e.tar.xz mullvadvpn-b1e5893713be7e9c725e0dddffe748130cdb6b2e.zip | |
Add flag that prevents navigation to be reset 2 minutes after blur
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/main/index.ts | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 0b3bb1b834..461cac3214 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -109,6 +109,7 @@ const ALLOWED_PERMISSIONS = ['clipboard-sanitized-write']; enum Options { quitWithoutDisconnect = '--quit-without-disconnect', showChanges = '--show-changes', + disableResetNavigation = '--disable-reset-navigation', // development only } enum AppQuitStage { @@ -250,6 +251,7 @@ class ApplicationMain { }, ); + private disableResetNavigation = process.argv.includes(Options.disableResetNavigation); private blurNavigationResetScheduler = new Scheduler(); private backgroundThrottleScheduler = new Scheduler(); @@ -1261,14 +1263,16 @@ class ApplicationMain { // Use hide instead of blur to prevent the navigation reset from happening when bluring an // unpinned window. windowController.window?.on('hide', () => { - this.blurNavigationResetScheduler.schedule(() => { - this.windowController?.webContents?.setBackgroundThrottling(false); - IpcMainEventChannel.navigation.notifyReset(windowController.webContents); + if (process.env.NODE_ENV !== 'development' || !this.disableResetNavigation) { + this.blurNavigationResetScheduler.schedule(() => { + this.windowController?.webContents?.setBackgroundThrottling(false); + IpcMainEventChannel.navigation.notifyReset(windowController.webContents); - this.backgroundThrottleScheduler.schedule(() => { - this.windowController?.webContents?.setBackgroundThrottling(true); - }, 1_000); - }, 120_000); + this.backgroundThrottleScheduler.schedule(() => { + this.windowController?.webContents?.setBackgroundThrottling(true); + }, 1_000); + }, 120_000); + } }); } |
