mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Merge branch 'master' of github.com:symphonyoss/SymphonyElectron
This commit is contained in:
commit
5c80265c42
@ -10,6 +10,7 @@
|
|||||||
"memoryThreshold": "800",
|
"memoryThreshold": "800",
|
||||||
"devToolsEnabled": true,
|
"devToolsEnabled": true,
|
||||||
"contextIsolation": true,
|
"contextIsolation": true,
|
||||||
|
"contextOriginUrl": "",
|
||||||
"disableGpu": false,
|
"disableGpu": false,
|
||||||
"enableRendererLogs": false,
|
"enableRendererLogs": false,
|
||||||
"ctWhitelist": [],
|
"ctWhitelist": [],
|
||||||
|
@ -159,8 +159,9 @@ export const handleChildWindow = (webContents: WebContents): void => {
|
|||||||
// Event needed to hide native menu bar
|
// Event needed to hide native menu bar
|
||||||
childWebContents.once('did-start-loading', () => {
|
childWebContents.once('did-start-loading', () => {
|
||||||
const browserWin = BrowserWindow.fromWebContents(childWebContents) as ICustomBrowserWindow;
|
const browserWin = BrowserWindow.fromWebContents(childWebContents) as ICustomBrowserWindow;
|
||||||
|
const { contextOriginUrl } = config.getGlobalConfigFields([ 'contextOriginUrl' ]);
|
||||||
browserWin.setFullScreenable(true);
|
browserWin.setFullScreenable(true);
|
||||||
browserWin.origin = windowHandler.url;
|
browserWin.origin = contextOriginUrl || windowHandler.url;
|
||||||
if (isWindowsOS && browserWin && !browserWin.isDestroyed()) {
|
if (isWindowsOS && browserWin && !browserWin.isDestroyed()) {
|
||||||
browserWin.setMenuBarVisibility(false);
|
browserWin.setMenuBarVisibility(false);
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ export interface IConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IGlobalConfig {
|
export interface IGlobalConfig {
|
||||||
|
contextOriginUrl: string;
|
||||||
url: string;
|
url: string;
|
||||||
contextIsolation: boolean;
|
contextIsolation: boolean;
|
||||||
}
|
}
|
||||||
|
@ -69,9 +69,15 @@ if (!isDevEnv) {
|
|||||||
/**
|
/**
|
||||||
* Main function that init the application
|
* Main function that init the application
|
||||||
*/
|
*/
|
||||||
|
let oneStart = false;
|
||||||
const startApplication = async () => {
|
const startApplication = async () => {
|
||||||
await app.whenReady();
|
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();
|
createAppCacheFile();
|
||||||
if (config.isFirstTimeLaunch()) {
|
if (config.isFirstTimeLaunch()) {
|
||||||
logger.info(`main: This is a first time launch! will update config and handle auto launch`);
|
logger.info(`main: This is a first time launch! will update config and handle auto launch`);
|
||||||
|
@ -117,7 +117,7 @@ export class WindowHandler {
|
|||||||
this.config = config.getConfigFields([ 'isCustomTitleBar', 'mainWinPos', 'minimizeOnClose', 'notificationSettings', 'alwaysOnTop', 'locale', 'customFlags', 'clientSwitch' ]);
|
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);
|
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' ]);
|
this.userConfig = config.getUserConfigFields([ 'url' ]);
|
||||||
|
|
||||||
const { customFlags } = this.config;
|
const { customFlags } = this.config;
|
||||||
@ -296,7 +296,7 @@ export class WindowHandler {
|
|||||||
// update version info from server
|
// update version info from server
|
||||||
this.updateVersionInfo();
|
this.updateVersionInfo();
|
||||||
// need this for postMessage origin
|
// 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
|
// Event needed to hide native menu bar on Windows 10 as we use custom menu bar
|
||||||
this.mainWindow.webContents.once('did-start-loading', () => {
|
this.mainWindow.webContents.once('did-start-loading', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user