mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Set Electron session's proxy from user setting (fixes #94148)
This commit is contained in:
@@ -118,6 +118,8 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
|
||||
private readonly touchBarGroups: TouchBarSegmentedControl[];
|
||||
|
||||
private currentHttpProxy?: string;
|
||||
|
||||
constructor(
|
||||
config: IWindowCreationOptions,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
@@ -594,6 +596,16 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
this.currentMenuBarVisibility = newMenuBarVisibility;
|
||||
this.setMenuBarVisibility(newMenuBarVisibility);
|
||||
}
|
||||
// Do not set to empty configuration at startup if setting is empty to not override configuration through CLI options:
|
||||
const newHttpProxy = (this.configurationService.getValue<string>('http.proxy') || '').trim() || undefined;
|
||||
if (newHttpProxy !== this.currentHttpProxy) {
|
||||
this.currentHttpProxy = newHttpProxy;
|
||||
this._win.webContents.session.setProxy({
|
||||
proxyRules: newHttpProxy || '',
|
||||
proxyBypassRules: '',
|
||||
pacScript: '',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
addTabbedWindow(window: ICodeWindow): void {
|
||||
|
||||
Reference in New Issue
Block a user