Skip to content

feat: render pages in a local Chrome over CDP (--render-cdp) #2306

In progress

Description

@STsubmission

Problem or use case

Rendering JavaScript-built pages needs the cloud and a sign-in today. Teams that already run a headless Chrome (agent-browser, Playwright, browserless, a CI image with Chrome) can't point squirrelscan at it. Those teams also can't render pages the cloud browser can't reach: staging hosts on a private network, and pages behind a login.

The audit controller already accepts a caller-supplied DocumentFetcher (apps/cli/src/controllers/audit.ts, options.documentFetcher), but no flag or config sets it, and the workspace packages are private, so it can't be reached from outside.

Proposed behavior

  • New flag --render-cdp <url> and config [render] cdp_url in squirrel.toml. The URL is a Chrome DevTools Protocol endpoint (ws://… or http://host:port).
  • When set, the audit uses a cdp-render DocumentFetcher. It opens each HTML page in that browser and returns the rendered HTML with the main document's status, headers and redirect chain.
  • --render-mode auto|all works as it does for cloud rendering. auto reuses createHybridDocumentFetcher, so only client-rendered shells go to the browser.
  • It works signed out and uses no credits. It never sends anything to the squirrelscan cloud.
  • On a per-page render failure, timeout or bot wall, that page falls back to plain HTTP, like the cloud fetcher. If the endpoint is unreachable at start, the whole run uses plain HTTP and the report says why.
  • The browser's saved state (cookies, storage) is used as is, so a page behind a login renders when the browser is already signed in.

Alternatives considered

  • Pre-render pages and audit saved HTML: there is no input for saved pages today.
  • Carry a local patch that sets documentFetcher: works, but every user who wants this maintains the same patch.

Who it helps

CLI users and coding agents auditing staging sites, pages behind a login, or sites in CI where Chrome is already present. Agencies auditing many client sites from their own browser infrastructure.

Triage

Confirmed as a feature request. apps/cli/src/controllers/audit.ts already accepts options.documentFetcher (returned first by the fetcher resolver) and has createHybridDocumentFetcher for auto mode, but no flag or config key sets a custom fetcher, so there is no way to reach it from the CLI today. Related public issue: #1285 (cloud rendering still fetches the target from the user's machine).

Acceptance Criteria

  • Signed out, squirrel audit <url> --render-cdp <endpoint> --render-mode all renders every crawled HTML page in that browser, and the report marks the crawl as rendered.
  • With --render-mode auto, only pages detected as client-rendered shells are opened in the browser.
  • If the endpoint is unreachable, the audit finishes on plain HTTP and the report states the fallback reason.
  • robots.txt and the crawl's page limits apply exactly as with plain HTTP; the browser never opens a page the crawler would skip.
  • --render-cdp combined with --http is refused with a clear error.
  • The new behavior is documented in the browser rendering guide.

We're happy to send the PR (with DCO sign-off) if the approach is acceptable.


Generated by Claude Code

Activity

  1. added
    in-progress
    on Nov 24, 2026
  2. self-assigned this
    on Nov 24, 2026
  3. added
    enhancement
    size: L
    on Nov 24, 2026
  4. added theissue type on Nov 24, 2026
  5. nc9 commented on Nov 24, 2026

    @nc9
    Contributor

    I've had this on the backburner for a while thinking about how to architect it so that its adaptable - will be picking this up shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

clienhancementin-progresssize: L

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions