484 Commits

Author SHA1 Message Date
Magnus Müller 680d2551df Scroll element 2026-01-10 18:20:32 -08:00
Saurav Panda 2c06eabf5f Added ax-name fallback for history rerun. 2026-01-06 12:07:10 -08:00
Saurav Panda 07b7a6d8c0 fix: include shadow DOM form elements in selector_map even without snapshot data 2025-12-19 18:32:40 -08:00
mertunsall 1779e9717d improve hashing of elements using cascading hash 2025-12-17 00:55:27 -08:00
Saurav Panda e9c047be92 include ax_name for rerun history element hash 2025-12-16 17:05:48 -08:00
Cursor Agent 24e276d5f4 Refactor markdown preprocessing and add tests
Co-authored-by: mailmertunsal <mailmertunsal@gmail.com>
2025-12-11 00:00:21 +00:00
Mert Unsal fb8994de13 Revert "Fix: Ignore Inert Carousel Elements" 2025-11-15 23:05:21 -08:00
Mert Unsal b11682bfb5 Merge branch 'main' into Invisible-links 2025-11-15 18:59:55 -08:00
kalil0321 1c85a8a688 Fix lint 2025-11-13 15:49:43 +01:00
kalil0321 0988199776 Merge branch 'main' into kalil0321/demo-mode 2025-11-13 15:34:49 +01:00
reformedot 13868aee9b refactor: update all_frames parameter handling in DomService
- Changed the type of the all_frames parameter to allow for None, enabling lazy fetching of cross-origin iframes only when necessary.
- Updated comments to clarify the behavior of all_frames during DOM tree construction.
2025-11-12 20:05:01 -08:00
reformedot 77d7f161fb refactor: enhance session management and error handling in BrowserSession
- Improved the `create_task_with_error_handling` function to allow for better exception logging and retrieval based on the `suppress_exceptions` parameter.
- Updated `SessionManager` to implement event-driven recovery for stale agent focus, replacing polling with efficient event handling.
- Refactored session retrieval methods to ensure focus validation and recovery are handled automatically.
- Enhanced logging for recovery processes and session management to provide clearer insights into state changes and errors.
- Adjusted various watchdogs to utilize the new session management methods, ensuring they correctly handle focus validation and session retrieval.
2025-11-12 19:42:24 -08:00
reformedot bff596f2e7 refactor: remove target type caching and streamline target retrieval in session management
- Eliminated the caching of target types in SessionManager, simplifying the management of target information.
- Updated various components to directly access target types from the Target objects, enhancing clarity and reducing redundancy.
- Adjusted related methods in BrowserSession, CrashWatchdog, and DomService to reflect the changes in target type retrieval.
2025-11-12 15:19:34 -08:00
PredictiveManish 839c1412e2 Update: ClickableElementDetector.is_interactive to ignore elements marked inert or aria-hidden 2025-11-12 17:08:52 +05:30
reformedot 6859920d68 refactor: enhance timing breakdown in DOMWatchdog and DomService for improved performance insights
- Updated DOMWatchdog to provide a detailed hierarchical breakdown of timing metrics for various operations, improving clarity in performance logging.
- Enhanced DomService to calculate and log specific timing metrics for iframe scrolling, CDP calls, and snapshot processing, contributing to more accurate performance tracking.
2025-11-11 20:38:39 -08:00
reformedot 44045765b5 refactor: improve timing metrics in DOMWatchdog and DomService for enhanced performance tracking
- Updated DOMWatchdog to exclude specific sub-timings from total tracked time to avoid double-counting.
- Enhanced DomService to calculate and log overhead timings for both get_dom_tree and get_serialized_dom_tree operations, improving accuracy in performance metrics.
2025-11-11 20:12:52 -08:00
reformedot e766733ef4 refactor: enhance timing metrics in DomService for improved performance tracking 2025-11-11 19:51:54 -08:00
reformedot b4e9ffa984 refactor: implement error handling for asyncio tasks across various components
- Introduced a utility function `create_task_with_error_handling` to manage asyncio tasks with proper exception logging and suppression options.
- Updated multiple components, including `SessionManager`, `BrowserSession`, and various watchdogs, to utilize the new error handling mechanism for background tasks.
- Enhanced overall robustness of asynchronous operations by ensuring exceptions are logged and handled appropriately, improving maintainability and debugging capabilities.
2025-11-11 17:27:54 -08:00
reformedot 0282675ade refactor: implement lazy fetching for DOM tree construction
- Updated DOM tree retrieval methods to lazily fetch frame hierarchy only when necessary, improving performance for pages without cross-origin iframes.
- Adjusted method signatures to reflect optional frame fetching, enhancing flexibility in DOM service operations.
- Streamlined timing metrics by setting placeholders for timing logs, preparing for future performance enhancements.
2025-11-10 21:28:10 -08:00
reformedot 97420238c1 refactor: enhance DOM tree construction and timing metrics
- Updated DOM tree retrieval methods to include pre-fetched frame hierarchy, reducing redundant CDP calls and improving performance.
- Adjusted timing logs to provide detailed breakdowns of DOM tree construction, including total time and individual component timings.
- Removed commented-out code related to Python-based highlighting, streamlining the DOMWatchdog class.
- Reduced wait time in DOMWatchdog for page stability, enhancing responsiveness during DOM builds.
2025-11-10 20:53:23 -08:00
reformedot bf350bc4b0 refactor: update agent focus handling to use target ID consistently
- Replaced instances of `agent_focus` with `agent_focus_target_id` across various components to ensure consistent target management.
- Enhanced error handling and logging in `Watchdog` classes to reflect the new target ID approach.
- Improved session retrieval methods to streamline interactions with the `SessionManager`, ensuring better performance and reliability.
2025-11-10 14:29:50 -08:00
kalil0321 3f64178894 Implement demo mode for in-browser logging 2025-11-08 21:39:57 +01:00
Magnus Müller 5a4ebf7fe4 Date fix 2025-10-30 11:56:04 -07:00
Magnus Müller 4f9ba966cb Expected date format + scroll container 2025-10-30 11:32:27 -07:00
Magnus Müller 1467f35ac1 Improve file text 2025-10-30 10:36:51 -07:00
Magnus Müller 6a0b39c8f1 Fix date serilizer 2025-10-30 10:26:41 -07:00
Magnus Müller 22b0da2394 Serilizer fix 2025-10-30 10:01:44 -07:00
Magnus Müller cfeef1d031 Update browser_use/dom/serializer/serializer.py
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-10-30 00:55:32 -07:00
Magnus Müller f0c7e9787c Linter 2025-10-30 00:12:28 -07:00
Magnus Müller 3d892612c5 Always get ax value 2025-10-30 00:10:36 -07:00
Magnus Müller acac902a87 data-date-forma 2025-10-30 00:02:33 -07:00
Magnus Müller ff9c300b49 Include '' if attr none 2025-10-29 23:41:37 -07:00
Magnus Müller c4e69c2235 Add special handling for form elements in DOMTreeSerializer to prioritize current values from AX tree properties for inputs, textareas, and selects. 2025-10-29 23:36:28 -07:00
Magnus Müller 9cdd42f915 Improve dropdown 2025-10-29 22:55:05 -07:00
Magnus Müller a0a7f08f3f Show file input even if hidden 2025-10-29 21:19:22 -07:00
Magnus Müller f99efed294 More datapickers 2025-10-29 21:16:47 -07:00
Magnus Müller f1e3fbcd0c More forms for datepicker 2025-10-29 20:17:20 -07:00
Magnus Müller 8ee357495c Include accept 2025-10-29 20:01:11 -07:00
Magnus Müller a7203731bc Add date/time input format hints in DOMTreeSerializer
- Enhanced the DOMTreeSerializer to include standardized placeholder formats for date, time, datetime-local, month, and week input types. This ensures LLMs utilize the correct ISO 8601 formats while programmatically setting values, improving user experience and consistency in date/time handling.
- Removed unnecessary boolean attributes from the serialized output for cleaner attribute management.
2025-10-29 19:28:10 -07:00
Aitor 5682f4a993 Merge branch 'main' into feat/improve-session-manager 2025-10-29 02:27:23 +01:00
Magnus Müller 65da3ddd92 Debug logs 2025-10-27 17:33:42 -07:00
Magnus Müller 9cd948c7db Debug logs 2025-10-27 17:31:52 -07:00
Magnus Müller c3db6cff02 Refactor cross-origin iframe handling in tests and serializer
- Updated the DOMTreeSerializer to remove debug code related to cross-origin iframe detection, enhancing clarity and maintainability.
- Adjusted test cases to replace the cross-origin iframe source with a placeholder (about:blank) for improved test isolation and reliability.
- Updated comments and descriptions in tests to reflect the changes in iframe handling, ensuring accurate documentation of test behavior.

