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
This commit is contained in:
Kiran Niranjan 2020-07-27 19:41:21 +05:30 committed by GitHub
parent 589bc1f8e5
commit 81c67a1e08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -10,6 +10,7 @@
"memoryThreshold": "800",
"devToolsEnabled": true,
"contextIsolation": true,
"contextOriginUrl": "",
"disableGpu": false,
"enableRendererLogs": false,
"ctWhitelist": [],

View File

@ -42,6 +42,7 @@ export interface IConfig {
}
export interface IGlobalConfig {
contextOriginUrl: string;
url: string;
contextIsolation: boolean;
}

View File

@ -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', () => {