Commit Graph

1437 Commits

Author SHA1 Message Date
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 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
mertunsall 6de9261b85 disable highlights by default 2025-08-31 12:46:24 +02:00
mertunsall 5bce1b6898 enable auto download pdfs 2025-08-31 12:40:24 +02:00
Magnus Müller 30b2d631f9 Merge commit 'cb63d579bd61c4239125780d1d658d2eada36a1b' into remove-efficiency-rules 2025-08-30 18:33:56 -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
mertunsall 890a535f9e reenable returning dropdown option when clicked on a select element. 2025-08-30 22:04:16 +02:00
mertunsall 09c27fc2cc dont default 2025-08-30 21:08:26 +02:00
Mert Unsal 93d808ad91 Merge branch 'main' into mert/better_browser_exceptions 2025-08-30 20:53:05 +02:00
mertunsall b177f3166e better exception handling from browser events -> LLM 2025-08-30 20:50:42 +02:00
Magnus Müller 89af16361f Add timeouts 2025-08-30 11:04:14 -07:00
Magnus Müller 799fe88aa5 New extension 2025-08-30 11:03:55 -07:00
Magnus Müller aad4b932bf time_execution_async import 2025-08-29 22:32:05 -07:00
Magnus Müller 25823ce670 make highlights sync 2025-08-29 22:25:32 -07:00
Magnus Müller ce0876adb7 highlight in parallel 2025-08-29 22:17:50 -07:00
Magnus Müller e570acfefc Enhance DOM service initialization in DOMWatchdog
- Updated the instantiation of `DomService` to include `cross_origin_iframes` parameter from the browser session profile, improving its configuration for handling cross-origin iframes.
2025-08-29 21:54:16 -07:00
Magnus Müller d8b23062b9 Formatter 2025-08-29 21:46:45 -07:00
Magnus Müller 4a62fe11f9 More logging 2025-08-29 21:42:14 -07:00
Magnus Müller 7b0e216ff0 Update font size and padding adjustments in bounding box drawing for enhanced visibility
- Increased font size in `draw_enhanced_bounding_box_with_text` from 30 to 36 for improved readability.
- Adjusted padding from 8 to 6 to accommodate the larger font while maintaining visual clarity.
- Enhanced text positioning logic to prevent clipping and ensure proper alignment within the bounding box.
2025-08-29 21:36:25 -07:00
Magnus Müller a31ae9dffb Refactor bounding box drawing and enhance LLM text representation
- Removed the `_raise_if_stopped_or_paused` method from the `Agent` class to streamline functionality.
- Updated `draw_enhanced_bounding_box_with_text` to improve font size and padding for better visibility of index boxes.
- Introduced `get_meaningful_text_for_llm` method in `EnhancedDOMTreeNode` to provide more relevant text for LLM processing.
- Enhanced `llm_representation` method with observability features for better debugging.
2025-08-29 21:30:11 -07:00
Magnus Müller e8bd85865d Add filter for highlight IDs in screenshot generation and update element colors
- Introduced `filter_highlight_ids` option in `BrowserProfile`, `BrowserSession`, and `create_highlighted_screenshot` to control the visibility of element IDs based on text length.
- Updated `draw_enhanced_bounding_box_with_text` to utilize the new filtering logic for enhanced visual clarity.
- Changed the color of text areas from yellow to orange for improved visibility in the UI.
2025-08-29 20:56:03 -07:00
Magnus Müller 66822d6090 Update font size and padding in bounding box drawing functions for improved visibility
- Increased font size in `draw_enhanced_bounding_box_with_text` from 35 to 40 for better readability.
- Adjusted padding in `draw_bounding_box_with_text` from 3 to 5 to enhance spacing around text elements.
2025-08-29 20:45:54 -07:00
Magnus Müller 8511c2d398 Remove display highlights on screen feature and adjust bounding box drawing parameters
- Eliminated the `display_highlights_on_screen` option from `BrowserProfile` and `BrowserSession` to streamline the highlighting functionality.
- Updated the `draw_enhanced_bounding_box_with_text` function to increase font size for better visibility and reduced padding for a more compact layout.
- Removed associated screenshot overlay logic in `DOMWatchdog` to reflect the removal of the display highlights feature.
2025-08-29 20:38:57 -07:00
Magnus Müller 3b6c5d11ba Enhance bounding box drawing with dashed borders and larger index containers
- Updated `draw_enhanced_bounding_box_with_text` function to draw dashed bounding boxes for better visibility.
- Increased the size of index text and padding for improved prominence.
- Adjusted text positioning logic to ensure proper placement within or outside the bounding box based on available space.
- Enhanced background rectangle drawing for better contrast and visibility.
2025-08-29 20:24:13 -07:00
Magnus Müller 634dd20e37 Add display highlights on screen feature and enhance bounding box drawing
- Introduced `display_highlights_on_screen` option in `BrowserProfile` and `BrowserSession` to control the visibility of highlights directly on the browser screen.
- Implemented `draw_enhanced_bounding_box_with_text` function to improve the visual representation of highlighted elements with larger indices and solid borders.
- Updated screenshot overlay logic in `DOMWatchdog` to utilize the new highlighting feature, ensuring better visibility of interactive elements during browser sessions.
2025-08-29 20:19:26 -07:00
Magnus Müller 3e568d4280 Merge remote-tracking branch 'origin/main' into cursor/generate-python-highlights-for-browser-screenshot-ef29 2025-08-29 19:56:47 -07:00
Magnus Müller 7ad12bbfde fix-windowsVirtualKeyCode 2025-08-29 19:49:34 -07:00
Magnus Müller f4a34bc1d7 fix-clear-text 2025-08-29 19:24:47 -07:00
jason a8b4b034c1 Merge branch 'main' into fix/cdp-viewport-initialization 2025-08-29 22:22:13 -04:00
Magnus Müller 46c0dc4fe2 Refactor key code mapping and text field clearing logic in DefaultActionWatchdog
- Updated key code mappings for special characters to reflect correct usage with modifiers.
- Enhanced text field clearing method to use platform-specific modifiers (Cmd for macOS, Ctrl for others) for a more human-like interaction.
- Removed unnecessary `windowsVirtualKeyCode` assignments for printable characters to prevent incorrect virtual key code usage.

