Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions openhands-tools/openhands/tools/browser_use/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,45 @@ def _check_chromium_available() -> str | None:
if path := shutil.which(binary):
return path

# Check common Windows installation paths
windows_chrome_paths = [
Path(os.environ.get("PROGRAMFILES", "C:\\Program Files"))
/ "Google"
/ "Chrome"
/ "Application"
/ "chrome.exe",
Path(os.environ.get("PROGRAMFILES(X86)", "C:\\Program Files (x86)"))
/ "Google"
/ "Chrome"
/ "Application"
/ "chrome.exe",
Path(os.environ.get("LOCALAPPDATA", ""))
/ "Google"
/ "Chrome"
/ "Application"
/ "chrome.exe",
Path(os.environ.get("PROGRAMFILES", "C:\\Program Files"))
/ "Microsoft"
/ "Edge"
/ "Application"
/ "msedge.exe",
Path(os.environ.get("PROGRAMFILES(X86)", "C:\\Program Files (x86)"))
/ "Microsoft"
/ "Edge"
/ "Application"
/ "msedge.exe",
]
for chrome_path in windows_chrome_paths:
if chrome_path.exists():
return str(chrome_path)

# Check Playwright-installed Chromium
playwright_cache_candidates = [
Path.home() / ".cache" / "ms-playwright",
Path.home() / "Library" / "Caches" / "ms-playwright",
Path.home() / ".cache" / "ms-playwright", # Linux
Path.home() / "Library" / "Caches" / "ms-playwright", # macOS
Path(os.environ.get("LOCALAPPDATA", "")) / "ms-playwright", # Windows
]

for playwright_cache in playwright_cache_candidates:
if playwright_cache.exists():
chromium_dirs = list(playwright_cache.glob("chromium-*"))
Expand Down
Loading