diff --git a/README.md b/README.md index ed097a0..21c971b 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,7 @@ agent-browser open https://example.com # Everything works through your logged-in browser agent-browser click "Post" +agent-browser click 449 320 # …or click a raw viewport coordinate agent-browser fill "Title" "Hello World" agent-browser screenshot ./page.png ``` diff --git a/cli/src/output.rs b/cli/src/output.rs index 9ce40c8..db073b6 100644 --- a/cli/src/output.rs +++ b/cli/src/output.rs @@ -1261,14 +1261,19 @@ Examples: // === Core Actions === "click" => { r##" -agent-browser click - Click an element +agent-browser click - Click an element or a coordinate Usage: agent-browser click [--new-tab] + agent-browser click | , | --coords , Clicks on the specified element. The selector can be a CSS selector, XPath, or an element reference from snapshot (e.g., @e1). +A bare-number argument is treated as a viewport coordinate, not a +selector — `click 449 320` clicks the pixel point (no element needed). + Options: + --coords , Click a viewport coordinate (explicit form) --new-tab Open link in a new tab instead of navigating current tab (only works on elements with href attribute) @@ -3034,7 +3039,7 @@ Start here (for AI agents): Core Commands: open Navigate to URL - click Click element (or @ref) + click Click element/@ref, or a viewport coordinate dblclick Double-click element type Type into element fill Clear and fill diff --git a/skill-data/core/SKILL.md b/skill-data/core/SKILL.md index a48523e..6844cea 100644 --- a/skill-data/core/SKILL.md +++ b/skill-data/core/SKILL.md @@ -270,6 +270,17 @@ classic for an autocomplete/menu `
  • ` that closes on the input's blur — retr that one with `AGENT_BROWSER_CLICK_MODE=dom agent-browser click ...`, or just `agent-browser eval "