8744 Commits

Author SHA1 Message Date
Laith Weinberger 770e19e112 lazy-load ChatAWSBedrock in MCP server to avoid boto3 requirement 2026-03-07 18:57:05 -05:00
Saurav Panda 2344df3fac fix: pass through timeout_ms and clip params in event handlers 2026-03-07 14:34:08 -08:00
laithrw 7a2f554038 don't explicitly pass newWindow: false to CDP createTarget (#4283)
Resolves #3908

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Stop sending newWindow: false to CDP Target.createTarget using
CreateTargetParameters. Only include newWindow when true, relying on
Chrome defaults for consistent tab creation; minor lint.

<sup>Written for commit b630ae596e.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-06 11:53:23 -05: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 bf7775dc85 Update pyproject.toml (#4265)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Updated pyproject.toml to bump the package version from 0.12.0 to
0.12.1. This prepares the 0.12.1 patch release and aligns the package
metadata with the release branch.

<sup>Written for commit 1536654073.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
0.12.1
2026-03-02 17:52:30 -08:00
Saurav Panda 1536654073 Update pyproject.toml 2026-03-02 17:35:31 -08:00
Saurav Panda 233f7f9434 fix: allow cross-origin iframe targets with empty URLs through _is_va… (#4264)
…lid_target()

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Allow iframe and webview targets that initially report an empty URL to
pass _is_valid_target(). This restores OOPIF frame discovery so
get_all_frames() can resolve full frame trees.

<sup>Written for commit 83908a7de1.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-02 16:48:45 -08: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
shawn pana b3341bc055 Update docs (#4263)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds Cloud entry points and a version switcher, and moves deprecated
Code Agent, Actor, and Sandbox docs into a new Legacy section. Updates
navigation and redirects so existing links continue to work.

- **New Features**
  - Adds Open Source / Cloud version switcher to the navbar.
  - Adds /cloud and /use-cloud pages that redirect to Cloud docs.
  - Updates the Introduction “Cloud Setup” card to link to /cloud.

- **Refactors**
- Moves Code Agent, Actor, and Sandbox docs under docs/legacy and adds a
“Legacy” nav group.
  - Updates internal links (AGENTS.md and MDX) to /legacy paths.
- Adds redirects from old customize paths and /production to their
/legacy equivalents; redirects /use-claude to /use-cloud.

<sup>Written for commit 6c24c9d841.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-02 16:27:03 -08:00
ShawnPana 6c24c9d841 Add Open Source / Cloud version dropdown to navbar
Add Mintlify versions switcher with Open Source (all existing docs)
and Cloud (redirects to docs.cloud.browser-use.com). Update intro
card to use /cloud redirect path for consistency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 16:01:13 -08:00
ShawnPana 3b78ffc50c Rename Use Claude to Use Cloud
Rename use-claude.mdx to use-cloud.mdx, update nav and redirects.
Add backward-compat redirect from /use-claude to /use-cloud.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 15:41:03 -08:00
ShawnPana 96f39b3c75 Move Code Agent, Actor, and Sandbox docs to Legacy section
Relocate deprecated doc sections from customize/ to legacy/ under
Customize OS nav. Add redirects for all old paths and update
cross-references in AGENTS.md and related mdx files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 15:30:39 -08:00
Magnus Müller 5ace60848b Docs production to Claude (#4251)
Replaces "Going to Production" in the navigation with "Use Claude"
linking to external documentation and adds redirects for both the old
and new paths.

---
[Slack
Thread](https://browser-use.slack.com/archives/C08P3EMVDJ5/p1772383713309059?thread_ts=1772383713.309059&cid=C08P3EMVDJ5)

<p><a
href="https://cursor.com/agents/bc-1811c281-8c26-51ae-84d3-dc7235a73544"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-1811c281-8c26-51ae-84d3-dc7235a73544"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</p>



<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Replaces the “Going to Production” docs nav item with “Use Claude,”
which links to our external Claude docs. Adds redirects (/use-claude →
external Claude docs, /production → /customize/sandbox/quickstart) and
removes the old production page.

<sup>Written for commit e1b450ddf4.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 23:00:43 -08:00
Magnus Müller 4ae7647472 Merge branch 'main' into cursor/docs-production-to-claude-72c8 2026-03-01 23:00:26 -08:00
laithrw a1f767406a fix channel param to select correct browser binary (#4256)
Resolves #3015 and mismatch with BrowserChannel in profile.py

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes browser selection by prioritizing the requested channel when
finding the local binary. Prevents launching the wrong browser and
aligns LocalBrowserWatchdog with profile.channel.

- **Bug Fixes**
- Pass profile.channel to _find_installed_browser_path and prioritize
channel-specific paths; skip prioritization when channel is default.
- Map BrowserChannel values to path groups and expand OS coverage,
including Edge paths on macOS and Linux.
- Keep a clear fallback order (system Chrome → Playwright Chromium →
other browsers incl. Canary/Dev/Brave/Edge → headless shell).

<sup>Written for commit f5df080b41.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 16:28:44 -05: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
laithrw 71ad655d73 fix(#3934): use MCP ImageContent for screenshots instead of embedding base64 in JSON (#4255)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Screenshots are now returned as MCP ImageContent instead of base64 in
JSON. This reduces payload size and aligns outputs with MCP content
types for browser_get_state and browser_screenshot.

- **Refactors**
- Updated handle_call_tool to return mixed content lists (TextContent +
ImageContent) when tools produce images.
- Changed _get_browser_state and _screenshot to return (metadata_json,
screenshot_b64 | None); dimensions remain in metadata.
- Removed embedded "screenshot" from JSON; kept "size_bytes" and
"viewport".
- Updated browser_screenshot tool description to reflect the new format.
  - Lint cleanup and synced with main; no functional changes.

- **Migration**
- Update clients to handle ImageContent in tool responses; parse
TextContent for metadata and use ImageContent for the image.
- Do not read "screenshot" from JSON; use "screenshot_dimensions"
(browser_get_state) or "viewport" (browser_screenshot) for coordinates.
- Expect handle_call_tool to return a list of content items for
image-producing tools.

<sup>Written for commit a1e54eff0e.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 16:08:17 -05:00
laithrw a1e54eff0e Merge branch 'main' into fix/mcp-screenshot-imagecontent 2026-03-01 16:05:27 -05:00
Laith Weinberger 086f18cf53 lint 2026-03-01 16:05:07 -05:00
Laith Weinberger 3a03d14f9b use MCP ImageContent for screenshots instead of embedding base64 in JSON 2026-03-01 15:59:18 -05:00
laithrw 20aac7babd fix(mcp): ensure extracted content is used in next step (#2582) (#3886)
Fixes: #2582

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes #2582 by ensuring MCP extracted_content is used only in the next
step, preventing repeated inclusion later. Sets
include_extracted_content_only_once=True on ActionResult in both MCP
client action wrappers.

<sup>Written for commit c330212e60.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 15:15:24 -05:00
laithrw c330212e60 Merge branch 'main' into fix/2582-mcp-action-result 2026-03-01 15:09:47 -05:00
laithrw aea64d73d5 fix(#3124): wrong bedrock import paths in docs (#4253)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Fixed AWS Bedrock import paths in the docs so users import
ChatAWSBedrock and ChatAnthropicBedrock from browser_use.llm, not
browser_use. Prevents ImportError and aligns with the current package
structure (Linear #3124).

<sup>Written for commit 94bc07b87d.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 15:02:23 -05:00
Laith Weinberger 94bc07b87d fix bedrock import paths in docs 2026-03-01 14:45:06 -05:00
laithrw 2da1ed7d58 fix(agent): disable json escaping in conversation history (#3878)
Fixes:#3090
Root Cause Identification: The issue was caused by Python's json.dump()
function, which defaults to ensure_ascii=True. This default behavior
converts all non-ASCII characters (like Chinese, Japanese, Emojis) into
Unicode escape sequences (e.g., \u4f60).
The Fix: I explicitly added ensure_ascii=False to the 
save_to_file
 method in 
browser_use/agent/views.py
. This tells the JSON serializer to write the characters directly as
UTF-8.
Verification: I ran a specific test script that:
Saved a file with Chinese characters using the original method
$\rightarrow$ FAIL (Result was \u...)
Saved a file with Chinese characters using the fixed method
$\rightarrow$ PASS (Result was readable text like 你好)

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Preserves non-ASCII characters across all JSON outputs by using
ensure_ascii=False and explicit UTF-8 encoding. Covers conversation
history, storage state (session + watchdog), HAR recordings, cookie
export, command_history.json, and code_use view saves, fixing #3090.

<sup>Written for commit 2a8f2a0bed.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 14:27:17 -05:00
laithrw 2a8f2a0bed Merge branch 'main' into fix/3090-json-escaping 2026-03-01 14:21:25 -05:00
Laith Weinberger 8ebe4385ed fix: preserve non-ASCII chars in all remaining JSON file outputs 2026-03-01 14:19:38 -05:00
laithrw beac807d84 fix: read aws_sso_auth from config instead of hardcoding True (#4246)
## Summary

Fixes #4148

The MCP server hardcodes `aws_sso_auth=True` when creating a
`ChatAWSBedrock` instance, forcing AWS SSO authentication for all
Bedrock users — even when standard `AWS_ACCESS_KEY_ID` /
`AWS_SECRET_ACCESS_KEY` credentials are configured.

## Changes

- `browser_use/mcp/server.py`:
- Read `aws_sso_auth` from `llm_config` with a default of `False`,
allowing boto3's standard credential chain to work correctly
  - Replaced a Chinese-language comment with an English one

## Usage

Users who need SSO auth can set it explicitly in their config:
```json
{"aws_sso_auth": true}
```

Users with IAM key-based auth (the most common deployment pattern) now
work without extra configuration.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Stop forcing AWS SSO auth for Bedrock in the MCP server. We now read
aws_sso_auth from config (default false) so IAM keys and the standard
boto3 credential chain work.

- **Bug Fixes**
- Read aws_sso_auth from llm_config and pass through to ChatAWSBedrock.
  - Replaced a non-English comment with an English one.

<sup>Written for commit 2a955de5c9.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 14:13:53 -05:00
laithrw 2a955de5c9 Merge branch 'main' into fix/mcp-aws-sso-auth 2026-03-01 14:11:25 -05:00
sudhanshu112233shukla d864bd7a8e fix(agent): disable json escaping in conversation history (#3090) 2026-03-01 14:11:02 -05:00
laithrw fbc465ff6e fix(#3099): use configured default model instead of hardcoding gpt-4o (#4252)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Use the configured default LLM model for MCP tool execution instead of
hardcoding gpt-4o. Fixes #3099 and preserves explicit model overrides
when provided.

- **Bug Fixes**
  - Tool schema now states the model defaults to the configured value.
- Removed 'gpt-4o' defaults from argument handling and function
signatures; model is optional.
  - Runtime falls back to llm_config['model'] when no model is passed.

<sup>Written for commit 50b22b2472.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 14:08:03 -05:00
Laith Weinberger 50b22b2472 fix(mcp): use configured default model instead of hardcoding gpt-4o 2026-03-01 14:03:42 -05:00
laithrw cdcc58d966 fix: use tempfile.gettempdir() instead of hardcoded /tmp for Windows compat (#4249)
On Windows, `Path('/tmp')` resolves to `C:\TMP` at the drive root, which
either crashes on import (`FileNotFoundError` / `FileExistsError`) or
silently pollutes the root drive. This replaces all hardcoded `/tmp`
paths with `tempfile.gettempdir()`, which returns the
platform-appropriate temp directory.

Also removes a redundant `import tempfile`.

## Attribution

Cherry-picked from @giulio-leone's commits in #4242:
- `cf2c179`: main fix across both files
- `33ba044`: redundant import cleanup

## Related issues

Fixes #4165, fixes #4073

## Related PRs

Several PRs addressed this; none covered all locations or were fully
CI-clean:

- #4074 (Chase-Xuu): `profile.py` only, misses `code_use/service.py`
- #4168 (worksbyfriday): `profile.py` only, misses `code_use/service.py`
- #4194 (thakoreh): `profile.py` only, CI failures
- #4240, #4242 (giulio-leone): fix both locations, CI green, mergeable.
This PR cherry-picks from #4242.
- #4206 (thakoreh): bundles this with unrelated proxy fix #4050

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Replace hardcoded /tmp with tempfile.gettempdir() for profile downloads
and the code agent directory, using the correct temp folder on all
platforms. Prevents Windows errors and root drive pollution; also
switches to a single module-level tempfile import.

- **Bug Fixes**
  - Use tempfile.gettempdir() for downloads_path and agent_directory.
- Prevents FileNotFoundError/FileExistsError on Windows and avoids
C:\TMP.

- **Refactors**
- Use module-level tempfile import; remove local shadowed imports in
profile extraction and downloads setup.

<sup>Written for commit e9222d49e1.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 12:00:20 -05:00
laithrw e9222d49e1 Merge branch 'main' into fix/windows-hardcoded-tmp-path 2026-03-01 11:57:50 -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
Cursor Agent e1b450ddf4 Replace 'Going to Production' with 'Use Claude' external link
- Replace 'production' nav item with 'use-claude' linking to docs.cloud.browser-use.com/introduction
- Add redirect from /use-claude to external Claude docs
- Add redirect from /production to /customize/sandbox/quickstart for backward compatibility
- Delete production.mdx, create use-claude.mdx with meta refresh fallback

Co-authored-by: Magnus Müller <MagMueller@users.noreply.github.com>
2026-03-01 16:52:22 +00:00
Magnus Müller e7b6bc8d58 OS documentation text (#4250)
Update documentation navigation group names in `docs/docs.json` to
improve clarity.

---
[Slack
Thread](https://browser-use.slack.com/archives/C08P3EMVDJ5/p1772383552844489?thread_ts=1772383552.844489&cid=C08P3EMVDJ5)

<p><a
href="https://cursor.com/agents/bc-73b41af7-f0d4-5ebc-9846-405ca10315f2"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-73b41af7-f0d4-5ebc-9846-405ca10315f2"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</p>



<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Renamed documentation navigation group labels to make OS scope clear and
improve sidebar clarity.

- **Refactors**
  - Get Started → Get Started with Open Source
  - Customize → Customize OS
  - Examples → Examples OS
  - Development → Development OS

<sup>Written for commit 13d7e36b61.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 08:48:27 -08:00
Cursor Agent 13d7e36b61 docs: rename navigation groups with OS suffix
Co-authored-by: Magnus Müller <MagMueller@users.noreply.github.com>
2026-03-01 16:47:15 +00: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
laithrw 70a26c5ce4 fix: disable proxy for localhost CDP requests (#4050) (#4063)
## Summary

Fixes #4050 - CDP startup fails on Windows with proxy env causing
JSONDecodeError on /json/version.

## Problem

When `HTTP_PROXY` or `HTTPS_PROXY` environment variables are set,
`httpx.AsyncClient()` by default routes **all** HTTP requests through
the proxy, including localhost requests to the Chrome DevTools Protocol
endpoint (`http://127.0.0.1:<port>/json/version`).

On Windows, this causes the CDP endpoint query to return a 502 response
with an empty body, which then fails JSON parsing with:
```
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
```

## Solution

Add `trust_env=False` to the `httpx.AsyncClient()` call when querying
the CDP `/json/version` endpoint. This prevents httpx from using proxy
environment variables for this specific localhost request.

## Changes

- Modified `browser_use/browser/session.py`: Added `trust_env=False`
parameter to httpx.AsyncClient() in the connect() method

## Testing

- Verified the change allows CDP connection to succeed when proxy env
vars are set
- The fix is minimal and targeted, only affecting the CDP endpoint query

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Disable proxy usage only for local CDP /json/version requests
(localhost, 127.0.0.1, ::1) to fix Windows startup 502s and
JSONDecodeError. Local requests use httpx.AsyncClient with
trust_env=False; remote CDP URLs continue to honor
HTTP_PROXY/HTTPS_PROXY.

<sup>Written for commit 9932f06500.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 11:25:00 -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 0bef817574 fix browser state format in system_prompt.md (#4248)
Resolves #3782, and makes a slight change to #3802.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes the Browser State format docs in system_prompt.md to match the
actual DOMTreeSerializer output. Replaces the old
[index]<type>text</type> description with a tree-style format
([index]<tag attr=value /> with text on child lines), updates the
example, and documents the |SCROLL| and |SHADOW(open/closed)| prefixes
(fixes #3782).

<sup>Written for commit e3ca7ea550.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 10:31:31 -05:00
Laith Weinberger e3ca7ea550 use cleaner example for browser state format 2026-03-01 10:23:32 -05:00
Mr-Neutr0n 66b857959c docs: fix browser state format documentation in system_prompt.md (#3782)
The system_prompt.md incorrectly documented the browser state format as:
  [index]<type>text</type>
  Example: [33]<div>User form</div>

But the actual serializer output format is:
  [index]<tagname attribute=value />
  With text content as child nodes on separate lines

This update:
- Corrects the format description to match actual DOMTreeSerializer output
- Updates examples to show realistic tree structure
- Documents |SCROLL| prefix for scrollable containers
- Documents |SHADOW(open/closed)| prefix for shadow DOM elements

Fixes #3782
2026-03-01 10:23:32 -05:00
Saurav Panda b7deeb424d added product hunt launch banner (#4247)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Added a Product Hunt launch banner to the README to promote the launch
and direct users to our Product Hunt page. This places a featured badge
alongside existing badges and links out in a new tab.

<sup>Written for commit f3aeca9bef.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-02-28 23:28:51 -08:00
Saurav Panda f3aeca9bef added product hunt launch banner 2026-02-28 23:22:43 -08:00