๐ฎ orb-browse
A TUI browser widget for Rust - WebDriver automation for terminal applications
๐ฏ What is this?
orb-browse is a reusable browser component for terminal applications. It provides:
- ๐จ TUI Widget - Embeddable ratatui widget for terminal apps
- ๐ WebDriver Automation - Full browser control via W3C WebDriver
- ๐ธ Screenshot Capture - Capture web pages as PNG images
- ๐ Zero Config - Auto-detects Chrome version and downloads matching ChromeDriver
Perfect for building terminal-based web browsers, monitoring tools, or integrating web content into TUI applications.
๐ Quick Start
Add to your Cargo.toml:
[]
= "0.2"
= { = "1", = ["full"] }
TUI Widget Example
use ;
async
See examples/widget.rs for a complete interactive TUI browser example.
Automation Example
use OrbBrowser;
async
That's it! No ChromeDriver installation, no configuration needed.
๐ API Documentation
OrbBrowser
The main browser client:
// Create browser (default 1920x1080)
let browser = new.await?;
// Create with custom size
let browser = with_size.await?;
// Navigate to URL
browser.goto.await?;
// Capture screenshot
let png_bytes = browser.capture.await?;
// Access underlying fantoccini client for advanced control
let client = browser.client;
// Close browser
browser.close.await?;
BrowserWidget
Ratatui widget for displaying web content:
use ;
let mut state = new;
state.navigate.await?;
// Render in your TUI
frame.render_widget;
// Handle events
state.handle_event.await?;
state.handle_event.await?;
โจ Features
- โ TUI Widget - Display browser content in ratatui apps
- โ Headless Mode - Run without visible browser window
- โ Screenshot Capture - Full-page screenshots as PNG
- โ Auto-Setup - Detects Chrome version and downloads matching ChromeDriver
- โ Cross-Platform - Linux, macOS support
- โ Async - Built on tokio for non-blocking operations
๐งช Examples
Run the examples:
# Simple automation example
# Interactive TUI widget example
๐ฏ Use Cases
- TUI Web Browsers - Terminal-based browsing like carbonyl
- Monitoring Tools - Screenshot monitoring in terminal apps
- Automation - Automated web workflows
- Testing - Automated browser testing
- Data Collection - Gather data from web pages
๐ง How It Works
orb-browse uses WebDriver protocol to control Chrome/Chromium:
- Auto-detects Chrome version - Checks installed Chrome/Chromium version
- Downloads matching ChromeDriver - Fetches the correct ChromeDriver for your Chrome version
- Caches by version - Keeps multiple ChromeDriver versions for different Chrome installs
- Launches headless Chrome - Configures browser with appropriate flags
- WebDriver Protocol - Uses W3C WebDriver for reliable control
- Screenshot Capture - Renders pages and captures as PNG
- TUI Integration - Provides ratatui widget for terminal display
โ ๏ธ Requirements
- Chrome/Chromium - Must be installed on system
- curl and unzip - For ChromeDriver download
- Linux/macOS - Windows support planned
Environment Variables
-
ORB_BROWSE_CHROME_PATH- Override Chrome binary location -
ORB_BROWSE_VERBOSE=1- Enable verbose ChromeDriver logging for debuggingORB_BROWSE_VERBOSE=1
๐ค Contributing
Contributions welcome! Please submit a Pull Request.
๐ License
Licensed under the Apache License, Version 2.0 (LICENSE-APACHE).
๐ Acknowledgments
- Uses fantoccini for WebDriver
- Uses ratatui for TUI
- Built with tokio async runtime
Made with ๐ฆ in Rust