Commit Graph

1581 Commits

Author SHA1 Message Date
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
LarsenCundric a3e1ed7274 Skip if none 2025-11-12 22:24:56 -08:00
mertunsall 1f758178da log too much 2025-11-12 21:20:49 -08:00
Aitor c662b29b31 Merge branch 'main' into feat/improve-navigation 2025-11-13 05:37:09 +01:00
mertunsall a2e81f17d7 more logging 2025-11-12 20:28:23 -08:00
reformedot b741c429d7 refactor: streamline event handling in BrowserSession
- Adjusted the structure of event handling for 'networkIdle' and 'load' events to improve readability and maintainability.
- Ensured that logging for page readiness is consistently executed within the event handling logic.
2025-11-12 20:02:38 -08:00
reformedot 78042d56a5 refactor: enhance error handling in DOMWatchdog tasks
- Updated the `create_task_with_error_handling` calls in `DOMWatchdog` to include the `suppress_exceptions` parameter, improving error management during DOM tree building and screenshot capturing.
- This change allows for better handling of exceptions without interrupting the flow of task execution.
2025-11-12 19:59:39 -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 91e82ae85e chore: update cdp-use dependency version and increase max WebSocket frame size in BrowserSession
- Updated cdp-use dependency to version 1.4.4 for improved functionality.
- Increased max WebSocket frame size to 200MB in BrowserSession to accommodate large DOMs.
2025-11-12 18:00:14 -08:00
reformedot 060ab445a9 refactor: streamline target validation in BrowserSession 2025-11-12 16:44:07 -08:00
reformedot 74775cab9a refactor: update target discovery to include iframe types in session management 2025-11-12 16:12:22 -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
reformedot cca0ad034f refactor: streamline comments and remove unused method in session.py
- Simplified comments in session.py for clarity and conciseness.
- Removed the unused `disconnect` method from the CDPSession class.
- Updated references to session management in downloads_watchdog.py for consistency.
2025-11-12 10:48:16 -08:00
reformedot 07ec978100 refactor: simplify comment in downloads_watchdog.py for clarity 2025-11-12 10:09:56 -08:00
reformedot 352c1fdfe7 fix: correct indentation in popups_watchdog.py for improved readability 2025-11-12 10:01:34 -08:00
reformedot e9656f7e0e chore: improved timing logging 2025-11-11 20:42:32 -08:00
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
Aitor 461d8592b1 Merge branch 'main' into feat/improve-navigation 2025-11-12 04:32:27 +01: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
Mert Unsal 5b0a6bb203 Merge branch 'main' into mert/warnings 2025-11-11 16:07:02 -08:00
mertunsall 699d14c968 change to warnings 2025-11-11 16:06:25 -08:00
reformedot 2de09c1e53 refactor: streamline tab switching and navigation handling in BrowserSession
- Consolidated tab switching logic to improve clarity and reduce redundancy in the `on_NavigateToUrlEvent` method.
- Enhanced logging for tab switching and navigation events to provide better insights during debugging.
- Ensured proper lifecycle handling during navigation, including closing extension options pages and dispatching navigation events consistently.
2025-11-11 12:28:09 -08:00
reformedot c99e1bb41f refactor: improve type checking and linting script
- Updated `pyproject.toml` to enhance type checking configuration by refining the `exclude` list and adding an `include` section for better clarity.
- Modified `lint.sh` to run tools directly from the virtual environment, improving execution reliability and avoiding permission errors.
- Enhanced comments in `lint.sh` for better understanding of script functionality and usage.
2025-11-11 12:00:20 -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 7a31936f5d refactor: simplify session retrieval methods in SessionManager and BrowserSession
- Changed `get_session_for_target` in `SessionManager` from async to sync, improving performance by removing unnecessary locking.
- Updated all references in `BrowserSession` and related watchdogs to use the new synchronous method for session retrieval.
- Enhanced readability and consistency across session management logic, ensuring a more streamlined approach to handling sessions.
2025-11-10 19:07:01 -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
reformedot d39ed5869c fix: ensure target URL is correctly handled in focus change events
- Updated focus change event dispatch in `SessionManager` to use a fallback URL ('about:blank') when the target is not found, preventing potential errors.
- Modified `BrowserSession` to exclude the `session_manager` from serialization, ensuring cleaner data handling.
2025-11-10 14:09:23 -08:00
reformedot 043897c665 refactor: enhance session and target management in SessionManager
- Introduced a new `Target` class to represent browser targets, separating target properties from session management.
- Updated `SessionManager` to maintain a single source of truth for all targets and sessions, improving data integrity.
- Refactored session retrieval methods to ensure consistent access to sessions and targets, enhancing performance and readability.
- Improved logging for session and target operations, providing clearer insights into state changes and actions.
2025-11-10 13:59:43 -08:00
reformedot eb63257eee refactor: streamline logging and remove redundant timing checks 2025-11-10 11:57:27 -08:00
mertunsall ddc74d217f remove useless logging 2025-11-08 23:01:41 -08:00
YangQuan 1405ab1978 Merge branch 'main' into main 2025-11-09 09:38:03 +08:00
Sandeep Salwan d992f48bb4 Merge branch 'main' into fix-minimal-issue-7JLZB 2025-11-08 18:23:51 -05:00
kalil0321 6a828ed98f Update demo mode to use textContent for message rendering, enhancing security by preventing HTML injection. 2025-11-08 21:52:06 +01:00
kalil0321 3f64178894 Implement demo mode for in-browser logging 2025-11-08 21:39:57 +01:00
mertunsall d06d8fa8a2 image resizing the make sonnet 4.5 work 2025-11-07 22:20:14 -08:00
reformedot bcd88c21c2 refactor: optimize session handling and logging
- Removed redundant responsiveness checks and improved timing logs in `BrowserSession`.
- Updated focus change logic to retrieve target type from `SessionManager`, reducing CDP calls.
- Enhanced `DownloadsWatchdog` to obtain target URL directly from session data, improving efficiency.
2025-11-07 16:57:28 -08:00
reformedot e64edf82d6 chore: added timing logs 2025-11-07 16:13:58 -08:00
reformedot 0b89bfd7ba feat: add method to retrieve all page sessions and refactor navigation logic
- Introduced `get_all_page_sessions` method in `SessionManager` to fetch all active page/tab sessions.
- Updated `BrowserSession` to utilize the new method for improved navigation and tab management, enhancing performance and readability.
- Refactored related navigation event handling to leverage cached session data instead of direct CDP calls.
2025-11-07 13:09:34 -08:00
reformedot af9123edd4 fix: fixed lifecycle event monitoring 2025-11-07 11:10:23 -08:00
Aitor e0e6491c5d Merge branch 'main' into feat/improve-navigation 2025-11-07 19:33:03 +01:00
reformedot 813e5e3589 fix: fixed navigation events check 2025-11-07 10:29:54 -08:00
reformedot 984a8c678b feat: enhance session management with target discovery and event handling
- Enabled target discovery to automatically receive targetInfoChanged events, reducing the need for polling.
- Added event handler for targetInfoChanged to update session title and URL dynamically.
- Improved initialization of existing targets to ensure monitoring readiness without race conditions.
- Updated navigation logic to utilize cached session data for faster access to target information.
2025-11-07 10:20:11 -08:00
reformedot 027fae6c23 fix: improved session manager 2025-11-06 21:10:26 -08:00
reformedot 62c0495ef0 fix: enable page monitoring on already existing targets 2025-11-06 17:53:56 -08:00
Mert Unsal 38fb9faaa4 Merge branch 'main' into mert/click_by_coordinate 2025-11-06 16:54:11 -08:00
kalil0321 103bd46677 Merge branch 'main' into attempt-fix-real-browser 2025-11-07 01:33:14 +01:00
kalil0321 31b02161c5 Merge branch 'kalil0321/har_watchdog' of https://github.com/kalil0321/browser-use into kalil0321/har_watchdog 2025-11-07 01:31:31 +01:00
kalil0321 926e88c523 Cubic issues 2025-11-07 01:30:30 +01:00