Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Updated CDP client initialization and remove old compatibility fallback
Utkarsh4b88d876c0ea
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.pyindex d942a70d7..f12ddb0b8 100644--- a/browser_use/browser/session.py+++ b/browser_use/browser/session.py@@ -1497,18 +1497,12 @@ class BrowserSession(BaseModel):try:# Create and store the CDP client for direct CDP communication- # Try with max_ws_frame_size first (for newer cdp-use versions)- # Fall back to without it if the parameter is not supported- try:- self._cdp_client_root = CDPClient(- self.cdp_url, max_ws_frame_size=200 * 1024 * 1024- ) # Use 200MB limit to handle pages with very large DOMs- except TypeError:- # Older cdp-use versions don't support max_ws_frame_size parameter- self.logger.debug('CDPClient does not support max_ws_frame_size, using default')- self._cdp_client_root = CDPClient(self.cdp_url)+ self._cdp_client_root = CDPClient(+ self.cdp_url, max_ws_frame_size=200 * 1024 * 1024+ ) # Use 200MB limit to handle pages with very large DOMsassert self._cdp_client_root is not Noneawait self._cdp_client_root.start()+# Initialize event-driven session manager FIRST (before enabling autoAttach)# SessionManager will: