aboutsummaryrefslogtreecommitdiff
path: root/src/domains/click.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/domains/click.ts')
-rw-r--r--src/domains/click.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/domains/click.ts b/src/domains/click.ts
index c269dd8..9946664 100644
--- a/src/domains/click.ts
+++ b/src/domains/click.ts
@@ -41,14 +41,15 @@ export const clickTool = defineBrowserTool({
name: "browser_click",
label: "Browser Click",
description:
- "Click at viewport CSS-pixel coordinates. Compositor-level click works through iframes, shadow DOM, and cross-origin content. Use browser_screenshot first to find coordinates.",
+ "Click at viewport CSS-pixel coordinates. Compositor-level click works through iframes, shadow DOM, and cross-origin content. Get coordinates from browser_snapshot's @(x,y) hints — do not screenshot to find click targets.",
promptSnippet: "Click at pixel coordinates (x, y) on the page",
promptGuidelines: [
- "Use browser_click for all clicks. Coordinates are viewport CSS pixels (not device pixels).",
- "Capture a browser_screenshot BEFORE clicking to find the right coordinates.",
- "Capture another browser_screenshot AFTER clicking to verify the action worked.",
+ "Get (x, y) from browser_snapshot — the outline shows '@(x,y)' for every interactive element. NO screenshot needed.",
+ "If the target isn't an interactive role in the snapshot, fall back to browser_execute_js with `el.getBoundingClientRect()` — still NO screenshot.",
+ "Coordinates are viewport CSS pixels (not device pixels).",
+ "After clicking, verify with browser_snapshot (or browser_execute_js for a specific value). Only screenshot if you need to confirm visual rendering.",
"Compositor-level clicks pass through iframes, shadow DOM, and cross-origin content — no selector needed.",
- "If a click doesn't register, try setting BH_DEBUG_CLICKS=1 to get annotated screenshots showing exact click positions.",
+ "If a click doesn't register, set BH_DEBUG_CLICKS=1 to get annotated screenshots showing exact click positions (debug only).",
"For React/Vue components that don't respond to clicks, try browser_dispatch_key to send DOM-level events.",
],
parameters: ClickArgs,