fix linux profile detection for chromium users

This commit is contained in:
Laith Weinberger
2026-03-24 18:14:22 -04:00
parent 872ef3982d
commit e44ce7ce73
2 changed files with 6 additions and 2 deletions

View File

@@ -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'
)

View File

@@ -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: