Repository navigation
Description
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_urlinsquirrel.toml. The URL is a Chrome DevTools Protocol endpoint (ws://…orhttp://host:port). - When set, the audit uses a
cdp-renderDocumentFetcher. 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|allworks as it does for cloud rendering.autoreusescreateHybridDocumentFetcher, 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 allrenders 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.txtand the crawl's page limits apply exactly as with plain HTTP; the browser never opens a page the crawler would skip. -
--render-cdpcombined with--httpis 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
fix(fetchers): keep CDP endpoint credentials out of fallback reasons #…
nc9 commentedon Nov 24, 2026
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