Fix: Suppress Google Translate bar in native headless mode (#649)

Fixes #617

(cherry picked from commit 492830accb)
This commit is contained in:
Chris Tate
2026-03-09 09:37:33 +09:00
committed by leeguooooo
parent b100870a02
commit 5c142b02b5
+14
View File
@@ -95,6 +95,7 @@ fn build_chrome_args(options: &LaunchOptions) -> Result<ChromeArgs, String> {
"--disable-popup-blocking".to_string(),
"--disable-prompt-on-repost".to_string(),
"--disable-sync".to_string(),
"--disable-features=Translate".to_string(),
"--enable-features=NetworkService,NetworkServiceInProcess".to_string(),
"--metrics-recording-only".to_string(),
"--password-store=basic".to_string(),
@@ -750,6 +751,19 @@ mod tests {
}
}
#[test]
fn test_build_args_disables_translate() {
let opts = LaunchOptions::default();
let result = build_chrome_args(&opts).unwrap();
assert!(result
.args
.iter()
.any(|a| a.contains("--disable-features") && a.contains("Translate")));
if let Some(ref dir) = result.temp_user_data_dir {
let _ = std::fs::remove_dir_all(dir);
}
}
#[test]
fn test_chrome_process_drop_cleans_temp_dir() {
let dir = std::env::temp_dir().join(format!(