🐛 SDA-3487 - Load preload js file for popout window in 1.5 (#1306)

This commit is contained in:
Kiran Niranjan 2021-12-07 20:21:13 +05:30 committed by GitHub
parent 6098f710a4
commit 9e4a51fcfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@ import {
WebContents,
} from 'electron';
import * as path from 'path';
import { parse as parseQuerystring } from 'querystring';
import { format, parse, Url } from 'url';
import { isWindowsOS } from '../common/env';
@ -158,18 +159,23 @@ export const handleChildWindow = (webContents: WebContents): void => {
};
}
const configSettings = config.getConfigFields(['alwaysOnTop']);
const opts: BrowserWindowConstructorOptions = {
frame: true,
alwaysOnTop:
configSettings.alwaysOnTop === CloudConfigDataTypes.ENABLED || false,
minHeight: 300,
minWidth: 300,
title: 'Symphony',
};
if (!windowHandler.isMana) {
opts.webPreferences = {
preload: path.join(__dirname, '../renderer/_preload-main.js'),
};
}
return {
action: 'allow',
// override child window options
overrideBrowserWindowOptions: {
frame: true,
alwaysOnTop:
configSettings.alwaysOnTop === CloudConfigDataTypes.ENABLED ||
false,
minHeight: 300,
minWidth: 300,
title: 'Symphony',
},
overrideBrowserWindowOptions: opts,
};
} else {
if (details.url && details.url.length > 2083) {