Skip to content

feat: add full-page screenshots to extension and CLI - #226

Open
iuyo5678 wants to merge 9 commits into
mainfrom
feat/long-screenshot
Open

feat: add full-page screenshots to extension and CLI#226
iuyo5678 wants to merge 9 commits into
mainfrom
feat/long-screenshot

Conversation

@iuyo5678

@iuyo5678 iuyo5678 commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Adds long screenshots to Quick actions and bsk screenshot --full-page. The popup supports automatic document scrolling, manual scrolling, visible-area capture, pause/resume, early finish, cancellation, tiled preview and PNG download. Quick Actions works independently of the CLI. Finished popup state is cleared when the user changes pages; existing previews remain usable.

Agents can use bsk screenshot --session <id> --full-page --out page.png, with an optional --timeout (default: two minutes for capture and encoding). This reuses the same scrolling, disk tiles and PNG encoder. The extension excludes the Agent overlay, restores page position/styles, and serves the PNG in session-scoped 256 KiB chunks. The CLI atomically replaces the output after receiving all bytes and releases the export after success or failure. Ctrl-C and the page Escape control cancel the operation. Full-page scrolling obeys session ownership and user-interrupt gates; viewport and ref screenshots retain their existing route and output shape.

Captures use 512-row OPFS tiles and streaming PNG encoding, avoiding a full-page canvas or whole-image base64 transport. Preview only loads nearby tiles. There is no fixed 32K-height or megapixel cutoff; storage capacity, PNG bounds and viewer capabilities still apply. Quick Actions can retain durable partial results, while Agent failures never report a partial image as a completed capture. Expired and abandoned Agent exports are cleaned separately from user previews.

Automatic capture reconnects its content script after extension reload and observes top-level navigation rather than subframe loading. Restricted browser/store pages support user-invoked manual or visible-area capture; Agent automatic capture requires a scriptable HTTP(S) document. Nested scroll containers and virtualized lists remain outside automatic full-page support. Manual alignment rejects ambiguous overlaps instead of guessing seams.

Validation:

  • 1,322 extension tests and 649 Rust tests passed; TypeScript, production builds/ZIP, formatting and CSS lint passed.
  • Five isolated CLI → daemon → Chrome scenarios passed: exact normal/Retina PNG scanlines and fixed footer, multi-chunk transfer, a 34,034-pixel page, timeout, Ctrl-C, page Escape, output errors, page restoration and temporary-file cleanup.
  • Ten real extension UI scenarios passed, including page-state reset, retained preview export, extension reload recovery, automatic/manual capture, pause/resume/early finish, cancellation, native download, Chrome internal pages and the Web Store.
  • Renderer PNG pixel regression passed. Capture, streaming PNG and alignment unit tests retain coverage of fractional offsets, large outputs, lazy content, cancellation and storage errors.

CLI help, protocol schemas, English/Chinese READMEs, the bundled Agent skill and docs/long-screenshot.md are updated. Use matching CLI and extension builds and restart an already-running daemon after upgrading the CLI.

@iuyo5678 iuyo5678 changed the title feat(extension): add full-page screenshot quick action feat(extension): add flexible long screenshot quick actions Sep 11, 2026
@iuyo5678
iuyo5678 marked this pull request as ready for review September 11, 2026 03:28
Reconnect screenshot content scripts in already-open documents instead of silently switching to manual capture. Track top-level navigation so loading subframes do not interrupt capture.
Scope completed popup state to its source page and discard it when browsing elsewhere. Preserve the capture preview during tab creation and keep open previews available for export.
@iuyo5678 iuyo5678 changed the title feat(extension): add flexible long screenshot quick actions feat: add full-page screenshots to extension and CLI Sep 11, 2026
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