The headless browser for AI agents and web scraping
fix(cli): simplify screenshot capture
SGavrl806cee4bacc5
diff --git a/README.md b/README.mdindex e9994b08..1ff383c5 100644--- a/README.md+++ b/README.md@@ -13,16 +13,16 @@</p><p align="center"><strong>The open-source headless browser for AI agents and web scraping.</strong><br>- Lightweight, stealthy, and built in Rust.+ Independent, scriptable, and built in Rust.</p>---Obscura is a headless browser engine written in Rust for web scraping and AI-agent automation. It runs JavaScript through V8, owns its DOM, layout, and paint pipeline, and exposes Chrome DevTools Protocol (CDP) compatibility for common Puppeteer and Playwright workflows.-### Why Obscura over headless Chrome?+### How Obscura differs from headless Chrome-Designed for automation at scale, not desktop browsing.+Obscura is scoped to headless automation rather than desktop browsing.| Capability | Obscura | Headless Chrome ||------------|---------|-----------------|@@ -41,7 +41,7 @@ workload with identical inputs, before making capacity decisions.We are working on **Obscura Cloud** the hosted version, with managed infrastructure, residential proxies, and dedicated support. For people who want the engine without operating it themselves.-The open-source engine stays Apache-2.0, fully featured. No feature gating, ever.+The open-source engine remains available under Apache-2.0.**[Get on the waitlist →](https://tally.so/r/gDWzdD)**<br>@@ -175,7 +175,7 @@ tar xzf obscura-x86_64-macos.tar.gzDownload the `.zip` from the releases page and extract it manually.```-No Chrome, no Node.js, no dependencies. Release archives include both+No Chrome or Node.js runtime is required. Release archives include both`obscura` and `obscura-worker`; keep them in the same directory for theparallel `scrape` command.@@ -250,12 +250,15 @@ obscura fetch https://example.com --timeout 10# Capture the settled page as PNGobscura fetch https://example.com --screenshot page.png++# The screenshot flag also has a short form+obscura fetch https://example.com -s page.png```## Rendering and captureOfficial release archives and the Docker image include the rendering engine.-It provides modern CSS layout and paint, viewport and full-page screenshots,+It provides CSS layout and paint, viewport and full-page screenshots,scroll-aware fixed and sticky geometry, activity-driven CDP screencasting, andraster PDF export without starting Chromium.@@ -266,9 +269,9 @@ await page.screenshot({ path: 'page.png', fullPage: true });await page.pdf({ path: 'page.pdf', format: 'A4', printBackground: true });```-The engine covers the common block, inline, flex, grid, table, float,+The current implementation covers block, inline, flex, grid, table, float,positioning, overflow, transform, text, image, SVG, canvas, background, border,-and animation paths used by modern sites. It remains an evolving independent+and animation paths. It remains an evolving independentengine: long-tail CSS, some Web APIs, media playback, compositor effects, andplatform font rasterization may differ from Chromium. See the[rendering guide](docs/Rendering-screenshots-screencasting-and-PDF.md) for@@ -359,17 +362,9 @@ await page.evaluate(() => {## Benchmarks-Historical page-load samples from the benchmark repository:--| Page | Obscura | Chrome |-|------|---------|--------|-| Static HTML | **51 ms** | ~500 ms |-| JS + XHR + fetch | **84 ms** | ~800 ms |-| Dynamic scripts | **78 ms** | ~700 ms |--These figures are not universal performance guarantees. The full benchmark-suite (WPT conformance, obstacle course, real-world corpus, and comparative-speed tests) lives in a separate repo:+Performance depends on the page, network, hardware, enabled features, and+capture settings. The benchmark suite contains WPT conformance checks, an+obstacle course, a real-world corpus, and comparative speed tests:https://github.com/h4ckf0r0day/obscura-benchmark## Stealth Mode@@ -451,7 +446,7 @@ Fetch and render a single page.| `--timeout` | `30` | Maximum navigation time in seconds || `--wait` | adaptive, up to `5` | Post-load settling; an explicit value is a fixed delay in seconds || `--selector` | — | Wait for CSS selector |-| `--screenshot` | — | Write a PNG screenshot (single URL; render-enabled build) |+| `-s`, `--screenshot` | — | Write a PNG screenshot (single URL; render-enabled build) || `--stealth` | off | Anti-detection mode || `--output` | — | Write dump or eval output to a file || `--quiet` | off | Suppress banner |diff --git a/RENDER.md b/RENDER.mdindex f48a64ca..4cb4c0df 100644--- a/RENDER.md+++ b/RENDER.md@@ -37,7 +37,7 @@ SVG, canvas, generated content, and animation sampling. Layout is retained andinvalidated by relevant DOM/style/resource mutations so geometry and captureobserve the same page state.-This is broad browser-rendering support, not a claim that every long-tail CSS,+This is browser-rendering support, not a claim that every long-tail CSS,DOM, compositor, font, or graphics behavior is already identical to Chromium.Test the sites and workflows that matter to you and report reduced fixturesfor reproducible differences.@@ -58,7 +58,7 @@ CSS paged-media support.## Verification-Rendering changes are checked with deterministic fixtures first, then a broad+Rendering changes are checked with deterministic fixtures first, then areal-site suite against Chromium. Captures must use the same viewport, identity,settle policy, animation time, scroll position, and output boundary. Pixelerror is a regression tripwire, not a standalone correctness verdict; geometry,diff --git a/crates/obscura-cli/src/main.rs b/crates/obscura-cli/src/main.rsindex e7ff681f..21a2d965 100644--- a/crates/obscura-cli/src/main.rs+++ b/crates/obscura-cli/src/main.rs@@ -156,9 +156,8 @@ enum Command {#[arg(long)]storage_dir: Option<std::path::PathBuf>,- /// Render the page to a PNG screenshot at this path. Requires a build- /// with the `render` feature.- #[arg(long)]+ /// Capture the settled page as a PNG. Requires the `render` feature.+ #[arg(long, short = 's', value_name = "FILE", conflicts_with = "file")]screenshot: Option<std::path::PathBuf>,},@@ -2234,6 +2233,34 @@ mod tests {}}+ #[test]+ fn fetch_screenshot_has_a_short_alias_and_rejects_batch_mode() {+ let args = Args::try_parse_from([+ "obscura",+ "fetch",+ "https://example.com",+ "-s",+ "page.png",+ ])+ .unwrap();+ match args.command {+ Some(Command::Fetch { screenshot, .. }) => {+ assert_eq!(screenshot, Some(std::path::PathBuf::from("page.png")));+ }+ _ => panic!("expected Fetch command"),+ }++ assert!(Args::try_parse_from([+ "obscura",+ "fetch",+ "--file",+ "urls.txt",+ "--screenshot",+ "page.png",+ ])+ .is_err());+ }+fn configured_fetch_timeout(args: Args) -> std::time::Duration {let timeout = match args.command {Some(Command::Fetch { timeout, .. }) => timeout,diff --git a/docs/CLI-reference.md b/docs/CLI-reference.mdindex 3e59d2e4..18a5a427 100644--- a/docs/CLI-reference.md+++ b/docs/CLI-reference.md@@ -33,7 +33,7 @@ Load a URL and print its content or an evaluated expression.--stealth Consistent browser fingerprint + tracker blocking (global)-e, --eval <JS> Evaluate JS, print the result as JSON-o, --output <FILE> Write to a file instead of stdout- --screenshot <FILE> Render the settled page to PNG (single URL)+-s, --screenshot <FILE> Capture the settled page as PNG (single URL)-q, --quiet Suppress info logging-v, --verbose Enable verbose logging```diff --git a/docs/Connect-Puppeteer-or-Playwright.md b/docs/Connect-Puppeteer-or-Playwright.mdindex 9de78db7..e0211067 100644--- a/docs/Connect-Puppeteer-or-Playwright.md+++ b/docs/Connect-Puppeteer-or-Playwright.md@@ -1,4 +1,5 @@-Obscura speaks the Chrome DevTools Protocol over WebSocket. Puppeteer and Playwright connect to it like remote Chrome.+Obscura speaks the Chrome DevTools Protocol over WebSocket. Puppeteer and+Playwright can connect to its CDP endpoint for the supported workflows below.## Start the serverdiff --git a/docs/Rendering-screenshots-screencasting-and-PDF.md b/docs/Rendering-screenshots-screencasting-and-PDF.mdindex 8b7fce10..1813c42f 100644--- a/docs/Rendering-screenshots-screencasting-and-PDF.md+++ b/docs/Rendering-screenshots-screencasting-and-PDF.md@@ -14,6 +14,7 @@ Capture the settled page as a PNG:```bashobscura fetch https://example.com --screenshot page.png --timeout 30+# Equivalent short form: obscura fetch https://example.com -s page.png```JavaScript supplied with `--eval` runs before capture, so it can prepare or@@ -186,8 +187,8 @@ screencast frames; use the CDP API for that workflow.## Current boundaries-Obscura implements broad modern layout and paint support, including block and-inline formatting, flexbox, grid, tables, floats, positioned/fixed/sticky+The current renderer implements block and inline formatting, flexbox, grid,+tables, floats, positioned/fixed/stickyboxes, transforms, overflow, text and web fonts, images, SVG, canvas,backgrounds, borders, clipping, generated content, and animation sampling.diff --git a/skills/obscura/SKILL.md b/skills/obscura/SKILL.mdindex af651d43..bc47d818 100644--- a/skills/obscura/SKILL.md+++ b/skills/obscura/SKILL.md@@ -95,7 +95,7 @@ fixture. Do not introduce hostname-specific rendering logic.## Set expectations accurately-Obscura has broad modern layout and paint coverage but is not a bundled Chrome+Obscura supports many common layout and paint paths but is not a bundled Chromebuild. Long-tail CSS, service workers, some Web APIs, native media, GPU orcompositor effects, PDF structure, and platform font rasterization can differfrom Chromium. Measure performance and fidelity on the user's actual workload;