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
check platform at startup
Nick Sweetingb5ec945b7458
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex 699cb83c3..f4370cf84 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -6,6 +6,7 @@ import inspectimport jsonimport loggingimport os+import platformimport reimport timefrom pathlib import Pathdiff --git a/browser_use/utils.py b/browser_use/utils.pyindex 92f8296cc..f70491870 100644--- a/browser_use/utils.py+++ b/browser_use/utils.py@@ -1,6 +1,7 @@import asyncioimport loggingimport os+import platformimport signalimport timefrom functools import wraps@@ -27,6 +28,7 @@ class SignalHandler:- Support for custom pause/resume callbacks- Management of event loop state across signals- Standardized handling of first and second Ctrl+C presses+ - Cross-platform compatibility (with simplified behavior on Windows)"""def __init__(@@ -56,6 +58,7 @@ class SignalHandler:self.custom_exit_callback = custom_exit_callbackself.exit_on_second_int = exit_on_second_intself.interruptible_task_patterns = interruptible_task_patterns or ['step', 'multi_act', 'get_next_action']+ self.is_windows = platform.system() == 'Windows'# Initialize loop state attributesself._initialize_loop_state()