mirror of
https://github.com/browser-use/browser-use
synced 2026-04-22 17:45:09 +02:00
fix linux profile detection for chromium users
This commit is contained in:
@@ -408,7 +408,7 @@ class BrowserSession(BaseModel):
|
||||
'Could not detect Chrome profile directory for your platform.\n'
|
||||
'Expected locations:\n'
|
||||
' macOS: ~/Library/Application Support/Google/Chrome\n'
|
||||
' Linux: ~/.config/google-chrome\n'
|
||||
' Linux: ~/.config/google-chrome or ~/.config/chromium\n'
|
||||
' Windows: %LocalAppData%\\Google\\Chrome\\User Data'
|
||||
)
|
||||
|
||||
|
||||
@@ -213,7 +213,11 @@ def get_chrome_profile_path(profile: str | None) -> str | None:
|
||||
if system == 'Darwin':
|
||||
return str(Path.home() / 'Library' / 'Application Support' / 'Google' / 'Chrome')
|
||||
elif system == 'Linux':
|
||||
return str(Path.home() / '.config' / 'google-chrome')
|
||||
base = Path.home() / '.config'
|
||||
for name in ('google-chrome', 'chromium'):
|
||||
if (base / name).is_dir():
|
||||
return str(base / name)
|
||||
return str(base / 'google-chrome')
|
||||
elif system == 'Windows':
|
||||
return os.path.expandvars(r'%LocalAppData%\Google\Chrome\User Data')
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user