Commit Graph

1437 Commits

Author SHA1 Message Date
Saurav Panda a2e40c7980 Merge branch 'main' into fix-disable-security-bug 2025-08-29 12:44:44 -07:00
Saurav Panda 34a69a0acb fix: add highlighting condition check for disable_security browser profile setting 2025-08-29 11:58:51 -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
Magnus Müller 9dd5b27c1f Logs 2025-08-29 11:25:25 -07:00
Magnus Müller 9915ea41a9 Remove 📍 from logs 2025-08-29 11:02:50 -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
Saurav Panda 601105fa4a ix: prevent disable_security from breaking browser extensions 2025-08-28 16:17:16 -07: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
Andrei Gheorghe c16726433c Allow override of timeouts from env variables 2025-08-27 22:39:58 -07:00
jtanningbed 0d61c52c11 fix: improve StorageStateWatchdog lifecycle management
- 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.
2025-08-28 01:31:56 -04:00
Magnus Müller c969b956d6 Logger statement 2025-08-27 17:24:59 -07:00
Magnus Müller efb2f8bfae Autopdf download to false 2025-08-27 17:21:35 -07:00
Magnus Müller 21febf82ad Check for highlight_elements flag 2025-08-27 16:41:13 -07:00
Magnus Müller 0dd27ca976 Remove js in downloadwatchdog 2025-08-27 16:37:17 -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
EnzoFanAccount d354c0eb9f linting 2025-08-27 15:13:33 -03:00
EnzoFanAccount 8136d029d6 formatting 2025-08-27 15:02:40 -03: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 08f8fbc499 Refactor DOMWatchdog event retrieval and update tests for improved reliability
- Changed `_get_recent_events_str` method in `dom_watchdog.py` to return recent events as JSON instead of CSV, enhancing data structure and usability.
- Updated tests in `test_browser_event_ClickElementEvent.py`, `test_browser_event_NavigateToUrlEvent.py`, and others to reflect changes in event handling and improve error handling.
- Marked several tests as skipped due to known issues, ensuring clarity in test results.
2025-08-26 22:59:07 -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
Aitor e61a7bf9a5 Merge branch 'main' into fix/fix-remote-browser-downloads 2025-08-26 21:11:54 +01: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
Magnus Müller 13dd73b23a Update Tool imports in docs, readme, and docstrings 2025-08-26 11:13:27 -07:00
reformedot 4946df6183 chore: merge main 2025-08-26 11:42:08 +01:00
EnzoFanAccount 47fa26a8bb Merge branch 'feat/video-recording' of https://github.com/EnzoFanAccount/browser-use into feat/video-recording 2025-08-26 03:26:51 -03: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 3ef2d83c12 browser docs 2025-08-25 20:11:31 -07:00
Magnus Müller 9bd8796833 move cdp url in profile 2025-08-25 19:32:05 -07:00
Magnus Müller 21f4a80c13 Cdp url on profile and session 2025-08-25 18:39:32 -07:00
Magnus Müller 3f8156fe2b Replicate profile parameters in session 2025-08-25 18:19:01 -07:00
Nick Sweeting e725edb62a cross-origin iframes on by default with depth limits 2025-08-22 19:42:18 -07:00
Enzo Biondo 9c56817a7c Update comment
Co-authored-by: Nick Sweeting <github@sweeting.me>
2025-08-22 20:44:14 -03:00
EnzoFanAccount 53cba74b82 Merge remote-tracking branch 'upstream/main' into feat/video-recording 2025-08-22 20:43:14 -03: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
Nick Sweeting 720635f8f5 tweak logging to use target id everywhere consistently instead of python id of page obj 2025-08-22 16:04:20 -07:00
Nick Sweeting 8c52b5f46a extra TODO comments 2025-08-22 14:50:34 -07:00
EnzoFanAccount e629eec480 add frame resizing 2025-08-22 16:41:08 -03:00
EnzoFanAccount 49ee1a7a7b add video recording 2025-08-22 12:13:46 -03:00
reformedot be2d07b16c Merge branch 'main' into fix/fix-remote-browser-downloads 2025-08-22 13:07:51 +01:00
Nick Sweeting f08001581f fix variable scoping in downloads watchdog 2025-08-21 17:33:24 -07:00