Commit Graph

504 Commits

Author SHA1 Message Date
Magnus Müller 30eb8fe36f Linter 2025-09-17 11:07:05 -07:00
Magnus Müller ca469caa31 The __hash__ method inefficiently recreates the static_attributes set on every call. 2025-09-17 11:06:31 -07:00
Magnus Müller 5d6c199f4f Update browser_use/dom/views.py
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-09-17 11:04:31 -07:00
Magnus Müller 48c75ffd3d Update browser_use/dom/views.py
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-09-17 11:04:23 -07:00
Saurav Panda e0eb26ed58 Merge branch 'main' into add-baas-support 2025-09-17 09:58:20 -07:00
Magnus Müller 40ce0d382d Enhance static attributes list in EnhancedDOMTreeNode for improved DOM serialization 2025-09-17 09:51:34 -07:00
Magnus Müller 9618835c97 fix element hash 2025-09-17 09:48:17 -07:00
Magnus Müller d63292b3f2 Fix bounds handling in DOMInteractedElement to return None if bounds are not set; ensure proper closure of agent service after execution. 2025-09-16 22:38:49 -07:00
Saurav Panda 85a2386c91 feat: added cloud_browser feature 2025-09-16 22:27:45 -07:00
Magnus Müller 064c5ba016 Fix rerun with inital actions 2025-09-16 21:46:45 -07:00
Gregor Žunič 11d37dd68d v1 actor 2025-09-15 17:12:31 -07:00
Gregor Žunič 893d1ad2b9 removed hardcoded max iframe recursion limit 2025-09-08 20:05:02 -07:00
Magnus Müller 661bb46b9e Increase default 2025-09-08 08:28:39 -07:00
Magnus Müller dc0c18f55d linter 2025-09-08 08:18:47 -07:00
Magnus Müller 700910126a make iframe depth variable 2025-09-08 08:17:15 -07:00
Gregor Žunič 05408613b9 Merge branch 'main' into feature/paint-order-filtering 2025-09-07 21:07:19 -07:00
Gregor Žunič e793376f34 step 2 <-> step 3 2025-09-07 20:57:56 -07:00
Gregor Žunič c2eede8e20 paint order filtering 2025-09-07 20:56:48 -07:00
Magnus Müller 3dcd3c4b02 Update default cross-origin iframe setting to False and adjust tree serialization depth handling 2025-09-07 19:35:21 -07:00
Magnus Müller 9edfdfa683 Update comment 2025-09-06 13:00:46 -07:00
Magnus Müller 016a1709de Refactor iframe dimension retrieval in DomService
- Updated the method of accessing iframe dimensions from dictionary-style to attribute-style for improved clarity and consistency.
- Ensured that width and height are directly accessed as properties of the bounds object.
2025-09-06 12:44:34 -07:00
Magnus Müller ff27735392 Refactor logging statements in DomService for improved readability
- Updated logging statements to use multi-line formatting for better clarity.
- Ensured consistent spacing and formatting throughout the service to enhance code maintainability.
2025-09-06 12:39:02 -07:00
Magnus Müller 66fc319938 Merge commit 'af5b4400cd31644d06590ce5bcd0c19ac4ef35dd' into iframe-limits 2025-09-06 12:36:26 -07:00
Magnus Müller 629a4d6ed1 Refactor computed styles in enhanced_snapshot.py to include only essential styles used in the codebase, reducing potential crashes on heavy sites. Update service.py to reflect the change, noting that only 9 styles are now actively used for snapshot requests. 2025-09-05 00:12:44 -07:00
Magnus Müller 64bb6bdc11 Enhance snapshot lookup by preserving the first occurrence of duplicate node indices in layout index map. This change optimizes the processing of layout data while maintaining original behavior. 2025-09-04 23:30:39 -07:00
Magnus Müller a7f7417506 Refactor DOM processing by removing unnecessary logging and optimizing task handling. Streamlined snapshot lookup and accessibility tree processing for improved performance and clarity. Enhanced error handling for CDP requests, ensuring better management of task failures and timeouts. 2025-09-04 23:14:40 -07:00
Magnus Müller d0685dc970 Refactor DOM snapshot processing by removing viewport bounds handling and optimizing logging. Updated snapshot lookup to process all elements without early filtering, enhancing clarity and performance metrics. Adjusted computed styles handling for consistency. 2025-09-04 19:22:05 -07:00
Magnus Müller 6b119e033c Refactor DOM snapshot processing to retain full computed styles for quality. Updated accessibility tree processing to include all frames, leveraging layout index map for performance optimization. Removed outdated performance notes regarding style reduction. 2025-09-04 19:17:31 -07:00
Magnus Müller f2ab1b3537 Optimize DOM snapshot processing and viewport handling. Reduced computed styles from 19 to 8 for performance improvement. Implemented viewport bounds with a ±2000px buffer to enhance filtering of elements during snapshot lookups. Added logging for performance metrics and task completion times to aid in debugging and optimization. Updated accessibility tree processing to skip out-of-viewport frames, further reducing processing time. 2025-09-04 19:12:31 -07:00
Magnus Müller a652335316 Remove outdated methods 2025-08-31 11:31:32 -07:00
Gregor Žunič b141034ff3 Merge branch 'main' into c/better-frameset-detection 2025-08-30 11:15:58 -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
Gregor Žunič 3d8e00f0b0 added FRAME to everywhere where we have IFRAME 2025-08-29 21:04:50 -07:00
Gregor Žunič 0913a8a345 fixed FRAME elements 2025-08-29 20:51:39 -07:00
Magnus Müller 1ac519e98f Typos 2025-08-29 18:25:16 -07:00
Magnus Müller b012d21de3 Refine clickable element detection logic
- Enhanced the tag check to include truly interactive elements.
- Removed special handling for 'label' elements, as they are now managed by other attribute checks to prevent interference with clickable elements.

These updates improve the accuracy of interactive element detection in the DOM serializer.
2025-08-29 18:05:32 -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 9dd5b27c1f Logs 2025-08-29 11:25:25 -07:00
Magnus Müller 82b241ddbb Linter new line 2025-08-26 18:13:11 -07:00
Nick Sweeting e725edb62a cross-origin iframes on by default with depth limits 2025-08-22 19:42:18 -07:00
Nick Sweeting 4c93f39a49 cleanup test file naming 2025-08-22 16:06:47 -07:00
Nick Sweeting 5668ab3f9b move cross-origin iframe option to instance attr instead of hardcoded global 2025-08-22 16:05:17 -07:00
Magnus Müller ecbf1ba7a9 Update browser_use/dom/debug/highlights.py
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-08-19 01:28:37 -07:00
Magnus Müller 6cc2f8c5fb remove specific city logs 2025-08-18 23:07:26 -07:00
Magnus Müller c1331604c7 Remove print 2025-08-18 23:00:18 -07:00
Gregor Žunič 1c8789b8ef fixed highlights z index 2025-08-17 16:34:00 -07:00
Nick Sweeting 76512fbfdd fix Failed to build DOM tree: cannot reuse already awaited coroutine 2025-08-16 17:58:45 -07:00
Nick Sweeting b2c20e8b27 fix cubic mrge notes 2025-08-16 16:35:47 -07:00
Nick Sweeting 8d86832095 fix SwitchTab by using TargetID for all tab_ids 2025-08-15 16:45:27 -07:00
Nick Sweeting 2958c0baf6 fix viewportsize import 2025-08-15 12:50:34 -07:00