docs: clarify input.click param format in CLI help and skill#19
Closed
Eridanus117 wants to merge 5 commits into
Closed
docs: clarify input.click param format in CLI help and skill#19Eridanus117 wants to merge 5 commits into
Eridanus117 wants to merge 5 commits into
Conversation
bbx click / focus / type / hover / patch-style / patch-text / html silently dropped --tab when called as shortcuts. The flag fell through as a positional argument, the shortcut sent its request without tabId, and the bridge routed the work to whatever tab the access route happened to point at (typically the user's active tab). Symptom: agents calling `bbx click --tab 124461098 'el_xxx' ` after the user switched browser focus saw ELEMENT_STALE or "No element found", because the click landed on the user's now-focused tab — not the one the agent had been driving and resolved the elementRef against. Fix: route shortcut commands through extractTabFlag the same way `bbx call` and `bbx cdp-press-key` already do, and pass the resolved tabId to both resolveRef (so the selector is resolved against the target tab) and requestBridge (so the action runs on that tab). Verified live against a running daemon: with the bridge routed to a different tab, `bbx click --tab <other-tabId> 'selector'` now clicks the element in the explicit tab regardless of which tab is focused.
When a shortcut command (click, type, focus, hover, etc.) is given a CSS selector (not an el_xxx ref), and the action returns ELEMENT_STALE, automatically re-resolve the selector and retry once. This handles the common agent workflow: 1. Agent queries a selector → gets elementRef el_abc 2. Page re-renders (React reconciliation, user interaction, SPA nav) 3. Agent calls `bbx click el_abc` → ELEMENT_STALE 4. Agent must manually re-query → retry With this change, `bbx click 'button[data-x=save]'` (selector form) will auto-retry: re-resolve the selector against the current DOM, get a fresh elementRef, and dispatch the action. The retry is at most once and only fires for selector-based inputs (el_xxx refs skip retry since there is no selector to re-resolve from).
input.type simulates individual keystrokes, which is slow and breaks some framework-controlled inputs that expect programmatic value changes. input.fill uses the native HTMLInputElement.prototype.value setter to set the value in one shot, then dispatches input + change + blur events to trigger framework state sync and field validation. Three modes: - "setter" — prototype setter only (fast, works for React/Vue/Angular) - "keystrokes" — clear + type each char (slow but handles custom components) - "auto" (default) — try setter, verify value stuck, fallback to keystrokes CLI: bbx fill <ref|selector> <value> Protocol: input.fill (target, value, mode) Content script: fillTarget in content-input.js
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bbx call input.clickrequires{"target":{"elementRef":"..."}}format, not{"ref":"..."}or{"elementRef":"..."}bbx click el_xxx) handle wrapping automatically butbbx calldoes not — this was a common source of "Target not found" errorsChanges
packages/agent-client/src/command-registry.js— Added examples to Generic RPC help sectionskills/browser-bridge/SKILL.md— Expanded target wrapper bullet with code blockskills/browser-bridge/references/interaction.md— New "Raw bbx call" section with correct/wrong examples🤖 Generated with Claude Code