End-to-end rasterization behind the render feature (which now enables obscura-render/paint): - obscura-render: screenshot_png(dom, viewport) paints and encodes to PNG via tiny-skia's encode_png (no extra dep). - obscura-browser: Page::screenshot renders the live DOM at a viewport. - CLI: obscura fetch --screenshot out.png writes the settled page to a PNG. - CDP: Page.captureScreenshot returns the PNG base64-encoded, so Puppeteer/Playwright page.screenshot() works. captureSnapshot still errors (it is a DOM/layer snapshot, not an image). Verified: both paths produce correct 1280x720 RGBA PNGs with elements laid out and colored as the CSS specifies (block stacking, backgrounds, white page). Default build unchanged; obstacle course 33/33. Text, borders, and images are not yet painted; the box layout and background colors are rendered.
36 lines
919 B
TOML
36 lines
919 B
TOML
[package]
|
|
name = "obscura-cdp"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
|
|
[features]
|
|
default = []
|
|
# Enable Page.captureScreenshot via obscura-render. Propagates render to
|
|
# obscura-browser so Page::screenshot is available.
|
|
render = ["obscura-browser/render"]
|
|
|
|
[dependencies]
|
|
obscura-dom = { workspace = true }
|
|
obscura-browser = { workspace = true }
|
|
obscura-js = { workspace = true }
|
|
tokio = { workspace = true }
|
|
tokio-tungstenite = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
url = { workspace = true }
|
|
uuid = { workspace = true }
|
|
tracing = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
base64 = { workspace = true }
|
|
futures-util = "0.3"
|
|
base64 = "0.22"
|
|
obscura-net = { workspace = true }
|
|
|
|
[target.'cfg(target_env = "gnu")'.dependencies]
|
|
libc = "0.2"
|
|
|
|
[dev-dependencies]
|
|
tokio-tungstenite = { workspace = true }
|
|
futures-util = "0.3"
|