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
fix: prevent unnecessary blank tab creation when closing background tabs
SK Akram948f51b4db40
diff --git a/browser_use/browser/watchdogs/aboutblank_watchdog.py b/browser_use/browser/watchdogs/aboutblank_watchdog.pyindex 3d950ab8f..e38d148f5 100644--- a/browser_use/browser/watchdogs/aboutblank_watchdog.py+++ b/browser_use/browser/watchdogs/aboutblank_watchdog.py@@ -69,7 +69,7 @@ class AboutBlankWatchdog(BaseWatchdog):# Check if we're about to close the last tab (event happens BEFORE tab closes)# Use _cdp_get_all_pages for quick check without fetching titlespage_targets = await self.browser_session._cdp_get_all_pages()- if len(page_targets) <= 1:+ if len(page_targets) < 1:self.logger.debug('[AboutBlankWatchdog] Last tab closing, creating new about:blank tab to avoid closing entire browser')