pub struct Launcher<'a, 'b, 'c> { /* private fields */ }Expand description
Implementations§
Source§impl<'a, 'b, 'c> Launcher<'a, 'b, 'c>
impl<'a, 'b, 'c> Launcher<'a, 'b, 'c>
pub async fn launch(self) -> Result<Browser, Arc<Error>>
Sourcepub fn executable(self, x: &'a Path) -> Self
pub fn executable(self, x: &'a Path) -> Self
Path to a browser executable to run instead of the bundled one. If executablePath is a relative path, then it is
resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox
or WebKit, use at your own risk.
Sourcepub fn args(self, x: &'b [String]) -> Self
pub fn args(self, x: &'b [String]) -> Self
Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.
Sourcepub fn ignore_all_default_args(self, x: bool) -> Self
pub fn ignore_all_default_args(self, x: bool) -> Self
If true, Playwright does not pass its own configurations args and only uses the ones from args. Dangerous option;
use with care. Defaults to false.
Sourcepub fn handle_sigint(self, x: bool) -> Self
pub fn handle_sigint(self, x: bool) -> Self
Close the browser process on Ctrl-C. Defaults to true.
Sourcepub fn handle_sigterm(self, x: bool) -> Self
pub fn handle_sigterm(self, x: bool) -> Self
Close the browser process on SIGTERM. Defaults to true.
Sourcepub fn handle_sighup(self, x: bool) -> Self
pub fn handle_sighup(self, x: bool) -> Self
Close the browser process on SIGHUP. Defaults to true.
Sourcepub fn timeout(self, x: f64) -> Self
pub fn timeout(self, x: f64) -> Self
Maximum time in milliseconds to wait for the browser instance to start. Defaults to 30000 (30 seconds). Pass 0 to
disable timeout.
Sourcepub fn devtools(self, x: bool) -> Self
pub fn devtools(self, x: bool) -> Self
Chromium-only Whether to auto-open a Developer Tools panel for each tab. If this option is true, the headless
option will be set false.
Sourcepub fn proxy(self, x: ProxySettings) -> Self
pub fn proxy(self, x: ProxySettings) -> Self
Network proxy settings.
Sourcepub fn downloads(self, x: &'c Path) -> Self
pub fn downloads(self, x: &'c Path) -> Self
If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
Sourcepub fn slowmo(self, x: f64) -> Self
pub fn slowmo(self, x: f64) -> Self
Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.
Sourcepub fn env(self, x: Map<String, Value>) -> Self
pub fn env(self, x: Map<String, Value>) -> Self
Specify environment variables that will be visible to the browser. Defaults to process.env.
Sourcepub fn chromium_sandbox(self, x: bool) -> Self
pub fn chromium_sandbox(self, x: bool) -> Self
Enable Chromium sandboxing. Defaults to false.
Sourcepub fn firefox_user_prefs(self, x: Map<String, Value>) -> Self
pub fn firefox_user_prefs(self, x: Map<String, Value>) -> Self
Firefox user preferences. Learn more about the Firefox user preferences at
about:config.