Commit Graph

4337 Commits

Author SHA1 Message Date
Laith Weinberger 1794849886 don't mutate page
instead of writing markers to DOM, collect element references in JS, resolve them to internal Chrome node IDs via CDP, and store those IDs in Python
2026-01-24 16:36:14 -05:00
Laith Weinberger 20f51c7fef detect JS event listeners for clickable elements
uses CDP Runtime.evaluate with includeCommandLineAPI to access getEventListeners() and mark elements with click/mousedown/pointerdown listeners before DOM snapshot capture
2026-01-24 14:44:08 -05:00
Marcin 965bc68195 style: format ensure_server function signature 2026-01-24 08:56:07 +01:00
Marcin 1791462de1 feat(cli): add --cdp-url flag to connect to existing browser via CDP
This adds support for connecting to an existing browser instance via
Chrome DevTools Protocol (CDP) URL in the skill_cli commands.

## Why

The current skill_cli only supports three browser modes:
- chromium: Launches a new Playwright-managed Chromium
- real: Launches users Chrome with profile
- remote: Uses Browser-Use Cloud

However, many use cases require connecting to an already-running browser:
- Remote browser automation via SSH tunnels
- Connecting to browsers in Docker containers
- Reusing authenticated browser sessions
- Integration with Claude Code on remote servers

The BrowserSession class already supports cdp_url, but it was not
exposed through the skill_cli. The TUI mode has this option, but the
simple CLI commands did not.

## Changes

- main.py: Added --cdp-url argument and pass-through to server
- server.py: Accept and store cdp_url, pass to session registry
- sessions.py: Handle cdp_url in session creation (takes precedence)

## Usage

browser-use --cdp-url http://localhost:9222 open https://example.com
browser-use --cdp-url http://localhost:9222 state
browser-use --cdp-url http://localhost:9222 click 5

## Testing

Tested with Chrome remote debugging over SSH tunnel - successfully
controlled a local macOS Chrome browser from a remote Linux server.

Vibe coded with Claude Opus 4.5

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 08:21:11 +01:00
Magnus Müller 6b23672c3c Merge branch 'main' into cache-anthropic 2026-01-23 18:10:11 -08:00
Magnus Müller 80a08a4a03 Merge branch 'main' into #3557 2026-01-23 18:06:47 -08:00
Magnus Müller d9dec964be Merge branch 'main' into fix/3889-draftjs-first-char 2026-01-23 16:24:34 -08:00
Saurav Panda b63ae37008 Merge branch 'main' into gemini-add-thinking-level 2026-01-23 15:21:17 -08:00
Saurav Panda 2774be5cc6 Merge branch 'main' into fix/cli-chatbrowseruse-support 2026-01-23 15:18:19 -08:00
Saurav Panda bb3b1e8cf5 added minimal model for gemini 3 flash 2026-01-23 15:11:13 -08:00
Saurav Panda 041d03a93f feat: updated the thinking budget 2026-01-23 14:42:59 -08:00
Saurav Panda 5b06f4edd9 set default thinking to 0 for gemini-3 models 2026-01-23 13:44:29 -08:00
Laith Weinberger a75fa14d14 increase char limit for extraction 2026-01-23 16:38:38 -05:00
Laith Weinberger f85bbb49c8 pass model_name to SystemPrompt 2026-01-23 16:33:28 -05:00
Laith Weinberger 2f24f53900 use longer prompts for opus/haiku 4.5 to allow caching 2026-01-23 16:20:25 -05:00
Saurav Panda f3aad3c145 Added browser use 2-0 support 2026-01-23 13:17:56 -08:00
Saurav Panda 37586c9e9f Added support for new browser use model 2026-01-23 12:39:10 -08:00
BouquetAntoine 1a01e5dff7 feat(cli): add ChatBrowserUse support for BROWSER_USE_API_KEY
The CLI 'run' command now supports BROWSER_USE_API_KEY as an LLM option,
using ChatBrowserUse which is optimized for browser automation tasks.

This aligns the CLI behavior with the documented supported models at
https://docs.browser-use.com/supported-models which shows ChatBrowserUse
as a valid LLM option using BROWSER_USE_API_KEY.

Changes:
- Add ChatBrowserUse as first LLM option in get_llm() when BROWSER_USE_API_KEY is set
- Update error message to mention BROWSER_USE_API_KEY
2026-01-22 17:18:08 +01:00
Gregor Žunič b6bdc17bcb addresses cubic 2026-01-21 22:17:07 -08:00
Gregor Žunič 5fc3a428c7 better remote session management 2026-01-21 22:12:51 -08:00
Gregor Žunič c7c5cae20e remote browser fixes + readme 2026-01-21 21:49:26 -08:00
Gregor Žunič 08c72f67ba chore: Remove auxiliary planning docs 2026-01-21 21:20:44 -08:00
Gregor Žunič 5e75df3eb0 fix: Clean up Python command output format 2026-01-21 21:16:20 -08:00
Gregor Žunič 4716ae50ce fix: State command now outputs LLM representation, add CLI aliases
- State command outputs same format that browser-use agents see
- Added aliases: bu, browser (all work the same)
- Headed mode now correctly shows browser window
2026-01-19 09:36:20 -08:00
Gregor Žunič 0f9e955276 refactor: Rename CLI from 'bu' to 'browser-use'
- Change main entry point to 'browser-use'
- Move TUI to 'browser-use-tui'
- Add README with human instructions
- Update SKILL.md references

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 09:11:39 -08:00
Gregor Žunič c4ffaca6e7 feat: Add fast CLI for browser automation (bu command)
Implements a fast, persistent browser automation CLI per CLI_SPEC.md:

