pub struct Browser { /* private fields */ }Expand description
The main stealth browser
Implementations§
Source§impl Browser
impl Browser
Sourcepub async fn launch() -> Result<Browser, Error>
pub async fn launch() -> Result<Browser, Error>
Launch a new stealth browser with default config
Sourcepub async fn launch_with_config(config: StealthConfig) -> Result<Browser, Error>
pub async fn launch_with_config(config: StealthConfig) -> Result<Browser, Error>
Launch with custom config
Sourcepub async fn connect(ws_url: &str) -> Result<Browser, Error>
pub async fn connect(ws_url: &str) -> Result<Browser, Error>
Connect to an existing Chrome instance at the given WebSocket CDP URL.
Obtain the URL from curl http://localhost:9222/json/version.
Does not patch the binary or manage the Chrome process.
Evasion scripts are still injected into new pages.
Sourcepub async fn new_page(&self, url: &str) -> Result<Page, Error>
pub async fn new_page(&self, url: &str) -> Result<Page, Error>
Create a new page and navigate to URL
Sourcepub async fn new_blank_page(&self) -> Result<Page, Error>
pub async fn new_blank_page(&self) -> Result<Page, Error>
Create a new page without navigation (at about:blank)
Sourcepub async fn attach_page(&self, target_id: &str) -> Result<Page, Error>
pub async fn attach_page(&self, target_id: &str) -> Result<Page, Error>
Attach to an existing browser target (e.g., a popup opened by window.open()).
Use tabs() to discover popup target IDs, then call this to get a Page handle.
Sourcepub async fn activate_tab(&self, target_id: &str) -> Result<(), Error>
pub async fn activate_tab(&self, target_id: &str) -> Result<(), Error>
Activate (focus) a tab by target ID
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Browser
impl !RefUnwindSafe for Browser
impl Send for Browser
impl Sync for Browser
impl Unpin for Browser
impl UnsafeUnpin for Browser
impl !UnwindSafe for Browser
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