rfheadless

Crates.iorfheadless
lib.rsrfheadless
version0.1.0
created_at2026-01-15 19:45:38.683705+00
updated_at2026-01-15 19:45:38.683705+00
descriptionA headless browsing engine API for Rust
homepage
repositoryhttps://github.com/idiotstudios/rfheadless
max_upload_size
id2046419
size66,403,775
SeradedStripes (SeradedStripes)

documentation

https://docs.rs/rfheadless

README

RFox Headless Engine

A headless browsing engine API for Rust providing a compact, testable, and deterministic environment for loading pages, running JavaScript, and extracting rendered values without always requiring Chrome.


Features

  • RFEngine (default): pure-Rust engine using Boa for JS execution and scraper for HTML/CSS extraction.
  • Deterministic console forwarding with rich metadata (source, line, column, stack).
  • Minimal DOM helpers exposed to JS (querySelector, dataset, classList, innerHTML, etc.).
  • Basic CSSOM parsing and getComputedStyle with value normalization (colors, simple units).
  • Optional CDP backend (feature-gated) for Chrome/Chromium comparisons if you enable --features cdp.

Benchmarks

Results recorded on an i7 4770K CPU with 16GB DDR3 RAM
Test on your system with:

cargo bench --features rfengine

Results:

[latency_percentiles] samples=[7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 11, 12, 12, 16, 18, 19] [latency_percentiles] p50=8ms p95=18ms p99=19ms (threshold=200ms) [ perf record: Woken up 129 times to write data ] [ perf record: Captured and wrote 35.258 MB perf.data (572 samples) ]


Quick start

use rfheadless::{Engine, EngineConfig};

let mut engine = rfheadless::new_engine(EngineConfig::default())?;
engine.load_url("https://example.com")?;
let snapshot = engine.render_text_snapshot()?;
println!("Title: {}", snapshot.title);

See examples/ for runnable demonstrations.


Contributing

If you do wanna conrtibute (apprciated) then feel free to create issues or pull requests! I love the support. We mainly focusing on getting the engine to work the best in the shortest amunt of time but other help in the engine is good to!


License

Licensed under either of:

You may choose either license for your contribution.


Commit count: 0

cargo fmt