Fix Chrome opening visibly instead of headless

- Add detect_chromedriver_for_testing() to auto-detect Chrome for Testing
  chromedriver binary at ~/.chrome-for-testing/ (arm64, x64, linux64)
- Add tilde expansion for chrome_binary and chromedriver_binary config paths
- Add --no-first-run, --no-default-browser-check, --disable-popup-blocking
  Chrome flags to prevent UI popups in headless mode
This commit is contained in:
Dhanji R. Prasanna
2026-02-16 10:21:48 +11:00
parent 7347d92ae8
commit ca1cf5998a
2 changed files with 46 additions and 7 deletions

View File

@@ -185,6 +185,10 @@ impl ChromeDriver {
Value::String("--lang=en-US,en".to_string()),
// Stealth: Disable extensions to avoid detection
Value::String("--disable-extensions".to_string()),
// Prevent first-run UI and default browser check popups
Value::String("--no-first-run".to_string()),
Value::String("--no-default-browser-check".to_string()),
Value::String("--disable-popup-blocking".to_string()),
]),
);