This change aims to streamline the handling of cross-origin iframes in both the serializer and tests, improving overall robustness and maintainability.
2025-10-27 17:19:03 -07:00
Magnus Müller f3c7070506 Refactor cross-origin iframe click test for improved clarity and functionality
- Updated test to verify clicking elements inside iframes in different CDP targets, enhancing the description for better understanding.
- Replaced the previous cross-origin iframe setup with a more controlled iframe content for testing.
- Adjusted assertions to ensure at least one element from the iframe is found, improving test reliability.
- Cleaned up comments and print statements for clarity, ensuring the test accurately reflects its purpose.

This change aims to enhance the robustness and maintainability of tests involving iframe interactions in the browser automation framework.
2025-10-27 17:14:30 -07:00
Magnus Müller 16d986a6d9 Remove debug code for cross-origin iframe detection in DOMTreeSerializer
- Eliminated debug logging related to clickable element detection for cross-origin iframes.
- Cleaned up unnecessary comments and code to streamline the function.
- This change aims to enhance code clarity and maintainability while ensuring that the clickable cache functionality remains intact.

Further investigation may be needed to address any remaining issues with detecting interactive elements within cross-origin iframes.
2025-10-27 00:01:46 -07:00
Magnus Müller 8557cffdd7 Remove debug logging from DOM serializer and clickable detector
- Removed all debug print statements for link detection
- Cleaned up empty if blocks left by debug removal
- Fixed indentation issues from automated cleanup
- All linter checks pass

Cross-origin iframe DOM extraction works but clickable elements
within cross-origin iframes are not being detected as interactive.
Further investigation needed to determine if this is a target
switching issue or element detection issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 23:29:35 -07:00
Magnus Müller 04e987df99 Add stacked DOM elements test for complex scenarios
- Introduced a new HTML template for testing stacked DOM elements, including open and closed shadow DOMs, same-origin and cross-origin iframes, and a final button.
- Implemented a test case to validate click functionality through these stacked elements, ensuring that all interactive elements are clickable and that the click counter reflects the expected number of clicks.
- Enhanced the browser session configuration to accommodate a taller window size for better visibility of stacked elements.

This update aims to improve the robustness of DOM interaction tests and ensure comprehensive coverage of complex scenarios in the browser automation framework.
2025-10-26 23:16:06 -07:00
reformedot 3a21ce805d fix: don't focus when generating DOMTree in _get_viewport_ratio 2025-10-26 06:42:10 -07:00
Magnus Müller f47cb6d511 Fix import 2025-10-24 00:06:41 -07:00
Magnus Müller 24ff856193 linter optimized 2025-10-23 23:29:19 -07:00