Expand description
RFox Headless Engine
A headless browsing engine API for Rust that provides a high-level interface for loading pages, running JavaScript, and producing rendered outputs.
§Features
- CDP Backend (default): Uses Chrome DevTools Protocol via headless Chrome
- Modular Design: Adapter-based architecture for swappable backends
- Safe Defaults: Sandboxing and restrictive defaults with explicit opt-ins
§Example
use rfheadless::{Engine, EngineConfig, Viewport};
let config = EngineConfig {
user_agent: "RFox/1.0".to_string(),
viewport: Viewport { width: 1280, height: 720 },
timeout_ms: 30000,
..Default::default()
};
let mut engine = rfheadless::new_engine(config)?;
engine.load_url("https://example.com")?;
let snapshot = engine.render_text_snapshot()?;
println!("Title: {}", snapshot.title);Re-exports§
Modules§
- error
- Error types for the headless engine
- platform
- Platform API surface: service workers, media hooks, accessibility, device emulation
- rendering
- Rendering module (Phase 1 prototype)
- rfengine
- RFEngine: lightweight pure-Rust backend with minimal JS and CSS extraction.
Structs§
- Console
Message - Console message emitted by the page
- Cookie
- A cookie retrieved from the browser
- Cookie
Param - Parameters for setting a cookie
- Engine
Config - Configuration for the headless engine
- Request
Info - Information about an outgoing network request
- Script
Result - Result of JavaScript execution
- Text
Snapshot - A textual snapshot of a rendered page
- Viewport
- Viewport dimensions
Enums§
- Request
Action - Action to take when a request is observed by
on_requesthandlers.
Traits§
- Engine
- Core trait for headless engine implementations
Functions§
- new_
engine - Create a new engine instance with the default backend