Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

Add page --all full-page reading mode with scroll settling#12

Merged
4fuu merged 4 commits into
mainfrom
copilot/add-page-all-flag
Apr 13, 2026
Merged

Add page --all full-page reading mode with scroll settling#12
4fuu merged 4 commits into
mainfrom
copilot/add-page-all-flag

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 13, 2026

page only returned one viewport slice at a time, which made long or lazy-rendered pages incomplete unless callers manually paged through them. This change adds a CLI-orchestrated full-page mode that walks the page, waits for lazy content to render, and returns one aggregated reading view.

  • CLI surface

    • Added browser-cli page <session-id> --all
    • Added --settle <ms> for per-scroll delay in --all mode (500ms default)
    • Enforced flag exclusivity: --all cannot be combined with -p, --next, or --prev
    • Restricted --settle to --all
  • Full-page capture flow

    • Reuses existing SCROLL + GET_PAGE_FRESH actions from the CLI
    • Captures the initial snapshot, records original scroll_top, then iterates logical pages
    • Recomputes total_pages from each fresh snapshot so page growth from lazy loading is picked up
    • Restores the original scroll position after aggregation
  • Aggregation behavior

    • Parses each page with existing page-structure logic instead of merging raw DOM snapshots
    • Appends per-page nodes into a single reading-oriented PageData
    • Applies light leading-duplicate suppression across page boundaries to reduce sticky-header repetition
    • Reindexes output IDs and normalizes metadata to:
      • current_page = 1
      • total_pages = 1
      • truncated = false
  • Docs

    • Updated README.md, README.en.md, and SKILL.md with --all / --settle usage and guidance that --all is intended for reading, not follow-up element targeting
browser-cli page s123 --all
browser-cli page s123 --all --settle 1000 --json

Copilot AI linked an issue Apr 13, 2026 that may be closed by this pull request
Copilot AI and others added 3 commits April 13, 2026 15:44
Copilot AI changed the title [WIP] Add --all flag for page command to fetch full content Add page --all full-page reading mode with scroll settling Apr 13, 2026
Copilot finished work on behalf of 4fuu April 13, 2026 15:50
Copilot AI requested a review from 4fuu April 13, 2026 15:50
@4fuu 4fuu marked this pull request as ready for review April 13, 2026 15:52
@4fuu 4fuu merged commit aafed61 into main Apr 13, 2026
@4fuu 4fuu deleted the copilot/add-page-all-flag branch April 13, 2026 16:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: page --all 一次性抓取完整页面内容

2 participants