From 81c67a1e08188ff8af56bedab6fa626742bcdaa0 Mon Sep 17 00:00:00 2001 From: Kiran Niranjan Date: Mon, 27 Jul 2020 19:41:21 +0530 Subject: [PATCH] fix: SDA-2287 (Only create context bridge when CI is enabled and create new config filed for defining origin) (#1036) * SDA-2287 - Only create context bridge when CI is enabled and create new config filed for defining origin * SDA-2287 - Revert loading context bridge as it is not necessary --- config/Symphony.config | 1 + src/app/config-handler.ts | 1 + src/app/window-handler.ts | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/Symphony.config b/config/Symphony.config index 52050ce5..900e87b4 100644 --- a/config/Symphony.config +++ b/config/Symphony.config @@ -10,6 +10,7 @@ "memoryThreshold": "800", "devToolsEnabled": true, "contextIsolation": true, + "contextOriginUrl": "", "disableGpu": false, "enableRendererLogs": false, "ctWhitelist": [], diff --git a/src/app/config-handler.ts b/src/app/config-handler.ts index e74e8cee..fe99c8db 100644 --- a/src/app/config-handler.ts +++ b/src/app/config-handler.ts @@ -42,6 +42,7 @@ export interface IConfig { } export interface IGlobalConfig { + contextOriginUrl: string; url: string; contextIsolation: boolean; } diff --git a/src/app/window-handler.ts b/src/app/window-handler.ts index b4630a71..f6a29730 100644 --- a/src/app/window-handler.ts +++ b/src/app/window-handler.ts @@ -117,7 +117,7 @@ export class WindowHandler { this.config = config.getConfigFields([ 'isCustomTitleBar', 'mainWinPos', 'minimizeOnClose', 'notificationSettings', 'alwaysOnTop', 'locale', 'customFlags', 'clientSwitch' ]); logger.info(`window-handler: main windows initialized with following config data`, this.config); - this.globalConfig = config.getGlobalConfigFields([ 'url', 'contextIsolation' ]); + this.globalConfig = config.getGlobalConfigFields([ 'url', 'contextIsolation', 'contextOriginUrl' ]); this.userConfig = config.getUserConfigFields([ 'url' ]); const { customFlags } = this.config; @@ -296,7 +296,7 @@ export class WindowHandler { // update version info from server this.updateVersionInfo(); // need this for postMessage origin - this.mainWindow.origin = this.url; + this.mainWindow.origin = this.globalConfig.contextOriginUrl || this.url; // Event needed to hide native menu bar on Windows 10 as we use custom menu bar this.mainWindow.webContents.once('did-start-loading', () => {