Commit Graph

656 Commits

Author SHA1 Message Date
Saurav Panda 85a2386c91 feat: added cloud_browser feature 2025-09-16 22:27:45 -07:00
Gregor Žunič 101d4d1c36 more switches to snake_case 2025-09-16 20:15:27 -07:00
Gregor Žunič 5e05224ffb switched to browsersession input 2025-09-15 21:25:32 -07:00
Gregor Žunič e0f65ca892 v2 2025-09-15 21:11:46 -07:00
avocardio c7dcb668bc fix: more lint errors 2025-09-08 09:47:07 -07:00
avocardio 9ce8416b50 fix: Use Path.write_bytes() to avoid SYNC230 lint error 2025-09-08 09:37:53 -07:00
avocardio 3336b9d55f feat: Add enhanced screenshot API 2025-09-08 09:14:32 -07:00
Magnus Müller 700910126a make iframe depth variable 2025-09-08 08:17:15 -07:00
Gregor Žunič c2eede8e20 paint order filtering 2025-09-07 20:56:48 -07:00
Magnus Müller 2b1ee8715e enable StorageStateWatchdog if user_data_dir provided 2025-09-06 13:11:32 -07:00
Magnus Müller e7ade83f4f Merge commit 'd58d2872c5ef9367e606dd155331bde3456de5ed' into feat/cdp-add-origins-storage-state 2025-09-06 13:02:25 -07:00
Magnus Müller be6fd1a92e Add video recording configuration options to BrowserSession
- Introduced `record_video_framerate` and `record_video_size` parameters to the BrowserSession class for enhanced video recording capabilities.
- Updated example in video_recording.py to reflect changes, switching from BrowserSession to Browser for video recording setup.

This update allows users to customize video recording settings more effectively.
2025-09-06 12:29:19 -07:00
Enzo Biondo 1da79ca982 Merge branch 'main' into feat/video-recording 2025-09-06 14:43:33 -03:00
Magnus Müller d7969c1a93 Merge branch 'main' into fix/cdp-viewport-initialization 2025-09-06 04:05:16 -07:00
r c92ae8269b Remove unused screenshot constants
Removed MAX_SCREENSHOT_HEIGHT and MAX_SCREENSHOT_WIDTH constants that were not being used anywhere in the codebase.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-06 18:00:23 +09:00
Magnus Müller 37c177e840 reduce frequency_penalty 2025-08-31 14:19:39 -07:00
Magnus Müller a915a0b95c Refactor navigate_to function and update tool descriptions for improved clarity and efficiency. 2025-08-31 13:50:54 -07:00
Magnus Müller 37573edd2e navigate_to function 2025-08-31 12:34:38 -07:00
Magnus Müller 33f69b1525 less-timeouts 2025-08-31 11:18:47 -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
Magnus Müller ce0876adb7 highlight in parallel 2025-08-29 22:17:50 -07:00
Magnus Müller 4a62fe11f9 More logging 2025-08-29 21:42:14 -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 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 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
jason a8b4b034c1 Merge branch 'main' into fix/cdp-viewport-initialization 2025-08-29 22:22:13 -04:00
Magnus Müller 8be1a17774 Fix dont reasign event in on_CloseTabEvent 2025-08-29 14:57:58 -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
Magnus Müller 4c10628ff2 Dont open new tab, if we are already inside a new tab 2025-08-29 11:35:02 -07:00
jason 98095d3d0d Update browser_use/browser/session.py
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-08-28 20:33:15 -04:00
jtanningbed f38555e418 fix: apply viewport settings via TabCreatedEvent handler
- 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.
2025-08-28 18:20:17 -04:00
jtanningbed 5d71fc060b feat: add CDP implementation for capturing localStorage/sessionStorage
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
2025-08-28 16:43:10 -04:00
Magnus Müller c969b956d6 Logger statement 2025-08-27 17:24:59 -07:00
Magnus Müller 21febf82ad Check for highlight_elements flag 2025-08-27 16:41:13 -07:00
Magnus Müller 78049eee07 Remove 0.5 s waiting in navigation 2025-08-27 12:26:59 -07:00
Magnus Müller e07c229104 Skip switch tab 2025-08-27 12:13:08 -07:00
Magnus Müller 11a50db4fb hot-fix-local-true-if-no-cdp-url 2025-08-27 11:01:20 -07:00
Enzo Biondo d6d5fd0fb6 Merge branch 'main' into feat/video-recording 2025-08-27 14:47:05 -03:00
Magnus Müller 0373511de6 Set is local to false by default 2025-08-27 10:08:17 -07:00
Magnus Müller 0ec47ecd3d Raise error if browser start fails 2025-08-26 21:26:04 -07:00
Magnus Müller 78cb7e5466 Remove 25 unused parameters 2025-08-26 16:19:53 -07:00
EnzoFanAccount 06d0b1e9ba Merge remote-tracking branch 'upstream/main' into feat/video-recording 2025-08-26 18:37:14 -03:00
Magnus Müller 29685aa7ce Merge remote-tracking branch 'origin/main' into rename-controller-to-tools 2025-08-26 13:58:21 -07:00
Magnus Müller 325e5f3fcd hot-fix cdp-url unused 2025-08-26 12:53:42 -07:00
Magnus Müller caa0e7ef1b Rename controller to tools instances 2025-08-26 11:30:39 -07:00
EnzoFanAccount a41bd90f05 Merge remote-tracking branch 'upstream/main' into feat/video-recording 2025-08-26 03:25:56 -03:00
Magnus Müller 505a103aa3 Browser import works 2025-08-25 21:16:30 -07:00
Magnus Müller 21f4a80c13 Cdp url on profile and session 2025-08-25 18:39:32 -07:00