Commit Graph

1550 Commits

Author SHA1 Message Date
laithrw 76604913ad Merge branch 'main' into fix/browser-session-close 2026-04-12 17:45:44 -04:00
Laith Weinberger c1eb87a35f close alias for BrowserSession stop
thousands of users have attempted to use close, so why not add it
2026-04-12 17:43:04 -04:00
Laith Weinberger 03e2bc4da8 prefer Playwright chromium over sys Chrome by default 2026-04-12 11:41:50 -04:00
laithrw 60e7767228 Merge branch 'main' into issue-4631-review 2026-04-11 18:07:12 -04:00
Laith Weinberger 534eaafe7a clear dom cache after scroll to prevent stale extract data 2026-04-11 18:03:06 -04:00
Alezander9 76569995fd Improve OSS-to-cloud conversion: UTM tracking, better error messages, and cloud nudges
- Add UTM params to all cloud-bound links across README, CLI, and error messages
- Rewrite README Open Source vs Cloud section: position cloud browsers as
  recommended pairing for OSS users, remove separate Use Both section
- Rewrite error messages for use_cloud=True and ChatBrowserUse() to clearly
  state what is wrong and what to do next
- Add missing URLs: invalid API key now links to key page, insufficient
  credits now links to billing page
- Add cloud browser nudge on captcha detection (logger.warning)
- Add cloud browser nudge on local browser launch failure
2026-04-08 22:05:50 -07:00
shawn pana a7b476ee46 Merge branch 'main' into multi-session 2026-04-02 13:02:51 -07:00
ShawnPana f27c567aad fix: enable_recording defaults False in library, configurable in CLI
Library keeps recording off by default. CLI reads cloud_connect_recording
from config (defaults True). Users can disable with:
  browser-use config set cloud_connect_recording false
2026-04-01 22:22:33 -07:00
MagMueller 3aa68384ad style: use TimeoutError instead of asyncio.TimeoutError (py3.11+) 2026-04-01 21:54:58 -07:00
MagMueller dcc7e691c4 fix: add 2s timeout to pending network request check in DOM watchdog
On slow CI machines, _get_pending_network_requests() can hang for 15s+
when Chrome is busy loading/rendering after a navigation. This silently
eats into the 30s BrowserStateRequestEvent budget, leaving insufficient
time for the actual DOM capture — causing 5 consecutive timeouts and
agent termination.

Observed on eBay search results in eval runs: DOMWatchdog started but
produced zero log output for 15 seconds before the timeout killed it.
The pending network check was the first await after the URL log.
2026-04-01 21:40:06 -07:00
shawn pana f9f56b8392 Merge branch 'main' into multi-session 2026-04-01 21:31:42 -07:00
ShawnPana 032e73eec7 feat: config-driven proxy/timeout for cloud connect, enable recording
cloud connect reads cloud_connect_proxy and cloud_connect_timeout from
~/.browser-use/config.json. Recording always enabled via enableRecording
default on CreateBrowserRequest. No CLI flags — edit config for custom
settings, use cloud v2 REST for full control.
2026-03-31 13:44:27 -07:00
LarsenCundric 5e644981e8 fix: close CloudBrowserClient httpx pool on session stop to prevent memory leak
BrowserSession.on_BrowserStopEvent calls stop_browser() but never calls
_cloud_browser_client.close(), leaving the httpx connection pool alive.
On Lambda provisioned concurrency, these pools accumulate across
invocations — memory climbs from ~1.3GB to the 3GB ceiling over hours,
triggering OOM kills (21 Runtime.ExitError crashes in 6 hours observed
in production).

Changes:
- Call _cloud_browser_client.close() in on_BrowserStopEvent after
  stop_browser completes (in a finally block so it runs even if
  stop_browser fails)
- Make CloudBrowserClient.close() idempotent (check is_closed before
  calling aclose) so it's safe to call multiple times

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 11:19:43 -07:00
laithrw 4c883feb7c Merge branch 'main' into fix/cloud-session-stop-cdp-reconnect 2026-03-25 19:34:25 -04:00
laithrw a2313d9665 Merge branch 'main' into feature/cdp-navigation-timeout 2026-03-25 17:30:42 -04:00
Laith Weinberger 393d2c5b0f rm pass 2026-03-25 16:56:36 -04:00
Laith Weinberger e44ce7ce73 fix linux profile detection for chromium users 2026-03-24 18:14:22 -04:00
revanthkumar96 1c4182d4ec Add nav_timeout parameter to control CDP Page.navigate() timeout
- Add nav_timeout parameter to navigate_to_url_and_wait() method
- Pass nav_timeout from NavigateToUrlEvent to control CDP navigation timeout
- Fix issue where TIMEOUT_NavigateToUrlEvent env var only controlled outer timeout but CDP call had hardcoded 20s timeout
- Add comprehensive test case to verify env var controls CDP timeout
2026-03-24 11:19:34 +05:30
Laith Weinberger 29da480659 replace MV2 extensions with MV3 + remove chrome flags that block extension loading 2026-03-22 14:17:56 -04:00
Saurav Panda 4a65aea6a9 Merge branch 'main' into auto-switch-new-tab 2026-03-21 17:17:32 -07:00
Saurav Panda 03de83a069 Merge branch 'main' into iframe-click-issue 2026-03-21 15:57:02 -07:00
Saurav Panda 3b8f2457b1 fix: index elements inside cross-origin iframes reliably 2026-03-21 15:54:35 -07:00
Saurav Panda e7a05cbe86 fix: auto-switch to new tabs after click and add checkbox toggle fallback
- AGI-569: after any click that opens a new tab, automatically dispatch
  SwitchTabEvent so the agent lands on the new page immediately instead
  of requiring a manual switch step (~877 occurrences)

