提交 1e960d5a 编写于 作者: C Christof Marti

Set Electron session's proxy from user setting (fixes #94148)

上级 d5e12a12
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册