Skip to content

Browser panel tabs, with tab tools for Claude - #26

Merged
PieMH merged 5 commits into
mainfrom
agents-team/browser-tabs
Oct 19, 2026
Merged

PieMH merged 5 commits into
mainfrom
agents-team/browser-tabs

Conversation

@PieMH

@PieMH PieMH commented Oct 19, 2026

Copy link
Copy Markdown
Owner

What

The Browser panel gets real tabs, and Claude's Browser tool can use them.

  • Tab strip: each tab has a title and a close button, and a + button opens a new tab (at most 20). The strip scrolls sideways when the tabs don't fit.
  • One profile: every tab is its own WebView2 on the panel's one profile, so logins carry over. Closing the last tab leaves a blank one. Tabs aren't restored after a restart.
  • Popups:
    • A popup opened by a click (target=_blank, window.open) opens in a new tab in front. The page that opened it keeps its window object, so sign-in popups work.
    • A popup a page opens on its own (for example on a timer) is dropped, as are addresses outside http, https, blob, about:blank and data.
    • window.close() closes only popup tabs, and the tab that opened the popup comes back to the front.
  • Claude's tools: four new ones, tabs, new_tab, switch_tab and close_tab.
    • The other 7 tools work on the front tab. Each call fixes that tab once at the start, and runs both page checks on it.
    • The 60 s limit, the address limits, the non-web-page refusal and the DevTools allow-list all hold in every tab.
    • The tab list hides the title and address of a non-web tab.

Fixes a bug that is already on main

WPF's WebView2 control has its own WindowCloseRequested handler, which closes the whole parent window. So today, a page in the Browser panel that calls window.close() can close the CCWrapper window and every session in it.

DropControlsCloseHandler removes that handler. There's no public setting for this, so it uses reflection on the package's private code. A review checked the behavior against the package's compiled code.

A new unit test, which CI runs, fails if a WebView2 update renames the private names it relies on. This matters because Dependabot bumps WebView2 weekly.

Checks

  • dotnet build -c Release: 0 warnings.

  • dotnet test -c Release: 441/441 passed (was 422).

  • --smoke: exit 0. The new tab steps:

    • a click opens a popup, which becomes a tab;
    • new_tab, switch_tab, tabs and close_tab;
    • a refused popup is dropped;
    • a popup a page opens on its own is dropped;
    • window.close() closes only the popup tab, and the front goes back to the tab that opened it.

    Each of these guards was removed once on purpose, and smoke then failed.

  • Three review rounds by opus. All findings are fixed except one I accepted: a popup a page opens more than about 5 s after the click is dropped with no sign. Chrome does the same, but shows an icon.

Not tested yet: please try before merging

  • How the tab strip looks, scrolling with many tabs, and the + button at 20.
  • A real "Sign in with Google/GitHub" popup closing itself.
  • In a new session, Claude using tabs, new_tab and switch_tab.

🤖 Generated with Claude Code

PieMH added 5 commits October 18, 2026 22:55
…w tab, tab tools for Claude

Every tab is its own WebView2 on the panel's one CoreWebView2Environment. window.open and target=_blank open a new tab in front (still gated by SchemeAllowed, max 20 tabs). The Browser tool gains tabs, new_tab, switch_tab and close_tab; the other tools act on the front tab, captured once per call, with both page checks on that tab.
… closed, environment retried, tab strip scrolls, smoke checks a refused popup
…se closes only pop-up tabs, WPF's WebView2 no longer closes the window on window.close
…er; a test guards the WebView2 names the close fix reflects on
@PieMH
PieMH merged commit e6480a3 into main Oct 19, 2026
1 check passed
@PieMH
PieMH deleted the agents-team/browser-tabs branch October 19, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant