Skip to content

Chrome relay extension: CDP connection drops after SPA in-page navigation (click actions) #19744

@nishantkabra77

Description

@nishantkabra77

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

  1. Attach the Chrome relay extension to a Gmail or Google Calendar tab
  2. Use browser(action='tabs') — tab appears correctly with targetId
  3. Use browser(action='snapshot', targetId=...) — works, returns full page content
  4. Use browser(action='act', request={kind:'click', ref:'...', targetId:'...'}) — click succeeds (returns ok: true)
  5. Use browser(action='snapshot', targetId=...) again — fails with 'tab not found'

Observed Behavior

  • After any click action 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, or navigate calls fail with Error: 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions