Skip to content

Release Notes - v0.10.0

Reusable page-evidence capture with SPA-aware settling, plus a one-shot fetch CLI command for grabbing a page without wiring up a session.

Highlights

pagecapture subpackage

A reusable package that captures normalized page evidence — screenshot, rendered HTML, visible text, and structure (title, lang, links, headings) — for reuse across accessibility, functional/journey, and internationalization consumers.

import "github.com/plexusone/w3pilot/pagecapture"

// Navigate, settle, and capture in one call.
ev, err := pagecapture.Capture(ctx, pilot, "https://example.com")

// Or capture the already-loaded page without navigating.
ev, err := pagecapture.CaptureCurrent(ctx, pilot)

// Or crawl same-host <a href> links.
site, err := pagecapture.CaptureSite(ctx, pilot, "https://example.com")

SPA-aware settling

The default SettleDOMStable polls the DOM until it stops changing and holds real content, gated by a minimum-settle floor. Client-rendered apps never reliably reach the load event or network-idle, and settling too early captures a half-rendered shell — the floor plus consecutive-stable-sample check fixes that.

cfg := pagecapture.Config{
    SettleMode: pagecapture.SettleDOMStable, // default
    MinSettle:  2500 * time.Millisecond,     // floor before capture
}

fetch CLI command

Fetch a page's rendered text or HTML in one shot — launch, navigate, wait, and extract — without managing a session by hand.

w3pilot fetch https://example.com                        # visible text
w3pilot fetch https://example.com --html                 # full rendered HTML
w3pilot fetch https://spa.example.com --wait networkidle  # wait for network to settle
w3pilot fetch https://example.com --format json          # {url,title,content}

Upgrading

No breaking API changes. pagecapture is additive and depends only on the w3pilot root package plus the standard library, so importing the root package is not affected.

go get github.com/plexusone/[email protected]