diff --git a/src/browser/process.rs b/src/browser/process.rs index d778af12..21094505 100644 --- a/src/browser/process.rs +++ b/src/browser/process.rs @@ -87,6 +87,12 @@ pub struct LaunchOptions<'a> { #[builder(default = "true")] pub sandbox: bool, + /// Determines whether to run the browser with logging enabled + /// (this can cause unwanted new shell window in Windows 10 and above). + /// Check + #[builder(default = "false")] + pub enable_logging: bool, + /// Launch the browser with a specific window width and height. #[builder(default = "None")] pub window_size: Option<(u32, u32)>, @@ -159,6 +165,7 @@ impl<'a> Default for LaunchOptions<'a> { LaunchOptions { headless: true, sandbox: true, + enable_logging: false, idle_browser_timeout: Duration::from_secs(30), window_size: None, path: None, @@ -310,7 +317,6 @@ impl Process { let mut args = vec![ port_option.as_str(), "--disable-gpu", - "--enable-logging", "--verbose", "--log-level=0", "--no-first-run", @@ -343,6 +349,10 @@ impl Process { args.extend(["--ignore-certificate-errors"]); } + if launch_options.enable_logging { + args.extend(["--enable-logging"]); + } + let proxy_server_option = if let Some(proxy_server) = launch_options.proxy_server { format!("--proxy-server={proxy_server}") } else {