1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! # cdp-browser-lite
//!
//! Total lifecycle control for Chrome instances, seamlessly integrating with `cdp-lite`.
//!
//! Provides the ability to spawn, attach, and manage Google Chrome or Chromium instances,
//! ensuring correct cleanup, avoiding zombie processes, and offering a reliable interface
//! for Headless Chrome automation.
//!
//! ## Example
//!
//! ```no_run
//! use std::time::Duration;
//! use cdp_browser_lite::browser::Browser;
//! use cdp_browser_lite::config::{BrowserConfig, LaunchMode};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let config = BrowserConfig::builder()
//! .mode(LaunchMode::LaunchNew)
//! .port(0) // Ephemeral port
//! .headless(true)
//! .build();
//!
//! // Launch the browser
//! let browser = Browser::ensure(config).await?;
//! let (host, port) = browser.debug_address();
//! println!("Chrome launched at {host}:{port}");
//!
//! // Obtain a CDP client directly from the browser
//! let mut client = browser.client().await?;
//!
//! // Stop the browser cleanly
//! browser.stop().await?;
//! Ok(())
//! }
//! ```
// Re-exports
pub use Browser;
pub use CdpClient;
pub use ;
pub use EventFilter;
pub use ;
pub use ;
pub use BrowserError;