Skip to content

Commit 14e738a

Browse files
committed
feat: provide option to pass additional args to chromium
1 parent 44b12e4 commit 14e738a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/config.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ async fn init_chrome_launch_options() -> BrowserConfig {
6363
browser_config = browser_config.no_sandbox();
6464
}
6565

66+
if CONFIG.chrome.chrome_disable_default_args {
67+
browser_config = browser_config.disable_default_args();
68+
}
69+
70+
if !CONFIG.chrome.chrome_additional_args.is_empty() {
71+
browser_config = browser_config.args(CONFIG.chrome.chrome_additional_args.split(","));
72+
}
73+
6674
if !CONFIG.chrome.chrome_path.is_empty() {
6775
browser_config = browser_config.chrome_executable(CONFIG.chrome.chrome_path.as_str());
6876
} else {
@@ -178,6 +186,10 @@ pub struct Chrome {
178186
pub chrome_window_width: u32,
179187
#[env_config(name = "ZO_CHROME_WINDOW_HEIGHT", default = 730)]
180188
pub chrome_window_height: u32,
189+
#[env_config(name = "ZO_CHROME_ADDITIONAL_ARGS", default = "")]
190+
pub chrome_additional_args: String,
191+
#[env_config(name = "ZO_CHROME_DISABLE_DEFAULT_ARGS", default = false)]
192+
pub chrome_disable_default_args: bool,
181193
}
182194

183195
#[derive(EnvConfig)]

0 commit comments

Comments
 (0)