pub struct RealBrowserOptions {Show 35 fields
pub engine: EngineType,
pub channel: String,
pub executable_path: Option<PathBuf>,
pub user_data_dir: Option<PathBuf>,
pub profile_directory: String,
pub default_browser_check: Option<bool>,
pub first_run: bool,
pub preferences: Value,
pub local_state: Value,
pub storage_state: Option<StorageStateInput>,
pub remote_debugging_port: Option<u16>,
pub port_attempts: u32,
pub headless: bool,
pub restrictions: Vec<String>,
pub args: Vec<String>,
pub extra_args: Vec<String>,
pub ignore_default_args: Vec<String>,
pub ignore_all_default_args: bool,
pub env: Option<HashMap<String, String>>,
pub automation_parity: bool,
pub startup_timeout: Duration,
pub close_timeout: Duration,
pub slow_mo: u64,
pub timeout: Option<Duration>,
pub protocol_timeout: Option<Duration>,
pub seed_cookies: Vec<Value>,
pub migrate_from: Option<MigrationSource>,
pub migrate_include: Option<Vec<String>>,
pub migrate_domains: Vec<String>,
pub migrate_password_csv: Option<PathBuf>,
pub migrate_include_payment_cards: bool,
pub verbose: bool,
pub node_executable: Option<PathBuf>,
pub node_working_dir: Option<PathBuf>,
pub downloads: DownloadSetting,
}Expand description
Options for launching an installed browser and attaching over CDP.
Fields§
§engine: EngineTypeBrowser Commander engine used after the browser starts.
channel: StringInstalled Chrome-family channel to discover.
executable_path: Option<PathBuf>Explicit installed-browser executable, bypassing channel discovery.
user_data_dir: Option<PathBuf>Dedicated, non-default browser profile. When None a fresh temporary
profile is created for the launch and deleted when the browser exits.
profile_directory: StringProfile whose Preferences are seeded before launch.
default_browser_check: Option<bool>Whether to ask to become the OS default browser. Defaults to false.
first_run: boolAllow the browser’s first-run flow in a fresh profile.
preferences: ValueJSON object deep-merged into Default/Preferences before launch.
local_state: ValueJSON object deep-merged into Local State before launch.
storage_state: Option<StorageStateInput>Playwright-compatible cookie and localStorage state to restore.
remote_debugging_port: Option<u16>Fixed loopback CDP port. When None a free port is reserved (and a
lost port race retried). Zero is refused: it makes Chrome enable
AutomationControlled.
port_attempts: u32Ports to try when the port is reserved by the launcher.
headless: boolRun the installed browser headlessly (--headless=new).
restrictions: Vec<String>Opt-in restrictions from the shared catalogue, such as
no-extensions or the legacy-defaults preset. See
restrictions.
args: Vec<String>Additional browser arguments.
extra_args: Vec<String>Additional browser arguments appended after the compatibility args.
ignore_default_args: Vec<String>Ignored since issue #103: there are no Browser Commander defaults left to omit. Kept so existing code compiles.
ignore_all_default_args: boolIgnored since issue #103; see ignore_default_args.
env: Option<HashMap<String, String>>Extra environment for the browser process only. The caller’s process environment is never modified.
automation_parity: boolAdd --disable-blink-features=AutomationControlled when the command
line contains a switch that would turn navigator.webdriver on (such
as a caller-supplied --enable-automation). A plain launch, headful or
headless, has none, so its command line stays exactly as typed.
startup_timeout: DurationMaximum time to wait for Chrome’s DevTools endpoint.
close_timeout: DurationTime allowed for browser exit before RealBrowserLaunchResult::close kills it.
slow_mo: u64Delay Playwright/Puppeteer operations by this many milliseconds.
timeout: Option<Duration>Optional connection timeout.
protocol_timeout: Option<Duration>Optional Puppeteer timeout for individual CDP calls.
Cookies to seed immediately after attaching.
migrate_from: Option<MigrationSource>Read-only source profile to copy into the dedicated profile before launch.
migrate_include: Option<Vec<String>>Data classes to copy. None selects every supported class.
migrate_domains: Vec<String>Host/subdomain filters for migrated per-site data.
migrate_password_csv: Option<PathBuf>Explicit Safari/Passwords CSV export to import before launching.
migrate_include_payment_cards: boolSeparate explicit consent to import payment cards before launching.
verbose: boolEnable browser and connector logging; the browser’s output is mirrored.
node_executable: Option<PathBuf>Node.js executable for Playwright/Puppeteer bridge engines.
node_working_dir: Option<PathBuf>Directory where Node resolves Playwright/Puppeteer.
downloads: DownloadSettingManage the installed browser’s downloads.
The same setting and the same manager as
LaunchOptions and
ConnectOptions, which is what makes a download started by hand in a
visible window land where an automated one does. See
downloads.
Implementations§
Source§impl RealBrowserOptions
impl RealBrowserOptions
Sourcepub fn chromiumoxide() -> Self
pub fn chromiumoxide() -> Self
Create native Chromiumoxide options.
Sourcepub fn playwright() -> Self
pub fn playwright() -> Self
Create Playwright bridge options.
Sourcepub fn executable_path(self, executable_path: impl Into<PathBuf>) -> Self
pub fn executable_path(self, executable_path: impl Into<PathBuf>) -> Self
Select an explicit installed-browser executable.
Sourcepub fn user_data_dir(self, user_data_dir: impl Into<PathBuf>) -> Self
pub fn user_data_dir(self, user_data_dir: impl Into<PathBuf>) -> Self
Select a dedicated browser profile instead of a temporary one.
Sourcepub fn storage_state(self, state: impl Into<StorageStateInput>) -> Self
pub fn storage_state(self, state: impl Into<StorageStateInput>) -> Self
Restore portable cookies and origin-scoped localStorage after connecting.
Sourcepub fn remote_debugging_port(self, port: u16) -> Self
pub fn remote_debugging_port(self, port: u16) -> Self
Use a fixed loopback CDP port instead of a reserved one. Zero is refused at launch.
Sourcepub fn port_attempts(self, attempts: u32) -> Self
pub fn port_attempts(self, attempts: u32) -> Self
Set how many reserved ports to try when another process takes one.
Sourcepub fn restrictions<I, S>(self, restrictions: I) -> Self
pub fn restrictions<I, S>(self, restrictions: I) -> Self
Opt in to named launch restrictions or presets.
Sourcepub fn with_extra_args(self, args: Vec<String>) -> Self
pub fn with_extra_args(self, args: Vec<String>) -> Self
Add browser arguments after the compatibility args field.
Sourcepub fn ignore_default_args(self, args: Vec<String>) -> Self
👎Deprecated since 0.13.0: Browser Commander adds no default switches any more; opt in with restrictions instead
pub fn ignore_default_args(self, args: Vec<String>) -> Self
Browser Commander adds no default switches any more; opt in with restrictions instead
Has no effect since issue #103: Browser Commander adds no defaults.
Sourcepub fn ignore_all_default_args(self) -> Self
👎Deprecated since 0.13.0: Browser Commander adds no default switches any more; opt in with restrictions instead
pub fn ignore_all_default_args(self) -> Self
Browser Commander adds no default switches any more; opt in with restrictions instead
Has no effect since issue #103: Browser Commander adds no defaults.
Sourcepub fn env(self, env: HashMap<String, String>) -> Self
pub fn env(self, env: HashMap<String, String>) -> Self
Extra environment for the browser process only.
Sourcepub fn automation_parity(self, enabled: bool) -> Self
pub fn automation_parity(self, enabled: bool) -> Self
Keep navigator.webdriver false when a switch would turn it on.
Sourcepub fn startup_timeout(self, timeout: Duration) -> Self
pub fn startup_timeout(self, timeout: Duration) -> Self
Set the CDP readiness timeout.
Sourcepub fn close_timeout(self, timeout: Duration) -> Self
pub fn close_timeout(self, timeout: Duration) -> Self
Set how long closing waits for the browser to exit before killing it.
Sourcepub fn protocol_timeout(self, timeout: Duration) -> Self
pub fn protocol_timeout(self, timeout: Duration) -> Self
Set Puppeteer’s timeout for individual CDP calls.
Seed cookies after attaching.
Sourcepub fn migrate_from(self, source: MigrationSource) -> Self
pub fn migrate_from(self, source: MigrationSource) -> Self
Copy supported profile data before launch and seed its cookies over CDP.
Sourcepub fn migrate_include<I, S>(self, include: I) -> Self
pub fn migrate_include<I, S>(self, include: I) -> Self
Restrict a profile migration to the selected data classes.
Sourcepub fn migrate_domains<I, S>(self, domains: I) -> Self
pub fn migrate_domains<I, S>(self, domains: I) -> Self
Restrict migrated cookies to the selected hosts.
Sourcepub fn node_executable(self, executable: impl Into<PathBuf>) -> Self
pub fn node_executable(self, executable: impl Into<PathBuf>) -> Self
Override the Node.js executable for bridge engines.
Sourcepub fn node_working_dir(self, directory: impl Into<PathBuf>) -> Self
pub fn node_working_dir(self, directory: impl Into<PathBuf>) -> Self
Set the directory where Node resolves Playwright/Puppeteer.
Sourcepub fn downloads(self, downloads: impl Into<DownloadSetting>) -> Self
pub fn downloads(self, downloads: impl Into<DownloadSetting>) -> Self
Manage the installed browser’s downloads.
§Arguments
downloads-truefor the defaults,falsefor none, orDownloadOptions
Sourcepub fn get_user_data_dir(&self) -> PathBuf
👎Deprecated since 0.13.0: launch_real_browser uses a fresh temporary profile unless user_data_dir is set; read RealBrowserLaunchResult::user_data_dir
pub fn get_user_data_dir(&self) -> PathBuf
launch_real_browser uses a fresh temporary profile unless user_data_dir is set; read RealBrowserLaunchResult::user_data_dir
The profile a launch would use: the configured one, or Browser Commander’s old managed per-channel directory.
Trait Implementations§
Source§impl Clone for RealBrowserOptions
impl Clone for RealBrowserOptions
Source§impl Debug for RealBrowserOptions
impl Debug for RealBrowserOptions
Auto Trait Implementations§
impl !RefUnwindSafe for RealBrowserOptions
impl !UnwindSafe for RealBrowserOptions
impl Freeze for RealBrowserOptions
impl Send for RealBrowserOptions
impl Sync for RealBrowserOptions
impl Unpin for RealBrowserOptions
impl UnsafeUnpin for RealBrowserOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more