- Updated the instantiation of `DomService` to include `cross_origin_iframes` parameter from the browser session profile, improving its configuration for handling cross-origin iframes.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- Add on_TabCreatedEvent handler to BrowserSession to apply viewport settings
- Update _cdp_set_viewport to accept optional target_id parameter
- All tabs (initial and new) now get viewport through unified event handler
This ensures consistent viewport configuration across all tabs when
viewport is explicitly set in the browser profile, while respecting
the natural window sizing when viewport is not configured.
Implements _cdp_get_origins() method to capture localStorage and sessionStorage
using cdp-use's typed DOMStorage client. This enables proper session
persistence for applications that store authentication tokens in browser storage
rather than cookies.
- Adds _cdp_get_origins() to enumerate all frames and extract unique origins
- Uses cdp-use's DOMStorage.getDOMStorageItems to retrieve localStorage/sessionStorage
- Updates _cdp_get_storage_state() to include origins in storage state
- Handles errors gracefully with debug logging for individual storage failures
- Uses try-finally to ensure DOMStorage is properly disabled even on errors
- Encapsulates storage extraction logic in helper functions for clarity
- Add BrowserStopEvent handler to properly stop monitoring when browser closes
- Await LoadStorageStateEvent dispatch to ensure storage is loaded before navigation
- Clean up monitoring task on browser stop to prevent CDP connection errors
This ensures storage state is properly loaded before the browser starts navigating
and prevents error logs from monitoring attempts after the browser has closed.