-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Description
Feature Request: Expose Current Integrated Browser URL to Extensions
Summary
Please add a supported VS Code Extension API to retrieve the current URL of an Integrated Browser tab.
Problem
Extensions can open Integrated Browser tabs, but there is no API to read the current, live URL after user navigation.
The view group tab its input is null, as the URL is kept internal to the browser tab and not exposed through the API. This means extensions cannot reliably track or persist the actual page users are on after they click links and navigate.
Real Extension Scenario
A workspace browser-layout extension can:
- Open URL groups in the Integrated Browser
- Save/restore layout state
But it cannot reliably persist the actual current page after users click links and navigate.
Requested API
Please expose the active URL through a stable API surface for extensions.
Possible options:
Option A: Tab-level API
Add a URL property for browser tabs.
Example direction:
- vscode.Tab.url for browser-backed tabs
- or a typed tab input that exposes current URL for Integrated Browser tabs
Option B: Browser tab accessor API
Add a dedicated API to query browser tab state.
Example direction:
- vscode.window.browserTabs or similar accessor
- Browser tab state containing current URL and navigation metadata
Option C: Event-based API
Add an event for URL changes in Integrated Browser tabs.
Example direction:
- onDidChangeBrowserTabUrl(tab, url)
- plus a method to query current URL for a tab
Desired Behavior
- URL reflects the current navigated page, not only the initial open URL
- Works consistently across tab lifecycle updates
- Works for active and inactive browser tabs
- Works in multi-group layouts
Why This Matters
This unlocks robust extension scenarios:
- Get information from the current browser tab URL to sync with code context
- Persist and restore actual browsing context, not just initial URLs
- Workspace-specific browser workflows
- Reliable automation around browser tab state
Without this API, extensions must use brittle heuristics that can silently lose or corrupt user state.
Thank You
Thanks for considering this. Integrated Browser is increasingly useful for workflow-centric extensions, and exposing current URL state would make extension integrations much more reliable.