pub struct LaunchOptions {
pub headless: bool,
pub mute_audio: bool,
pub profile: ProfileSpec,
pub chrome_path: Option<PathBuf>,
pub viewport: (u32, u32),
pub launch_timeout: Duration,
pub extra_args: Vec<String>,
pub download_dir: Option<PathBuf>,
pub upload_root: Option<PathBuf>,
pub admission: Option<AdmissionHook>,
pub network: NetworkPolicy,
pub on_event: Option<EventSink>,
}Fields§
§headless: bool§mute_audio: boolPasses --mute-audio. Default true.
profile: ProfileSpec§chrome_path: Option<PathBuf>§viewport: (u32, u32)§launch_timeout: Duration§extra_args: Vec<String>Extra Chrome flags, with or without leading --.
download_dir: Option<PathBuf>Defaults to <profile>/downloads for temporary profiles and
<profile>/rightkit-downloads for named ones.
upload_root: Option<PathBuf>When set, upload refuses files outside this root.
admission: Option<AdmissionHook>Gates every navigation, input, and script action before it has any effect.
None admits everything (trusted callers).
network: NetworkPolicyNetwork/SSRF policy. Default blocks loopback, link-local, private ranges,
localhost, and file: unless allowed.
on_event: Option<EventSink>Receives start/stop/crash/denied lifecycle events (session id, reason, time).
Implementations§
Source§impl LaunchOptions
impl LaunchOptions
pub fn headed(self) -> Self
pub fn admission(self, hook: AdmissionHook) -> Self
pub fn network(self, policy: NetworkPolicy) -> Self
pub fn on_event(self, f: impl Fn(&BrowserEvent) + Send + Sync + 'static) -> Self
pub fn named_profile( self, root: impl Into<PathBuf>, name: impl Into<String>, ) -> Self
Trait Implementations§
Source§impl Clone for LaunchOptions
impl Clone for LaunchOptions
Source§impl Debug for LaunchOptions
impl Debug for LaunchOptions
Auto Trait Implementations§
impl !RefUnwindSafe for LaunchOptions
impl !UnwindSafe for LaunchOptions
impl Freeze for LaunchOptions
impl Send for LaunchOptions
impl Sync for LaunchOptions
impl Unpin for LaunchOptions
impl UnsafeUnpin for LaunchOptions
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
Mutably borrows from an owned value. Read more