30MB Rust Headless Browser Obscura: Beats Chrome, Real V8 JS + Full CDP Compatibility, the Invisible Nuclear Weapon for AI Agents and Crawlers

Obscura: A Dark Horse in the Open-Source World

Image

In the era of AI Agents and large-scale web scraping, traditional Headless Chrome looks increasingly cumbersome: 200MB+ memory, 300MB+ binary size, slow startup, obvious fingerprinting, and near-zero anti-detection capabilities.

The GitHub open-source project h4ckf0r0day/obscura has changed the game. A lightweight, headless browser engine built with pure Rust, designed specifically for AI Agent automation and web scraping. A single binary with no Chrome, no Node.js, and no external dependencies. It can genuinely run V8 JavaScript, fully supports the Chrome DevTools Protocol (CDP), and acts as a seamless drop-in replacement for Puppeteer and Playwright.

Project core metrics:

● Memory footprint: Only 30MB (vs. Chrome 200MB+)

● Binary size: Only 70MB (vs. Chrome 300MB+)

● Page load: 85ms (vs. Chrome ~500ms)

● Startup speed: Instant (vs. Chrome ~2s)

● Built-in anti-detection + blocks 3520 tracker domains

I. Obscura Core Feature Overview

Obscura provides three core capabilities:

1. CLI Command-Line Tool (obscura binary)

obscura fetch <URL>: Single-page fetch, supports real JS rendering, custom eval, wait conditions, selector waiting, and HTML/Text/Links output.

obscura scrape <URL...>: Multi-URL parallel scraping (--concurrency control), supports unified eval and JSON/Text output.

obscura serve: Starts a CDP WebSocket server to act as a Puppeteer/Playwright backend.

2. Stealth Mode (--stealth or cargo build --features stealth)

Fingerprint Randomization: Randomizes GPU, Screen, Canvas, Audio, Battery fingerprints for each session.

Real Chrome Emulation: navigator.userAgentData uses Chrome 145 high entropy; event.isTrusted=true; hides internal properties; Function.prototype.toString() returns [native code]; navigator.webdriver=undefined.

Tracker Blocking: Automatically blocks scripts from 3520 analytics, ads, telemetry, and fingerprinting domains.

○ The --stealth flag enables both anti-detection and tracker blocking simultaneously.

3. Chrome DevTools Protocol (CDP) Full Compatibility

○ Supports direct connection via puppeteer-core and playwright-core using ws://127.0.0.1:9222.

○ Implemented Domains and key methods (explicitly listed by the project):

Target: createTarget, closeTarget, attachToTarget, createBrowserContext, disposeBrowserContext

Page: navigate, getFrameTree, addScriptToEvaluateOnNewDocument, lifecycleEvents

Runtime: evaluate, callFunctionOn, getProperties, addBinding

DOM: getDocument, querySelector, querySelectorAll, getOuterHTML, resolveNode

Network: enable, setCookies, getCookies, setExtraHTTPHeaders, setUserAgentOverride

Fetch: enable, continueRequest, fulfillRequest, failRequest (real-time request interception)

Storage: get/set/delete Cookies

Input: dispatchMouseEvent, dispatchKeyEvent

LP: getMarkdown (DOM to Markdown)

Additional practical features:

● Supports --proxy (HTTP/SOCKS5)

● --obey-robots (respects robots.txt)

● --wait-until (load / domcontentloaded / networkidle0)

● --workers (multi-process parallelism)

● Form submission, login, 302 redirects, cookie persistence are all natively supported (real browser behavior)

II. Installation Methods

1. Pre-compiled Binary (Recommended, Fastest)

