Skip to content

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

Set is local to false by default

Magnus Müller0373511de684
diff --git a/browser_use/browser/profile.py b/browser_use/browser/profile.py
index 91e5289f1..72a53b33a 100644
--- a/browser_use/browser/profile.py
+++ b/browser_use/browser/profile.py
@@ -536,11 +536,10 @@ class BrowserProfile(BrowserConnectArgs, BrowserLaunchPersistentContextArgs, Bro
# Session/connection configuration
cdp_url: str | None = Field(default=None, description='CDP URL for connecting to existing browser instance')
- is_local: bool = Field(default=True, description='Whether this is a local browser instance')
+ is_local: bool = Field(default=False, description='Whether this is a local browser instance')
# label: str = 'default'
# custom options we provide that aren't native playwright kwargs
- stealth: bool = Field(default=False, description='Use stealth mode to avoid detection by anti-bot systems.')
disable_security: bool = Field(default=False, description='Disable browser security features.')
deterministic_rendering: bool = Field(default=False, description='Enable deterministic rendering flags.')
allowed_domains: list[str] | None = Field(
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.py
index 2ca218335..15dd31200 100644
--- a/browser_use/browser/session.py
+++ b/browser_use/browser/session.py
@@ -203,7 +203,6 @@ class BrowserSession(BaseModel):
# Access session fields directly, browser settings via profile or property
print(session.id) # Session field
- print(session.browser_profile.stealth) # Direct browser_profile access
```
"""
@@ -219,7 +218,7 @@ class BrowserSession(BaseModel):
# Core configuration
id: str | None = None,
cdp_url: str | None = None,
- is_local: bool = True,
+ is_local: bool = False,
browser_profile: BrowserProfile | None = None,
# BrowserProfile fields that can be passed directly
# From BrowserConnectArgs
@@ -252,7 +251,6 @@ class BrowserSession(BaseModel):
# From BrowserNewContextArgs
storage_state: str | Path | dict[str, Any] | None = None,
# BrowserProfile specific fields
- stealth: bool | None = None,
disable_security: bool | None = None,
deterministic_rendering: bool | None = None,
allowed_domains: list[str] | None = None,
@@ -273,6 +271,10 @@ class BrowserSession(BaseModel):
# Only pass non-None values to avoid validation errors
profile_kwargs = {k: v for k, v in locals().items() if k not in ['self', 'browser_profile', 'id'] and v is not None}
+ # if is_local is False but executable_path is provided, set is_local to True
+ if is_local is False and executable_path is not None:
+ profile_kwargs['is_local'] = True
+
# Create browser profile from direct parameters or use provided one
if browser_profile is not None:
# Merge any direct kwargs into the provided browser_profile (direct kwargs take precedence)
diff --git a/tests/ci/evaluate_tasks.py b/tests/ci/evaluate_tasks.py
index 6f06e5bbb..c02e15506 100644
--- a/tests/ci/evaluate_tasks.py
+++ b/tests/ci/evaluate_tasks.py
@@ -71,7 +71,6 @@ async def run_single_task(task_file):
headless=True,
user_data_dir=None,
chromium_sandbox=False, # Disable sandbox for CI environment (GitHub Actions)
- stealth=True, #
)
session = BrowserSession(browser_profile=profile)
print('[DEBUG] Browser session created', file=sys.stderr)