These changes improve the accuracy of character input handling and enhance the robustness of text field interactions.
2025-08-29 18:45:20 -07:00
Magnus Müller 42e6cc80e0 Remove CDPSession in default watchdog 2025-08-29 18:34:03 -07:00
Magnus Müller 4e80786015 Refactor DefaultActionWatchdog for improved focus handling
- Added type hint for CDPSession in the _focus_element_simple method.
- Enhanced logging for focus attempts, including exception details.
- Reduced sleep duration in scrollIntoViewIfNeeded for better performance.
- Updated text clearing logic to ensure it only occurs after successful focus.

These changes enhance the robustness of element interaction and improve debugging capabilities.
2025-08-29 18:22:43 -07:00
Magnus Müller 662a39742e Use existing method to get coordinates 2025-08-29 18:08:37 -07:00
Magnus Müller d80549038b Enhance element interaction handling
- Added logging for new elements detected during actions in the Agent class.
- Implemented a human-like text field clearing method in DefaultActionWatchdog, utilizing Ctrl+A and Backspace.
- Improved focus handling for label elements, ensuring they are only interactive if they do not have a 'for' attribute.
- Updated clickable element detection logic to account for labels pointing to inputs.

These changes improve the robustness of user interactions and enhance debugging capabilities.
2025-08-29 18:01:34 -07:00
Magnus Müller bb3055e7bb Emulate real human typing 2025-08-29 16:51:04 -07:00
Magnus Müller 7eb30f6842 Update browser_use/browser/watchdogs/downloads_watchdog.py
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-08-29 15:05:10 -07:00
Magnus Müller 8be1a17774 Fix dont reasign event in on_CloseTabEvent 2025-08-29 14:57:58 -07:00
Magnus Müller 1a31aefd38 Merge remote-tracking branch 'origin/main' into fix-tab-switching 2025-08-29 14:48:46 -07:00
Magnus Müller 9246ca1621 Remove init scrpt because it was not used 2025-08-29 14:39:12 -07:00
Magnus Müller babe510c30 When closing tabs, first check if we need to open a new one 2025-08-29 13:41:25 -07:00
jason 75759b49c0 Merge branch 'main' into fix/storage-watchdog-stop-monitoring 2025-08-29 15:56:57 -04:00
jason 8e48f6375c Merge branch 'main' into fix/cdp-viewport-initialization 2025-08-29 15:55:07 -04:00