Download the latest version from the Releases page (https://github.com/h4ckf0r0day/obscura/releases):

● ● ● bashcurl -LO https://github.com/h4ckf0r0day/obscura/releases/latest/download/obscura-x86_64-linux.tar.gztar xzf obscura-x86_64-linux.tar.gzchmod +x obscuracurl -LO https://github.com/h4ckf0r0day/obscura/releases/latest/download/obscura-aarch64-macos.tar.gztar xzf obscura-aarch64-macos.tar.gzcurl -LO https://github.com/h4ckf0r0day/obscura/releases/latest/download/obscura-x86_64-macos.tar.gztar xzf obscura-x86_64-macos.tar.gz# Windows: Download the .zip and extract it

2. Build from Source (Supports Stealth Features)

● ● ● bashgit clone https://github.com/h4ckf0r0day/obscura.gitcd obscuracargo build --releasecargo build --release --features stealth

Requires: Rust 1.75+ (installed via rustup). Initial build takes about 5 minutes (V8 compiles from source, subsequent build times are cached).

Binary path is target/release/obscura.

III. Usage

Core CLI Commands (full parameter list from the project)

obscura serve --port 9222 [--stealth] [--proxy <URL>] [--workers N] [--obey-robots]

obscura fetch <URL> [--dump html|text|links] [--eval "JS"] [--wait-until load|domcontentloaded|networkidle0] [--selector "css"] [--stealth]

obscura scrape <URL1> <URL2>... [--concurrency 10] [--eval "JS"] [--format json|text] [--stealth]

Puppeteer Integration Example (fully runnable):

● ● ● javascriptimport puppeteer from 'puppeteer-core';const browser = await puppeteer.connect({ browserWSEndpoint: 'ws://127.0.0.1:9222/devtools/browser' });const page = await browser.newPage();await page.goto('https://news.ycombinator.com');// Real JS execution, cookies, login all supported

Playwright Example is similar, using chromium.connectOverCDP({ endpointURL: 'ws://127.0.0.1:9222' }).

Scenarios like form login, dynamic content waiting, and real-time Fetch interception all have complete demonstrations in the project's README.

IV. Technical Principles and Architecture

Obscura adopts a multi-crate Cargo Workspace architecture, highly modularized and async-driven, which is the core reason for its extreme lightness and high performance.

1. Overall Architecture

workspace: 6 crates — obscura-dom, obscura-net, obscura-js, obscura-browser, obscura-cdp, obscura-cli.

● Core dependencies:

tokio: Fully async runtime

reqwest: HTTP client (cookies, gzip/brotli/deflate, native-tls)

deno_core 0.350 (obscura-js): Genuine V8 engine integration (build-dependency also relies on deno_core)

html5ever + markup5ever + selectors + cssparser + servo_arc (obscura-dom): Servo-style high-performance HTML/CSS/DOM parser

tokio-tungstenite (obscura-cdp): WebSocket CDP server

wreq + wreq-util (obscura-net stealth feature): Advanced network request control + tracker blocking

2. Core Responsibilities of Each Crate

obscura-dom: Uses html5ever for HTML parsing and selectors for CSS queries, implementing a lightweight DOM tree.

obscura-js: Builds a V8 runtime via deno_core, supporting module_loader, runtime, and ops custom operations. Each Page has an independent JS context for real JavaScript execution (not simulated).

obscura-net: Core network layer using reqwest. The stealth feature enables wreq for domain-level tracker blocking (3520 domains) and request masking.

obscura-browser: The core glue layer, exposing Page, BrowserContext, LifecycleState. Responsible for coordinating DOM + JS + Net, implementing page lifecycles (navigate, wait-until, evaluate).

obscura-cdp: Implements the full suite of Chrome DevTools Protocol methods, exposed to Puppeteer/Playwright via WebSocket. Supports Fetch interception, Input events, etc.

obscura-cli: Clap-driven command-line entry point, calling browser and cdp to implement fetch/scrape/serve.

3. Key Implementation Principles

Real JS Execution: deno_core embeds V8 directly, eliminating the need for the full Chromium rendering engine, drastically reducing memory and size.

Stealth Implementation: Compile-time feature toggle; at runtime, performs per-session randomization in BrowserContext + navigator property overwrites + event masking + domain-level network blacklist blocking.

Ultimate Performance: No Blink rendering engine, no unnecessary desktop features, pure Rust zero-cost abstractions + Tokio async + Servo parser → instant startup + low memory.

CDP Compatibility: Fully reuses Chrome protocol semantics, ensuring zero-modification access for Puppeteer/Playwright.

In the source code, obscura-browser/src/lib.rs exposes only three modules—page/context/lifecycle—reflecting a minimalist design philosophy.

Obscura is a Rust-native engine tailored for AI Agents and large-scale scraping. With modular crates, deno_core V8, Servo DOM, and reqwest, it achieves performance and stealth far surpassing traditional Headless Chrome.

Whether building autonomous AI agents, performing large-scale data collection, or creating low-resource anti-scraping solutions, Obscura is currently the most pragmatic choice.

—— That's how it is

Turning complex technology into productivity you can truly use.

Zero to Hero with Satellites! A Complete Guide to Building a Personal Ground Station with Open-Source Ground Station + SDR

After OpenClaw & Hermes Took the Spotlight, How Did GitHub's Mercury Agent Win Users? Soul-Driven Core + Ironclad Permissions + 24/7 Perpetual Motion vs Two Major Competitors

A Boon for Apple M-Series Chips! Fine-Tune the Gemma 4 Multimodal Model on Your Local MacBook—No H100 or Cloud GPU Needed

163 AI Tools Crammed into Godot, Solo Game Dev Efficiency Skyrockets! Make a Hit Game for $15

The Ultimate Open-Source Minecraft Killer! A Complete Chinese Guide to the 12.7K-Star GitHub Gem Luanti (Formerly Minetest): Zero-Base Installation, 2800+ Mods, Servers & Source Compilation

AI Directly Controls Unity/Godot/Unreal Editors! Use OpenClaw + TomLeeLive Plugin to Turn Your Game Dreams into Reality Through Chat

Rust Open-Source AI Agent Security Base Layer LoongClaw Officially Open-Sourced: 7-Crate Strict DAG Kernel + L0-L9 Layered Governance, Team Domain-Specific Intelligent Agents Finally Have a Production-Grade "Foundation"!

Open-Source Project Paseo, a Unified Command Center for Cross-Device AI Coding Agents: Manage Claude Code, Codex, OpenCode (and Copilot, Pi, etc.)

Notebook LM Alternative, Open-Source Open Notebook: Zero Privacy Leaks, Seamlessly Switch Between 18+ AI Models, Generate Custom Podcasts for 1-4 People in Seconds

Related Articles

分享網址
AINews·AI 新聞聚合平台
© 2026 AINews. All rights reserved.