Crate orb_browse

Crate orb_browse 

Source
Expand description

§orb-browse

A TUI browser widget for Rust with WebDriver automation and bot detection bypass.

orb-browse provides a reusable browser component that can be embedded in terminal applications using ratatui, with the unique ability to bypass bot detection systems.

§Features

  • 🌐 WebDriver Automation - Full browser control via W3C WebDriver
  • 🥷 Bot Detection Bypass - Patches ChromeDriver to avoid detection
  • 🎨 TUI Widget - Embeddable ratatui widget for terminal apps
  • 📸 Screenshot Capture - Capture web pages as images
  • 🚀 Auto-Setup - Downloads and configures ChromeDriver automatically

§Quick Start

use orb_browse::OrbBrowser;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a browser instance
    let browser = OrbBrowser::new().await?;

    // Navigate and capture screenshot
    let screenshot = browser.capture("https://google.com", 1920, 1080).await?;

    // Save screenshot
    std::fs::write("google.png", &screenshot)?;

    Ok(())
}

§Use as TUI Widget

use orb_browse::{OrbBrowser, widget::{BrowserWidget, BrowserState}};

let browser = OrbBrowser::new().await?;
let mut state = BrowserState::new();

// Navigate to a URL
state.navigate(&browser, "https://example.com".to_string()).await?;

// In your ratatui render loop:
// frame.render_widget(BrowserWidget::new(&state), area);

§How It Works

  1. Binary Patching: Removes $cdc_ markers from ChromeDriver
  2. Automation Bypass Flags: Disables --enable-automation and automation hints
  3. JavaScript Injection: Overrides navigator.webdriver and mocks APIs
  4. WebDriver Protocol: Uses W3C WebDriver (not detectable CDP)

This achieves functional parity with Python’s undetected-chromedriver.

Re-exports§

pub use patcher::ChromeDriverPatcher;
pub use injections::COMPREHENSIVE_BOOTSTRAP;
pub use client::OrbBrowser;

Modules§

client
WebDriver client with bot detection bypass
injections
Enhanced JavaScript injections for bot detection bypass
patcher
ChromeDriver binary patcher
widget
TUI widget for embedding a browser in terminal applications

Functions§

find_chrome
Find Chrome/Chromium binary on the system
launch_patched_chromedriver
Launch patched ChromeDriver and return the WebDriver URL and process handle