Skip to content

Add setting to open localhost links from Terminal, chat, etc. in Integrated Browser#289565

Merged
jruales merged 8 commits into
mainfrom
jruales/browser-localhost-links
Jan 22, 2026
Merged

Add setting to open localhost links from Terminal, chat, etc. in Integrated Browser#289565
jruales merged 8 commits into
mainfrom
jruales/browser-localhost-links

Conversation

@jruales
Copy link
Copy Markdown
Contributor

@jruales jruales commented Jan 22, 2026

Adds a setting that, when enabled, will open all localhost links (from Terminal, chat, etc.) in the Integrated Browser instead of the system browser. Links to non-localhost URLs are not affected.

Also adds telemetry event integratedBrowser.open that logs browser editor (aka browser tab) opening and the source of the opening.


Related feature: #286579

@jruales jruales requested review from Copilot and kycutler January 22, 2026 05:48
@vs-code-engineering vs-code-engineering Bot added this to the January 2026 milestone Jan 22, 2026
@jruales jruales changed the title Setting to open localhost links in Integrated Browser Integrated Browser: Setting to open localhost links in Integrated Browser Jan 22, 2026
@jruales jruales changed the title Integrated Browser: Setting to open localhost links in Integrated Browser Integrated Browser: Add setting to open localhost links from Terminal, chat, etc. in Integrated Browser Jan 22, 2026
@jruales jruales changed the title Integrated Browser: Add setting to open localhost links from Terminal, chat, etc. in Integrated Browser Add setting to open localhost links from Terminal, chat, etc. in Integrated Browser Jan 22, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new setting to automatically open localhost URLs in VS Code's Integrated Browser instead of the system browser. The feature is disabled by default and applies to localhost links from various sources like the terminal and chat.

Changes:

  • Adds a new LocalhostOpenerContribution class that registers as an opener to intercept localhost URLs
  • Adds a configuration setting workbench.browser.openLocalhostLinks to control the behavior

Comment thread src/vs/workbench/contrib/browserView/electron-browser/browserView.contribution.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Comment thread src/vs/workbench/contrib/browserView/electron-browser/browserView.contribution.ts Outdated
@jruales jruales enabled auto-merge (squash) January 22, 2026 21:45
@jruales jruales merged commit ce8b8af into main Jan 22, 2026
22 checks passed
@jruales jruales deleted the jruales/browser-localhost-links branch January 22, 2026 22:07
eleanorjboyd pushed a commit to eleanorjboyd/vscode that referenced this pull request Jan 23, 2026
…grated Browser (microsoft#289565)

* Setting to open localhost links in Integrated Browser

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Rename

* Log telemetry for open method

* Distinguish commands with and without URL

* use isLocalhostAuthority in other use too

* Add descriptions for source values

* PR Feedback

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Mar 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants