-
-
Notifications
You must be signed in to change notification settings - Fork 52.7k
Description
Summary
The Chrome Browser Relay extension loses its CDP (Chrome DevTools Protocol) connection to attached tabs after any click action that triggers SPA (Single Page Application) in-page navigation. This makes it impossible to interact with SPAs like Gmail, Google Calendar, and similar apps beyond a single read-only snapshot.
Steps to Reproduce
- Attach the Chrome relay extension to a Gmail or Google Calendar tab
- Use
browser(action='tabs')— tab appears correctly with targetId - Use
browser(action='snapshot', targetId=...)— works, returns full page content - Use
browser(action='act', request={kind:'click', ref:'...', targetId:'...'})— click succeeds (returnsok: true) - Use
browser(action='snapshot', targetId=...)again — fails with 'tab not found'
Observed Behavior
- After any
clickaction that triggers SPA navigation (URL hash change, history API push, etc.), the CDP WebSocket connection to the tab is lost - The tab still appears in
browser(action='tabs')with the same targetId - But all subsequent
snapshot,act, ornavigatecalls fail withError: tab not found - Even
browser(action='navigate')to a new URL on the same tab fails after the connection drops - The only recovery is for the user to manually re-click the extension badge
Expected Behavior
The extension should maintain (or automatically re-establish) the CDP connection after in-page SPA navigation events. The tab's targetId doesn't change, so the extension should be able to reconnect transparently.
Impact
This effectively makes the browser relay read-only for SPAs — you can snapshot a page but can't interact with it. Key affected apps:
- Gmail — can't click on emails in inbox
- Google Calendar — can't navigate between days/weeks
- Any SPA — clicking internal links breaks the connection
Environment
- OpenClaw version: 2026.2.17 (build 4134875)
- macOS (Apple Silicon)
- Chrome with OpenClaw Browser Relay extension
Suggested Fix
The extension's CDP proxy should listen for navigation events (chrome.webNavigation.onHistoryStateUpdated, chrome.webNavigation.onCompleted) and re-establish the CDP WebSocket connection to the tab automatically, preserving the same targetId mapping.