Skip to content

Add wait-for, cookies, and wait-timeout for authenticated dashboards (v2.2.0) - #10

Merged
Helvio88 merged 1 commit into
masterfrom
cursor/wait-for-cookies-3b52
Aug 13, 2026
Merged

Add wait-for, cookies, and wait-timeout for authenticated dashboards (v2.2.0)#10
Helvio88 merged 1 commit into
masterfrom
cursor/wait-for-cookies-3b52

Conversation

@Helvio88

Copy link
Copy Markdown
Owner

Summary

Makes web-screenshot usable on login-gated / slow SPA dashboards generically, using CLI flags and batch-file lines only. No environment variables.

Wait for a selector

  • -s / --wait-for <selector> calls Puppeteer page.waitForSelector after networkidle2
  • --wait-timeout [s] (default 30, clamped 1–600) is that wait
  • Existing -t extra wait still runs after the selector (or after idle if no selector)

Cookie / session auth

  • --cookies <file> loads cookies before navigation
  • Accepts a JSON array of Puppeteer cookies, Playwright storageState JSON, or a Netscape cookie file
  • Cookies missing url and domain use the screenshot URL
  • Existing -a / --auth user:pass still does HTTP basic/NTLM via page.authenticate

Batch

New flags work on batch lines the same way as other options (quote-aware parser).

Docs / version

  • README examples use https://example.com / dashboard language only
  • Flags only — no WEB_SCREENSHOT_* or other env fallbacks
  • CHANGELOG + version 2.2.0
  • Not published to npm

Test plan

  • npm test (no live network; mocked browser)
  • Unit tests for wait-for planning, env ignored vs flags, cookie file load (JSON array, storageState, Netscape)
  • Batch parser accepts --wait-for, --wait-timeout, --cookies, quoted selectors
  • Lint, typecheck, and dist/ rebuild match CI
Open in Web Open in Cursor 

Wait for a CSS selector after network idle, then apply the existing extra
-t delay. Load session cookies from a JSON, Playwright storageState, or
Netscape file before navigation. All options are CLI/batch flags only.

Co-authored-by: Helvio Pedreschi <Helvio88@users.noreply.github.com>
@Helvio88
Helvio88 marked this pull request as ready for review August 13, 2026 04:58
@Helvio88
Helvio88 merged commit aa470f4 into master Aug 13, 2026
1 check passed
@Helvio88
Helvio88 deleted the cursor/wait-for-cookies-3b52 branch August 13, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants