Merge branch 'master' of github.com:symphonyoss/SymphonyElectron

This commit is contained in:
Vishwas Shashidhar 2020-07-29 14:21:45 +05:30
commit 5c80265c42
5 changed files with 13 additions and 4 deletions

View File

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

View File

@ -159,8 +159,9 @@ export const handleChildWindow = (webContents: WebContents): void => {
// Event needed to hide native menu bar
childWebContents.once('did-start-loading', () => {
const browserWin = BrowserWindow.fromWebContents(childWebContents) as ICustomBrowserWindow;
const { contextOriginUrl } = config.getGlobalConfigFields([ 'contextOriginUrl' ]);
browserWin.setFullScreenable(true);
browserWin.origin = windowHandler.url;
browserWin.origin = contextOriginUrl || windowHandler.url;
if (isWindowsOS && browserWin && !browserWin.isDestroyed()) {
browserWin.setMenuBarVisibility(false);
}

View File

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

View File

@ -69,9 +69,15 @@ if (!isDevEnv) {
/**
* Main function that init the application
*/
let oneStart = false;
const startApplication = async () => {
await app.whenReady();
logger.info(`main: app is ready, performing initial checks`);
if (oneStart) {
return;
}
logger.info('main: app is ready, performing initial checks oneStart: ' + oneStart);
oneStart = true;
createAppCacheFile();
if (config.isFirstTimeLaunch()) {
logger.info(`main: This is a first time launch! will update config and handle auto launch`);

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