Commit Graph

5846 Commits

Author SHA1 Message Date
Magnus Müller
a652335316 Remove outdated methods 2025-08-31 11:31:32 -07:00
Magnus Müller
33f69b1525 less-timeouts 2025-08-31 11:18:47 -07:00
Magnus Müller
663fbb4e38 Merge branch 'fix-viewport' of https://github.com/browser-use/browser-use into fix-viewport 2025-08-31 10:35:27 -07:00
Magnus Müller
486c631132 Fix noqa 2025-08-31 10:35:14 -07:00
Magnus Müller
972ceac12d Merge branch 'main' into fix-viewport 2025-08-31 10:34:25 -07:00
Magnus Müller
d9e06700bd fix-viewport 2025-08-31 10:25:29 -07:00
Magnus Müller
0349c5dffa smaller-highlights-with-screensize (#2889)
Auto-generated PR for: smaller-highlights-with-screensize
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Make element highlight labels scale with screen size so they stay
smaller on large screenshots and more consistent across devices. Font
size and padding now derive from image width, with min/max bounds; the
drawing function also accepts device_pixel_ratio for future CSS-pixel
scaling.

- **New Features**
- Added device_pixel_ratio to draw_enhanced_bounding_box_with_text and
passed it through from process_element_highlight.
- Scaled index label font size to ~1% of viewport width, clamped between
10–20px.
  - Scaled label padding based on width, clamped between 4–10px.

<!-- End of auto-generated description by cubic. -->
2025-08-31 09:35:08 -07:00
Magnus Müller
833ad7128d Remove comment 2025-08-31 09:34:45 -07:00
Magnus Müller
1b5b360ae8 smaller-highlights-with-screensize 2025-08-31 09:29:18 -07:00
Magnus Müller
941302914c new-tab-info (#2887)
Auto-generated PR for branch: new-tab-info
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Detect and report when a click opens a new tab, and make element
highlights clearer and on by default to improve navigation and
screenshot readability.

- **New Features**
- Click results now include new_tab_opened; memory logs reflect it.
while_holding_ctrl is optional and still opens in a background tab.
- Highlights are enabled by default; index labels use fixed sizing,
top-center placement, and show the index when text length < 3. Docs
updated.
- Optional screenshot saving via BROWSER_USE_SCREENSHOT_FILE with async
write; ignore screenshot.png in git.
- Faster new-tab detection with reduced watchdog wait (0.25s) and
automatic tab switch preserved.

<!-- End of auto-generated description by cubic. -->
2025-08-31 09:05:48 -07:00
Magnus Müller
7a2a402005 Merge branch 'new-tab-info' of https://github.com/browser-use/browser-use into new-tab-info 2025-08-31 08:48:52 -07:00
Magnus Müller
b86f173fc6 Refactor screenshot saving in python_highlights.py to use asyncio for improved performance and remove aiofiles dependency. 2025-08-31 08:48:51 -07:00
Magnus Müller
267ff76e50 Refactor screenshot saving in python_highlights.py to use aiofiles for asynchronous file writing and update .gitignore to ensure screenshot.png is properly excluded. 2025-08-31 08:47:33 -07:00
Magnus Müller
bbd24f7d5d Merge branch 'main' into new-tab-info 2025-08-31 08:45:51 -07:00
Magnus Müller
0df5491e9f smaller-highlights (#2886)
Auto-generated PR for branch: smaller-highlights
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Make highlight index boxes a fixed, smaller size across viewports and
add an opt-in, async screenshot save path.

- New Features
- Save highlighted screenshot when BROWSER_USE_SCREENSHOT_FILE is set;
file write runs off-thread.

- Refactors
- Fixed font size (20) and padding (10) for index overlays for a
consistent look.
  - Add *.png to .gitignore and update example task text.

<!-- End of auto-generated description by cubic. -->
2025-08-31 08:45:46 -07:00
Magnus Müller
e10826ca34 Fix Bug: Async Function Error in Screenshot Handling 2025-08-31 08:45:00 -07:00
Magnus Müller
138cc076fe Refactor DefaultActionWatchdog to improve tab handling and metadata return
- Reduced sleep duration in the watchdog from 0.5s to 0.25s for efficiency.
- Added logic to track if a new tab was opened and included this information in the returned click metadata.
- Updated ClickElementAction to handle optional Ctrl key behavior and reflect new tab opening in memory logging.
2025-08-31 08:37:15 -07:00
Magnus Müller
929489352e Len to show highlight index set less than 3 2025-08-31 08:18:12 -07:00
Mert Unsal
ea5c6b558e Enable highlights by default 2025-08-31 08:17:23 -07:00
Magnus Müller
10f65fd5ef Update task description in example script to reflect new focus on finding founders of browser-use. 2025-08-31 08:15:28 -07:00
Magnus Müller
0caa3546c3 Merge branch 'smaller-highlights' of https://github.com/browser-use/browser-use into smaller-highlights 2025-08-31 08:14:35 -07:00
Magnus Müller
8ecc46daf6 Update system prompts for clarity and adjust bounding box rendering in Python highlights
- Revised system prompt descriptions to clarify the provision of screenshots and bounding boxes for interactive elements.
- Enhanced bounding box positioning logic in `python_highlights.py` to improve visibility and avoid content blocking.
- Updated screenshot logging to reflect dynamic filename usage.
2025-08-31 08:14:32 -07:00
Magnus Müller
c36ea38e78 Merge branch 'main' into smaller-highlights 2025-08-31 07:57:52 -07:00
Magnus Müller
20193556a1 Add PNG files to .gitignore and refactor screenshot saving in Python highlights
- Updated .gitignore to exclude PNG files.
- Refactored the screenshot saving logic in `python_highlights.py` to use an environment variable for the filename and added async file writing for improved performance.
- Adjusted font size and padding to fixed values for consistent appearance across different screen sizes.
2025-08-31 07:57:24 -07:00
Magnus Müller
81461cdfff Adjust font size and padding calculations for enhanced bounding box rendering in Python highlights; update task description in example script for clarity. 2025-08-31 07:43:38 -07:00
Mert Unsal
66bad7baec Bump version to 0.7.1 (#2885)
Bump the project version to 0.7.1.

---
[Slack
Thread](https://browser-use.slack.com/archives/D092QUQDC56/p1756637685455749?thread_ts=1756637685.455749&cid=D092QUQDC56)

<a
href="https://cursor.com/background-agent?bcId=bc-0660945d-2820-4a5d-abf0-1f1e02e8b459">
  <picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-cursor-dark.svg">
<source media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-cursor-light.svg">
<img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg">
  </picture>
</a>
<a
href="https://cursor.com/agents?id=bc-0660945d-2820-4a5d-abf0-1f1e02e8b459">
  <picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-web-dark.svg">
<source media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-web-light.svg">
    <img alt="Open in Web" src="https://cursor.com/open-in-web.svg">
  </picture>
</a>


    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Update project to version 0.7.1 and sync the MCP server’s reported
version to match. Ensures clients and tooling see the correct version
during initialization.

<!-- End of auto-generated description by cubic. -->
0.7.1
2025-08-31 12:58:01 +02:00
Mert Unsal
ec94c8650d Update browser_use/mcp/server.py 2025-08-31 12:57:38 +02:00
Cursor Agent
af8cfad9ff chore: bump version to 0.7.1 2025-08-31 10:55:58 +00:00
Mert Unsal
eedd97469e disable highlights by default (#2884)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Disable element highlights by default to reduce visual noise and make
the UI cleaner. Updated BrowserProfile.highlight_elements default to
False and synced the docs.

- **Migration**
- If you relied on highlights, explicitly set highlight_elements=True in
BrowserProfile or your config.
  - No other changes required.

<!-- End of auto-generated description by cubic. -->
2025-08-31 12:54:17 +02:00
mertunsall
6de9261b85 disable highlights by default 2025-08-31 12:46:24 +02:00
Mert Unsal
2eaf40d229 Re-enable auto download pdfs (#2883) 2025-08-31 12:41:14 +02:00
mertunsall
5bce1b6898 enable auto download pdfs 2025-08-31 12:40:24 +02:00
Mert Unsal
e9eb3346a0 Do not input_text + scroll (#2882) 2025-08-31 11:58:48 +02:00
mertunsall
145b319d83 update sys prompts 2025-08-31 11:58:15 +02:00
Magnus Müller
da94635e05 remove-efficiency-rules (#2877)
Auto-generated PR for branch: remove-efficiency-rules
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Streamlined efficiency guidelines and action docs to make multi‑action
steps safer and clearer. Fixed URL detection by stripping emails before
matching, and improved scroll guidance to prefer larger jumps and omit
index for full‑page scrolling.

- **Bug Fixes**
- Remove emails from task text before URL matching to prevent false
positives.

- **Refactors**
- Simplified efficiency_guidelines in all prompts; added clear do/don’t
for chaining and updated recommended combos (including scroll +
extract).
- Clarified click_element_by_index and input_text descriptions to only
allow indices from the current browser_state.
- Updated scroll action docs to favor high num_pages (e.g., 10) and to
omit index when scrolling the entire page.

<!-- End of auto-generated description by cubic. -->
2025-08-30 18:44:37 -07:00
Magnus Müller
1596f25a5a System prompt efficiency_guidelines 2025-08-30 18:39:10 -07:00
Magnus Müller
30b2d631f9 Merge commit 'cb63d579bd61c4239125780d1d658d2eada36a1b' into remove-efficiency-rules 2025-08-30 18:33:56 -07:00
Magnus Müller
f17a13b308 Typo 2025-08-30 18:33:30 -07:00
Magnus Müller
889657a273 Linter 2025-08-30 18:30:49 -07:00
Magnus Müller
84c644aedb Patch extension with whitelist 2025-08-30 18:27:21 -07:00
Magnus Müller
f50cc45b51 Works to remove cookies 2025-08-30 18:14:59 -07:00
Mert Unsal
cb63d579bd Improve extract structured data input, output, and LLM calls (#2880)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Improves the extract_structured_data tool to return cleaner, more
accurate results by normalizing page markdown, enforcing input limits,
and using a clearer system+user prompt. This makes extractions more
consistent and reduces noisy or invented outputs.

- **Refactors**
- Normalizes markdown: removes artifacts, demarkdowns inline links,
compresses excessive newlines, and trims whitespace.
- Enforces size limits: truncates content at MAX_CHAR_LIMIT and
annotates when truncated.
- Uses structured prompting: sends SystemMessage + UserMessage with
strict rules (page-only facts, list all items, non-conversational
output, note if data is missing).
- Clarifies tool usage: updated action description to discourage using
it for interactive elements and to gate link extraction via
extract_links.
- Simplifies memory handling: only stores small results
(MAX_MEMORY_LENGTH).

<!-- End of auto-generated description by cubic. -->
2025-08-31 03:06:56 +02:00
mertunsall
ca05521b0c try to prevent overusage of extract_structured_data 2025-08-31 02:52:50 +02:00
mertunsall
87ae7f3976 hotfix 2025-08-31 02:25:08 +02:00
mertunsall
84ebfee661 improve extract structured data 2025-08-31 02:21:17 +02:00
Mert Unsal
c06fb84f37 Minor documentation changes for consistency. (#2843)
Minor documentation changes for consistency according to issue :
https://github.com/browser-use/browser-use/issues/2810 @sauravpanda
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Standardized the max_steps description across the server schema and docs
with consistent wording and punctuation. Cleaned up the real-browser
guide by merging duplicate notes and clarifying that we use DuckDuckGo
because Google blocks this approach.

<!-- End of auto-generated description by cubic. -->
2025-08-31 00:51:22 +02:00
Mert Unsal
157d0804cb Merge branch 'main' into correction-in-docs 2025-08-31 00:50:59 +02:00
Mert Unsal
203febb67d Update gif.py (#2847)
fixes os related font error at gif creation
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Fixes GIF creation crashes on some OSes by adding a safe fallback when
loading fonts. If loading a TrueType font fails, we now use the existing
regular font.

- **Bug Fixes**
- Catch OSError/AttributeError from ImageFont.truetype and fall back to
regular_font.
- Prevents failures when regular_font has no .path or the font cannot be
loaded.

<!-- End of auto-generated description by cubic. -->
2025-08-31 00:49:20 +02:00
Mert Unsal
e07ad3bc32 Merge branch 'main' into os-font-fix 2025-08-31 00:48:49 +02:00
Mert Unsal
ad7a3d6a84 better exception handling from browser events -> LLM (#2879)
<!-- This is an auto-generated description by cubic. -->

## Summary by cubic
Introduce BrowserError with short- and long-term memory to carry
structured context from browser events to the LLM, replacing brittle
string parsing. Improves guidance after failures (clicks, dropdowns,
uploads) and makes errors more actionable.

- **New Features**
- Added BrowserError with short_term_memory (one-shot guidance) and
long_term_memory (persistent context).
- Dropdown actions return structured memory; on selection failure,
return available options for the LLM to choose from.
- Tools map BrowserError to ActionResult via handle_browser_error,
setting include_extracted_content_only_once when needed.

- **Refactors**
- Replaced <llm_error_msg>-based parsing with structured errors across
click, input, upload, navigation, tabs, scroll, and send keys.
- Standardized error messages and improved timeout handling; registry
now surfaces TimeoutError as a clear RuntimeError.
- Safer file upload validation; common invalid path and missing element
cases return ActionResult instead of crashing.
- Removed automatic get_dropdown_options during click failures to avoid
hidden side effects.
  - Updated dependency: bubus >= 1.5.6.

<!-- End of auto-generated description by cubic. -->
2025-08-30 22:13:02 +02:00