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 trustedTypes html and fallback test
Nick Sweeting932953683a51
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.pyindex 81b2048f5..b96218a69 100644--- a/browser_use/browser/session.py+++ b/browser_use/browser/session.py@@ -3905,7 +3905,7 @@ class BrowserSession(BaseModel):// Add a little CSS for smoothnessconst style = document.createElement('style');- style.innerHTML = `+ style.textContent = `#pretty-loading-animation {/*backdrop-filter: blur(2px) brightness(0.9);*/}diff --git a/tests/ci/test_browser_session_start.py b/tests/ci/test_browser_session_start.pyindex 986b0a249..260059483 100644--- a/tests/ci/test_browser_session_start.py+++ b/tests/ci/test_browser_session_start.py@@ -547,9 +547,12 @@ class TestBrowserSessionStart:),)- # open chrome with corrupted user_data_dir- with pytest.raises(Exception, match='Failed parsing extensions'):- await chromium_session.start()+ # open chrome with corrupted user_data_dir - should now fallback to temp dir instead of crashing+ await chromium_session.start()+ # Check that it fell back to a temporary directory+ assert chromium_session.browser_profile.user_data_dir != '~/.config/browseruse/profiles/stealth'+ assert 'browseruse-tmp-' in str(chromium_session.browser_profile.user_data_dir)+ await chromium_session.stop()class TestBrowserSessionReusePatterns: