[Mm 37198] enable global sandboxing to increase security (#1667)
* prevent creating new windows from popup windows * enable sandbox * fix windows detection logic * disable on testing environment Co-authored-by: = <=>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// See LICENSE.txt for license information.
|
||||
import fs from 'fs';
|
||||
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
import {EventEmitter} from 'events';
|
||||
@@ -43,11 +44,17 @@ export default class Config extends EventEmitter {
|
||||
defaultConfigData?: ConfigType;
|
||||
buildConfigData?: BuildConfig;
|
||||
localConfigData?: ConfigType;
|
||||
useNativeWindow: boolean;
|
||||
|
||||
constructor(configFilePath: string) {
|
||||
super();
|
||||
this.configFilePath = configFilePath;
|
||||
this.registryConfig = new RegistryConfig();
|
||||
try {
|
||||
this.useNativeWindow = os.platform() === 'win32' && (parseInt(os.release().split('.')[0], 10) < 10);
|
||||
} catch {
|
||||
this.useNativeWindow = false;
|
||||
}
|
||||
}
|
||||
|
||||
// separating constructor from init so main can setup event listeners
|
||||
@@ -315,7 +322,7 @@ export default class Config extends EventEmitter {
|
||||
*/
|
||||
regenerateCombinedConfigData = () => {
|
||||
// combine all config data in the correct order
|
||||
this.combinedData = Object.assign({}, this.defaultConfigData, this.localConfigData, this.buildConfigData, this.registryConfigData);
|
||||
this.combinedData = Object.assign({}, this.defaultConfigData, this.localConfigData, this.buildConfigData, this.registryConfigData, {useNativeWindow: this.useNativeWindow});
|
||||
|
||||
// remove unecessary data pulled from default and build config
|
||||
delete this.combinedData!.defaultTeams;
|
||||
|
Reference in New Issue
Block a user