Skip to content

browser skill: cdp() helper broken (sessionId binding) + activate_tab/list_tabs not exported to heredoc env #3

Description

@rz1989s

Repro (pi session, macOS, Chrome CDP attach, browser_harness 0.1.4):

browser-use <<'PY'
cdp("Target.activateTarget", {"targetId": "<tid>"})
PY
# RuntimeError: {'code': -32602, 'message': 'Invalid parameters', 'data': 'Failed to deserialize params.targetId - BINDINGS: mandatory field missing at position 8'}

browser-use <<'PY'
cdp("Input.insertText", {"text": "hello"})
PY
# RuntimeError: {'code': -32600, "Message may have string 'sessionId' property"}

Expected: cdp() passes params through to the attached page session; documented tab helpers from interaction-skills/tabs.md (activate_tab, list_tabs) are pre-imported alongside switch_tab/new_tab.

Actual:

  1. cdp() mangles params/session binding for both Target- and Input-domain methods — unusable for keyboard events (Input.insertText / dispatchKeyEvent). Workaround used: js() native-setter + execCommand, and click_at_xy where DOM clicks failed.
  2. tabs.md documents activate_tab()/list_tabs() but the heredoc env only has switch_tab (NameError: activate_tab not defined); had to fall back to raw switch_tab only, no bring-to-front.

Why it matters: coordinate/js clicks + native-setter worked, but typing into React controlled inputs required real keyboard events — the exact case cdp() exists for. Also the profile/notifications panels opened from stray click_at_xy near the top-right and there was no clean way to dismiss via CDP.

Env: browser_harness 0.1.4 (0.1.10 update available — untested there), macOS, pi heredoc mode.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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