Obscura: The Rust-Based Headless Browser Dethroning Chrome
Obscura headless browser written in Rust: 30MB RAM, 85ms load, CDP compatible. The open-source alternative to Chrome for scraping and AI agents.
Obscura: The Rust-Based Headless Browser Dethroning Chrome
If you are a developer doing web scraping or automation, you have a common pain point: Headless Chrome. It consumes 200 MB of RAM, takes two seconds to start, and gets flagged by anti-bot systems in milliseconds. We install hundreds of dependencies, watch Docker images bloat, and see server costs skyrocket. Obscura enters right at this pain point. Written in Rust, shipped as a single binary, and compatible with the Chrome DevTools Protocol (CDP). In this article, we examine Obscura's technical architecture, benchmarked performance against headless Chrome, how stealth mode works, and real-world usage scenarios. We test Puppeteer and Playwright compatibility with code examples.
![]()
Why Obscura? Where Chrome Falls Short
Using a Chrome-based headless browser is standard practice today, but it has hidden costs. First, memory consumption: every Puppeteer page averages 200 MB RAM. Fifty parallel processes eat 10 GB just for browsers. Second, startup time: each job waits two seconds for Chrome's core to load. Third, detectability: through navigator.webdriver flags, Canvas fingerprint inconsistencies, and missing GPU profiles, modern anti-bot systems (DataDome, Cloudflare, PerimeterX) identify headless Chrome within seconds.
Obscura targets these problems directly. Being written in Rust provides natural advantages in memory safety and performance. Rust's ownership model prevents memory leaks and use-after-free errors at compile time. This is critical for long-running scraping tasks. The critical point is that it ships as a single binary. No Node.js installation, no Chromium download, no version mismatches. cargo build --release and you are ready. Distribution is just copying a single file.
Benchmarked Performance: Let the Numbers Speak
The comparison table in Obscura's GitHub repository shows:
- Memory: Obscura 30 MB, Chrome 200+ MB
- Binary size: Obscura 70 MB, Chrome 300+ MB
- Page load: Obscura 85 ms, Chrome 500 ms
- Startup: Obscura instant, Chrome ~2s
These differences are not just theoretical. On static HTML pages, Obscura completes in 51 ms while Chrome stays around 500 ms. On dynamic pages with JavaScript and XHR, Obscura hits 84 ms versus Chrome's 800 ms. Roughly ten times faster. The main reason is that Obscura is designed for automation, not desktop browsing. It carries no unnecessary rendering layers, decryption interfaces, browser extension support, or WebGL overhead. These savings add up to an impressive result.
Technical Architecture: What V8 and CDP Enable
Obscura uses the real V8 JavaScript engine. This means pages render fully. You can scrape content from React, Vue, or Angular single-page applications (SPAs). For apps without server-side rendering (SSR), this capability is vital. Plus, Chrome DevTools Protocol (CDP) support lets you use existing Puppeteer and Playwright code without modifications.
Supported CDP domains include: Target, Page, Runtime, DOM, Network, Fetch, Storage, Input, and LP (DOM-to-Markdown conversion). Through the Fetch domain, live request interception is possible. This is critical for blocking specific scripts, images, or analytics libraries before the page loads. The Network domain allows cookie management, extra HTTP headers, and user agent overrides. The Input domain simulates mouse and keyboard interactions. This allows programmatic form filling, clicking, and scrolling.
Obscura's architecture is crate-based. The main project contains different crates. This modular structure lets you compile only the features you need. Stealth mode, for example, activates when compiled with --features stealth. This way you get a lighter binary for basic use. This approach showcases the power of Rust's workspace structure.
Stealth Mode: How It Bypasses Anti-Bot Systems
Obscura's stealth mode does more than remove the navigator.webdriver flag. For every session, GPU profiles, screen resolution, Canvas fingerprints, AudioContext fingerprints, and battery status are randomized. Each connection presents a different device profile, rendering fingerprint-based tracking ineffective. FingerprintJS-style libraries can no longer identify you.
Another important detail is native function masking. Normally, inspecting JavaScript function source code in headless browsers reveals automation traces. Obscura returns [native code] for Function.prototype.toString() calls, blocking this detection. This simple-looking technique disables an important checkpoint for advanced bot detection systems. It also sets event.isTrusted to true as if from real user interactions. Bot detection systems check whether mouse movements and clicks match human behavior. Obscura passes these checks.
The tracker blocking feature is also significant. By default, 3,520 tracker domains are blocked. Scripts from Google Analytics, Facebook Pixel, and Hotjar never load. This not only improves privacy but dramatically reduces page load times. When scraping an e-commerce site, you no longer wait for unnecessary tracking scripts. It also prevents ad networks from flagging your IP address.
CLI Tools: serve, fetch, scrape
Obscura is not just a library; it also provides useful CLI tools. obscura serve starts a CDP WebSocket server on the default port 9222. After running it, you can connect via Puppeteer or Playwright at ws://127.0.0.1:9222. The --stealth flag runs the server in anti-detection mode. The --workers parameter sets the number of parallel worker processes. --obey-robots ensures compliance with robots.txt rules.
obscura fetch quickly pulls a single page. The --eval flag lets you run JavaScript in the page and return results. For example, obscura fetch https://example.com --eval "document.title" returns the page title. --dump html gives fully rendered HTML, while --dump text returns only text content. --dump links lists all links on the page. --wait-until networkidle0 waits for AJAX requests to complete. This flag is a lifesaver when scraping SPA applications. --selector lets you wait for a specific CSS selector to appear.
obscura scrape is designed for bulk jobs. It processes multiple URLs in parallel. The --concurrency parameter controls how many pages run simultaneously. --format json returns structured results. For large-scale scraping, this tool saves serious time. You can integrate it into your CI/CD pipeline for automated data collection.
Real-World Usage with Puppeteer and Playwright
Thanks to CDP compatibility, migrating existing code is easy. If you have a Puppeteer project, simply switch to puppeteer-core and change the WebSocket endpoint. For Playwright, use the connectOverCDP method similarly. This migration usually involves only changing the connection code.
Form submission, session management, and cookie-based authentication work fully in Obscura. It handles POST requests, follows 302 redirects, and maintains cookies. This is critical when extracting data from login-required platforms. For example, when scraping order data from an e-commerce panel, your session must stay alive. Obscura manages this seamlessly.
On the JavaScript side, you can start with code like this:
import 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');
const stories = await page.evaluate(() =>
Array.from(document.querySelectorAll('.titleline > a'))
.map(a => ({ title: a.textContent, url: a.href }))
);
console.log(stories);
await browser.disconnect();
Playwright provides the same ease of use. The chromium.connectOverCDP method connects to the existing CDP endpoint, and the rest of your code works identically. This compatibility allows you to migrate while preserving your existing test and scraping infrastructure.
Installation and Build Process
There are two ways to use Obscura. The first is downloading a pre-built binary. GitHub Releases provides packages for Linux x86_64, macOS Apple Silicon, macOS Intel, and Windows. Just extract the archive and run the binary. No installation wizard, dependency installer, or system restart required.
The second is building from source. Rust 1.75+ is required. The first build takes about five minutes because V8 compiles from source, but this is a one-time cost. After that, the compilation cache speeds things up dramatically. Use cargo build --release --features stealth to compile with stealth mode enabled. If you compile without stealth, the binary is slightly lighter. You can choose based on which features you need.
Who Is Obscura For?
Obscura does not fit every scraping need. If you are taking screenshots, generating PDFs, or visualizing complex CSS animations, Chrome might still be more suitable. Because Obscura is a lightweight automation engine, not a full rendering engine. But for data extraction, form filling, session-based automation, and AI agent content reading tasks, Obscura is far more efficient.
For those optimizing cloud server costs, running dozens of parallel processes, or needing to bypass anti-bot protections, Obscura is a serious alternative. The memory difference especially matters in container-based infrastructure (Kubernetes, Docker Swarm), allowing more pods/shards per node. Running three times more jobs on the same hardware directly reflects on your cloud bill.
Conclusion: The Browser of the Future?
Obscura is a beautiful example of Rust's systems-programming power moving into web automation. With 2.2K stars and 152 forks, community interest is high. The Apache 2.0 license makes it fully open source and free for commercial use. Because it is still very new, approach with care. The issue list has 11 entries, pull requests are at 3. Test it against your own use cases before deploying to production.
Still, the performance numbers and stealth capabilities cannot be ignored. Will it completely replace headless Chrome? Not in the short term, because ecosystem support and community maturity differ. But in the long term, especially for cost- and privacy-focused projects, Obscura and similar tools could become a major market force. The web scraping industry has complained about Chrome's monopoly for years. Obscura is one of the first serious challengers to that monopoly.
Have you tried Obscura? What tools do you use for web scraping? Share your experiences in the comments below. For deeper technical discussions, reach me through efeozkan.com.tr. Good tools, good code. But remember: always stay within ethical boundaries and respect robots.txt rules.
Efe Hüseyin Özkan
Software Engineer & AI Developer
Working on AI systems, full-stack development, and scalable product architecture. Follow the blog for more technical articles.