mirror of
https://github.com/Microsoft/vscode
synced 2024-09-19 10:40:41 +00:00
do not send falsify values to the renderer
This commit is contained in:
parent
69df5034e4
commit
5d81e5eb8e
|
@ -153,7 +153,7 @@ export class EnvService implements IEnvService {
|
||||||
|
|
||||||
this._cliArgs = Object.freeze({
|
this._cliArgs = Object.freeze({
|
||||||
_: [],
|
_: [],
|
||||||
pathArguments: pathArguments,
|
pathArguments,
|
||||||
timestamp: types.isNumber(timestamp) ? String(timestamp) : '0',
|
timestamp: types.isNumber(timestamp) ? String(timestamp) : '0',
|
||||||
performance: argv.performance,
|
performance: argv.performance,
|
||||||
verbose: argv.verbose,
|
verbose: argv.verbose,
|
||||||
|
|
|
@ -397,6 +397,11 @@ export class VSCodeWindow {
|
||||||
// Config (combination of process.argv and window configuration)
|
// Config (combination of process.argv and window configuration)
|
||||||
const environment = parseArgs(process.argv);
|
const environment = parseArgs(process.argv);
|
||||||
const config = objects.assign(environment, windowConfiguration);
|
const config = objects.assign(environment, windowConfiguration);
|
||||||
|
for (let key in config) {
|
||||||
|
if (!config[key]) {
|
||||||
|
delete config[key]; // only send over properties that have a true value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
url += '?config=' + encodeURIComponent(JSON.stringify(config));
|
url += '?config=' + encodeURIComponent(JSON.stringify(config));
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,7 @@ function createScript(src, onload) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function uriFromPath(_path) {
|
function uriFromPath(_path) {
|
||||||
var pathName = path.resolve(_path).replace(/\\/g, '/');
|
let pathName = path.resolve(_path).replace(/\\/g, '/');
|
||||||
|
|
||||||
if (pathName.length > 0 && pathName.charAt(0) !== '/') {
|
if (pathName.length > 0 && pathName.charAt(0) !== '/') {
|
||||||
pathName = '/' + pathName;
|
pathName = '/' + pathName;
|
||||||
}
|
}
|
||||||
|
@ -93,13 +92,12 @@ function main() {
|
||||||
const webFrame = require('electron').webFrame;
|
const webFrame = require('electron').webFrame;
|
||||||
const args = parseURLQueryArgs();
|
const args = parseURLQueryArgs();
|
||||||
const configuration = JSON.parse(args['config'] || '{}') || {};
|
const configuration = JSON.parse(args['config'] || '{}') || {};
|
||||||
const enableDeveloperTools = process.env['VSCODE_DEV'] || !!configuration.extensionDevelopmentPath;
|
|
||||||
|
|
||||||
// Correctly inherit the parent's environment
|
// Correctly inherit the parent's environment
|
||||||
assign(process.env, configuration.userEnv);
|
assign(process.env, configuration.userEnv);
|
||||||
|
|
||||||
// Get the nls configuration into the process.env as early as possible.
|
// Get the nls configuration into the process.env as early as possible.
|
||||||
var nlsConfig = { availableLanguages: {} };
|
let nlsConfig = { availableLanguages: {} };
|
||||||
const config = process.env['VSCODE_NLS_CONFIG'];
|
const config = process.env['VSCODE_NLS_CONFIG'];
|
||||||
if (config) {
|
if (config) {
|
||||||
process.env['VSCODE_NLS_CONFIG'] = config;
|
process.env['VSCODE_NLS_CONFIG'] = config;
|
||||||
|
@ -108,8 +106,7 @@ function main() {
|
||||||
} catch (e) { /*noop*/ }
|
} catch (e) { /*noop*/ }
|
||||||
}
|
}
|
||||||
|
|
||||||
var locale = nlsConfig.availableLanguages['*'] || 'en';
|
let locale = nlsConfig.availableLanguages['*'] || 'en';
|
||||||
|
|
||||||
if (locale === 'zh-tw') {
|
if (locale === 'zh-tw') {
|
||||||
locale = 'zh-Hant';
|
locale = 'zh-Hant';
|
||||||
} else if (locale === 'zh-cn') {
|
} else if (locale === 'zh-cn') {
|
||||||
|
@ -118,6 +115,7 @@ function main() {
|
||||||
|
|
||||||
window.document.documentElement.setAttribute('lang', locale);
|
window.document.documentElement.setAttribute('lang', locale);
|
||||||
|
|
||||||
|
const enableDeveloperTools = process.env['VSCODE_DEV'] || !!configuration.extensionDevelopmentPath;
|
||||||
registerListeners(enableDeveloperTools);
|
registerListeners(enableDeveloperTools);
|
||||||
|
|
||||||
// We get the global settings through a remote call from the browser
|
// We get the global settings through a remote call from the browser
|
||||||
|
@ -161,7 +159,7 @@ function main() {
|
||||||
start: new Date()
|
start: new Date()
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!!configuration.performance) {
|
if (configuration.performance) {
|
||||||
const programStart = remote.getGlobal('programStart');
|
const programStart = remote.getGlobal('programStart');
|
||||||
const vscodeStart = remote.getGlobal('vscodeStart');
|
const vscodeStart = remote.getGlobal('vscodeStart');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue