Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

fix bubus issue

Nick Sweetingcc2d9359d34d
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.py
index bcc0282e5..f3c7d201f 100644
--- a/browser_use/browser/session.py
+++ b/browser_use/browser/session.py
@@ -1726,9 +1726,9 @@ class BrowserSession(BaseModel):
current_page = await self.get_current_page()
tab_index = self.get_tab_index(current_page) if current_page else 0
- # Dispatch the event and await the result
+ # Dispatch the event and await the result with timeout
event = self.event_bus.dispatch(ExecuteJavaScriptEvent(tab_index=tab_index, expression=script))
- result = await event.event_result()
+ result = await event.event_result(timeout=1.5)
return result
async def get_scroll_info(self, page: Page) -> tuple[int, int]:
diff --git a/pyproject.toml b/pyproject.toml
index 0db05e9bc..67e924bda 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -13,7 +13,7 @@ classifiers = [
dependencies = [
"aiofiles>=24.1.0",
"anyio>=4.9.0",
- "bubus>=1.5.0",
+ "bubus>=1.5.1",
"google-api-core>=2.25.0",
"httpx>=0.28.1",
"markdownify==1.1.0",
diff --git a/tests/ci/test_browser_session_storage_state.py b/tests/ci/test_browser_session_storage_state.py
index db8f56ec1..e39c2bfcb 100644
--- a/tests/ci/test_browser_session_storage_state.py
+++ b/tests/ci/test_browser_session_storage_state.py
@@ -77,7 +77,7 @@ class TestBrowserSessionStorageState:
yield session
# Cleanup
try:
- await session.start()
+ await session.stop()
except Exception:
pass
diff --git a/tests/ci/test_navigation_watchdog.py b/tests/ci/test_navigation_watchdog.py
index c86239e95..cad82a8a2 100644
--- a/tests/ci/test_navigation_watchdog.py
+++ b/tests/ci/test_navigation_watchdog.py
@@ -58,7 +58,7 @@ async def test_navigation_watchdog_tab_created_events():
# Verify the events have different tab indices (unless they're reusing the same tab)
unique_tab_indexes = {event.tab_index for event in tab_created_events}
- assert len(unique_tab_indexes) >= 2, 'Should have at least two unique tab indices'
+ assert len(unique_tab_indexes) >= 2, 'Should have at least two unique tab indices'
finally:
# Stop browser