MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / launch

Function launch

cli/src/engine.rs:123–131  ·  view source on GitHub ↗

Launch headless Chromium against a system-installed browser. install.sh provisions it.

()

Source from the content-addressed store, hash-verified

121
122/// Launch headless Chromium against a system-installed browser. install.sh provisions it.
123fn launch() -> Result<Browser> {
124 let mut builder = LaunchOptions::default_builder();
125 builder.sandbox(false); // headless under WSL/containers typically can't sandbox
126 // Default is 30s and the REPL would drop CDP whenever the user stopped to think.
127 builder.idle_browser_timeout(Duration::from_secs(60 * 60 * 24));
128 builder.path(Some(resolve_chrome()?));
129 let options = builder.build().map_err(|e| anyhow!("building launch options: {e}"))?;
130 Browser::new(options).map_err(|e| anyhow!("{e}"))
131}
132
133/// Prefer env override, then any Chrome on PATH, then a Playwright-cached Chromium.
134fn resolve_chrome() -> Result<PathBuf> {

Callers 1

openMethod · 0.85

Calls 3

resolve_chromeFunction · 0.85
sandboxMethod · 0.80
buildMethod · 0.80

Tested by

no test coverage detected