- AGI-548: for <input type="checkbox/radio">, capture checked state
  before the CDP mouse click and verify it toggled afterward; if
  unchanged (custom-styled or shadow-DOM-backed inputs), fall back to
  JS element.click() and report the final checked state in metadata
  (~1,241 occurrences)
2026-03-20 12:43:58 -07:00
shawn pana a2c2fa33aa Merge branch 'main' into cli 2026-03-20 09:34:45 -07:00
reformedot 2675c52e65 Enhance User-Agent header handling in BrowserSession
- Updated the BrowserSession class to ensure the User-Agent header is set correctly for both local and remote connections.
- Introduced a utility function to retrieve the browser-use version and incorporated it into the User-Agent string.
- Ensured headers are consistently handled as dictionaries to avoid potential issues with None values.

This change improves the reliability of the CDP client communication by providing a proper User-Agent, which can be crucial for certain web interactions.
2026-03-19 23:33:10 -07:00
ShawnPana 91c02012c3 merge origin/main into cli, resolve agent.py delete conflict 2026-03-19 21:06:38 -07:00
ShawnPana 694a111fad add upload command to CLI, extract find_file_input_near_element to BrowserSession
- Add `browser-use upload <index> <path>` command for uploading files to
  file input elements via the CLI
- Extract find_file_input_near_element from nested closures in tools/service.py
  to a reusable method on BrowserSession, deduplicating two copies
- Add BrowserWrapper.upload() for the Python REPL
- Resolve file paths to absolute on the client side before sending to daemon
- Update SKILL.md files and README with upload command docs
2026-03-19 17:02:34 -07:00
Saurav Panda c0b2fc1210 prevent highlight cleanup from blocking 2026-03-16 17:46:42 -07:00
Saurav Panda 151de628e0 fixed the highlighting check logic 2026-03-16 16:56:54 -07:00
Saurav Panda f8c729d468 fix(browser): prevent remove_highlights() from blocking screenshot handler on slow pages 2026-03-16 10:05:53 -07:00
Saurav Panda 2344df3fac fix: pass through timeout_ms and clip params in event handlers 2026-03-07 14:34:08 -08:00
Laith Weinberger b630ae596e lint 2026-03-06 11:37:38 -05:00
Laith Weinberger b051fe2a7a don't explicitly pass newWindow: false to CDP createTarget 2026-03-06 11:28:36 -05:00
Saurav Panda 83908a7de1 Merge branch 'main' into ph-launch 2026-03-02 16:40:22 -08:00
Saurav Panda 10b5d1cd88 fix: allow cross-origin iframe targets with empty URLs through _is_valid_target() 2026-03-02 16:36:39 -08:00
Laith Weinberger f5df080b41 lint 2026-03-01 16:21:49 -05:00
Laith Weinberger 209866ed5b fix channel param to select correct browser binary 2026-03-01 16:17:18 -05:00
Laith Weinberger 8ebe4385ed fix: preserve non-ASCII chars in all remaining JSON file outputs 2026-03-01 14:19:38 -05:00
g97iulio1609 198fb6f277 fix: remove redundant local tempfile imports
tempfile is already imported at module level (line 3). The local
imports inside set_default_downloads_path() and _extract_extension()
were shadowing the module-level import with no effect.

Refs: browser-use/browser-use#4242
2026-03-01 11:56:50 -05:00
g97iulio1609 9939aa8f11 fix: use tempfile.gettempdir() instead of hardcoded /tmp for cross-platform compat
On Windows, Python resolves '/tmp' to the current drive root (e.g. C:\TMP),
creating unwanted folders. Use tempfile.gettempdir() which returns the
platform-appropriate temp directory on all operating systems.

Applied to:
- browser_use/browser/profile.py: BrowserProfile downloads_path default
- browser_use/code_use/service.py: CodeUseService agent_directory base

Fixes #4165
2026-03-01 11:56:50 -05:00
Laith Weinberger e239d1f523 fix: remove redundant local tempfile imports
tempfile is already imported at module level (line 3). The local
imports inside set_default_downloads_path() and _extract_extension()
were shadowing the module-level import with no effect.

Refs: browser-use/browser-use#4242
2026-03-01 11:44:20 -05:00
Laith Weinberger 9932f06500 Merge main into fix/issue-4050-windows-proxy and resolve conflicts 2026-03-01 11:22:28 -05:00
laithrw 744c2be4ae Merge branch 'main' into issue-3523-fix 2026-02-26 21:05:37 -05:00
Laith Weinberger c8bfc86440 rm unused imports 2026-02-26 15:55:36 -05:00
Laith Weinberger 89817de334 Fix proxy auth attach handler overwriting tab tracking 2026-02-26 15:48:38 -05:00
iafisch 405d9ec624 fix: stop cloud sessions for cdp_url reconnect flows 2026-02-25 08:07:52 -05:00
Larsen Cundrič 2503c5f159 Merge branch 'main' into larsen/add-timeouts-to-browser-connects 2026-02-24 18:19:42 -08:00
LarsenCundric 505d5df406 Add timeouts to browser connects and waits 2026-02-24 18:13:28 -08:00
Saurav Panda 08bf06f734 Merge branch 'main' into websocket-connection-issues 2026-02-24 17:18:33 -08:00
Aitor f60a62bc76 Merge branch 'main' into feat/add-captcha-solver-handling 2026-02-24 07:13:06 +01:00