mirror of
https://github.com/browser-use/browser-use
synced 2026-04-22 17:45:09 +02:00
close alias for BrowserSession stop (#4665)
thousands of users have attempted to use close, so why not add it
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds `close()` to `BrowserSession` as an alias for `stop()`, so
`session.close()` cleanly stops the session and matches common APIs.
<sup>Written for commit 76604913ad.
Summary will update on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
This commit is contained in:
@@ -721,6 +721,10 @@ class BrowserSession(BaseModel):
|
||||
# Create fresh event bus
|
||||
self.event_bus = EventBus()
|
||||
|
||||
async def close(self) -> None:
|
||||
"""Alias for stop()."""
|
||||
await self.stop()
|
||||
|
||||
@observe_debug(ignore_input=True, ignore_output=True, name='browser_start_event_handler')
|
||||
async def on_BrowserStartEvent(self, event: BrowserStartEvent) -> dict[str, str]:
|
||||
"""Handle browser start request.
|
||||
|
||||
Reference in New Issue
Block a user