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
Rename setup page title
Magnus Müllerbb650b002da8
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.pyindex 60c2c3ba0..7a25e11d4 100644--- a/browser_use/browser/session.py+++ b/browser_use/browser/session.py@@ -3106,7 +3106,7 @@ class BrowserSession(BaseModel):# if there are any unused about:blank tabs after we open a new tab, close them to clean up unused tabsassert self.browser_context is not None, 'Browser context is not set'# hacky way to be sure we only close our own tabs, check the title of the tab for our BrowserSession name- title_of_our_setup_tab = f'Setting up #{str(self.id)[-4:]}...' # set up by self._show_dvd_screensaver_loading_animation()+ title_of_our_setup_tab = f'Start page {str(self.id)[-4:]}' # set up by self._show_dvd_screensaver_loading_animation()for page in self.browser_context.pages:page_title = await page.title()if page.url == 'about:blank' and page != self.agent_current_page and page_title == title_of_our_setup_tab:@@ -3273,7 +3273,7 @@ class BrowserSession(BaseModel):# between opening the tab and showing the animationawait page.evaluate("""(browser_session_label) => {- const animated_title = `Setting up #${browser_session_label}...`;+ const animated_title = `Start page id ${browser_session_label}`;if (document.title === animated_title) {return; // already run on this tab, dont run again}