SDA-2063: fix origin issues for postMessage

Signed-off-by: Vishwas Shashidhar <vishwas.shashidhar@symphony.com>
This commit is contained in:
Vishwas Shashidhar 2020-05-12 19:37:24 +05:30
parent 03b49240ba
commit 586913f4b2

View File

@ -265,6 +265,15 @@ export class WindowHandler {
this.handleWelcomeScreen();
}
// loads the main window with url from config/cmd line
this.mainWindow.loadURL(this.url);
// check for build expiry in case of test builds
this.checkExpiry(this.mainWindow);
// update version info from server
this.updateVersionInfo();
// need this for postMessage origin
this.mainWindow.origin = 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', () => {
logger.info(`window-handler: main window web contents started loading!`);
@ -419,15 +428,6 @@ export class WindowHandler {
// Handle pop-outs window
handleChildWindow(this.mainWindow.webContents);
// loads the main window with url from config/cmd line
await this.mainWindow.loadURL(this.url);
// check for build expiry in case of test builds
await this.checkExpiry(this.mainWindow);
// update version info from server
this.updateVersionInfo();
// need this for postMessage origin
this.mainWindow.origin = this.url;
return this.mainWindow;
}