- Fast CLI layer using stdlib only (<50ms startup)
- Session server with Unix socket IPC (TCP on Windows)
- Browser modes: chromium, real, remote
- Commands: open, click, type, input, scroll, back, screenshot,
  state, switch, close-tab, keys, select, eval, extract
- Python execution with persistent namespace (Jupyter-like REPL)
- Agent task execution (requires API key)
- JSON output mode

The CLI maintains browser sessions across commands, enabling complex
multi-step workflows. Includes Claude skill description for AI-assisted
browser automation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 01:05:35 -08:00
LarsenCundric dd8a63ce41 Improve placeholder handling for 2FA secrets in registry service 2026-01-16 17:05:50 -08:00
zhongzhenyu c0f4f39570 fix(#3889): Draft.js editors lose first character when typing
CDP's dispatchKeyEvent doesn't trigger beforeinput events that Draft.js
relies on for text input. This causes the first character to be dropped.

Solution: Detect Draft.js editors via specific DOM attributes (DraftEditor
class, data-contents, data-block, data-offset-key) and prepend a sacrifice
space character that Draft.js will drop, preserving the actual text.
2026-01-15 18:13:25 -08:00
Saurav Panda 147db04c1c Merge branch 'main' into add-ax-name-fallback-rerun 2026-01-15 11:03:27 -08:00
Saurav Panda 9339935c1f added check for history item state 2026-01-15 10:50:07 -08:00
Saurav Panda 9c042d7d98 make event bus timeout configurable using env 2026-01-15 10:44:44 -08:00
Saurav Panda 97d71b84fa added a fix for multi menu dropdown 2026-01-15 10:17:59 -08:00
sudhanshu112233shukla f49fc33f2d Merge remote-tracking branch 'upstream/main' into fix/3292-table-row-clickability 2026-01-11 13:04:41 +00:00
sudhanshu112233shukla d7990721f8 fix(#3292): make table rows and cells with role='row'/'cell' interactive
- Added 'row', 'cell', 'gridcell' to interactive_roles in ClickableElementDetector
- Added 'row', 'cell', 'gridcell' to interactive_ax_roles in ClickableElementDetector
- Verified logic with isolated test case
2026-01-11 12:48:55 +00:00
Magnus Müller 6bccc224ca Remove comma 2026-01-10 20:01:14 -08:00
Magnus Müller aac5cad62a Fix system prompt code use 2026-01-10 20:00:18 -08:00
Magnus Müller 5652ba5dd9 Small comment 2026-01-10 19:03:35 -08:00
Magnus Müller c4b9710a84 Less priming for scroll 2026-01-10 18:33:17 -08:00
Magnus Müller 680d2551df Scroll element 2026-01-10 18:20:32 -08:00
Magnus Müller 1e0fd4d814 Remove CTA 2026-01-10 17:36:43 -08:00
Magnus Müller 9609aa10e5 Prompt 2026-01-10 17:25:36 -08:00
Magnus Müller fc2dc27c63 Prompts 2026-01-10 17:24:07 -08:00
ditingdapeng 882ac6471a fix: detect label/span wrappers for AntD-style controls 2026-01-08 04:04:10 +08:00
Mr-Neutr0n d73bca47e8 fix: respect use_vision=False in judge to prevent screenshot leakage (#3726)
When use_vision is set to False, screenshots should not be sent to the
judge LLM. This is a privacy concern as websites may contain sensitive
data that users explicitly do not want shared with LLMs.

Changes:
- Add use_vision parameter to construct_judge_messages()
- Only encode and include screenshots when use_vision is not False
- Pass self.settings.use_vision from _judge_trace() to construct_judge_messages()
- Add comprehensive tests for all use_vision modes

Fixes #3726
2026-01-08 00:44:36 +05:30
Magnus Müller d9943a0246 Merge branch 'main' into feat/multi-tab-recording 2026-01-07 17:49:16 +01:00
Saurav Panda 2c06eabf5f Added ax-name fallback for history rerun. 2026-01-06 12:07:10 -08:00
kalil0321 49a345fb19 Lint 2025-12-25 18:56:30 +01:00
kalil0321 1a96cf7ef0 Improve HAR Watchdog
Obtaining playwright har 1-1 parity might require more work, the missing elements are related to requests timing
2025-12-25 17:44:49 +01:00
kalil0321 038ae4bc8d Merge branch 'main' into kalil0321/har_watchdog 2025-12-25 17:10:05 +01:00
constx1337 6b77410683 refactor: Replace print with logger.debug in actor/page.py 2025-12-25 14:39:05 +08:00