Merge from vscode cfbd1999769f4f08dce29629fb92fdc0fac53829

This commit is contained in:
ADS Merger
2020-08-06 07:08:52 +00:00
parent 9c67832880
commit 540046ba00
362 changed files with 7588 additions and 6584 deletions

View File

@@ -82,10 +82,6 @@ import { WebviewMainService } from 'vs/platform/webview/electron-main/webviewMai
import { IWebviewManagerService } from 'vs/platform/webview/common/webviewManagerService';
import { createServer, AddressInfo } from 'net';
import { IOpenExtensionWindowResult } from 'vs/platform/debug/common/extensionHostDebug';
import { IFileService } from 'vs/platform/files/common/files';
import { stripComments } from 'vs/base/common/json';
import { generateUuid } from 'vs/base/common/uuid';
import { VSBuffer } from 'vs/base/common/buffer';
export class CodeApplication extends Disposable {
private windowsMainService: IWindowsMainService | undefined;
@@ -138,6 +134,11 @@ export class CodeApplication extends Disposable {
//
// !!! DO NOT CHANGE without consulting the documentation !!!
//
app.on('remote-get-guest-web-contents', event => {
this.logService.trace('App#on(remote-get-guest-web-contents): prevented');
event.preventDefault();
});
app.on('remote-require', (event, sender, module) => {
this.logService.trace('App#on(remote-require): prevented');
@@ -806,7 +807,7 @@ export class CodeApplication extends Disposable {
return { fileUri: URI.file(path) };
}
private async afterWindowOpen(accessor: ServicesAccessor): Promise<void> {
private afterWindowOpen(accessor: ServicesAccessor): void {
// Signal phase: after window open
this.lifecycleMainService.phase = LifecycleMainPhase.AfterWindowOpen;
@@ -819,34 +820,6 @@ export class CodeApplication extends Disposable {
if (updateService instanceof Win32UpdateService || updateService instanceof LinuxUpdateService || updateService instanceof DarwinUpdateService) {
updateService.initialize();
}
// If enable-crash-reporter argv is undefined then this is a fresh start,
// based on telemetry.enableCrashreporter settings, generate a UUID which
// will be used as crash reporter id and also update the json file.
try {
const fileService = accessor.get(IFileService);
const argvContent = await fileService.readFile(this.environmentService.argvResource);
const argvString = argvContent.value.toString();
const argvJSON = JSON.parse(stripComments(argvString));
if (argvJSON['enable-crash-reporter'] === undefined) {
const enableCrashReporter = this.configurationService.getValue<boolean>('telemetry.enableCrashReporter') ?? true;
const additionalArgvContent = [
'',
' // Allows to disable crash reporting.',
' // Should restart the app if the value is changed.',
` "enable-crash-reporter": ${enableCrashReporter},`,
'',
' // Unique id used for correlating crash reports sent from this instance.',
' // Do not edit this value.',
` "crash-reporter-id": "${generateUuid()}"`,
'}'
];
const newArgvString = argvString.substring(0, argvString.length - 2).concat(',\n', additionalArgvContent.join('\n'));
await fileService.writeFile(this.environmentService.argvResource, VSBuffer.fromString(newArgvString));
}
} catch (error) {
this.logService.error(error);
}
}
private handleRemoteAuthorities(): void {

View File

@@ -64,9 +64,7 @@ export class ProxyAuthHandler extends Disposable {
contextIsolation: true,
enableWebSQL: false,
enableRemoteModule: false,
spellcheck: false,
devTools: false,
v8CacheOptions: 'bypassHeatCheck'
devTools: false
}
};

View File

@@ -46,7 +46,6 @@ export class SharedProcess implements ISharedProcess {
nodeIntegration: true,
enableWebSQL: false,
enableRemoteModule: false,
spellcheck: false,
nativeWindowOpen: true,
images: false,
webgl: false,

View File

@@ -170,7 +170,6 @@ export class CodeWindow extends Disposable implements ICodeWindow {
nodeIntegration: true,
enableWebSQL: false,
enableRemoteModule: false,
spellcheck: false,
nativeWindowOpen: true,
webviewTag: true,
zoomFactor: zoomLevelToZoomFactor(windowConfig?.zoomLevel)