handle-infinite-scroll
Skill8 starsChanged 7 months agoMITView on GitHub
Scrolls a page to load additional content via infinite-scroll, with stop conditions (no-more-content, max iterations, or target selector visible). Used for feeds, lists, and search results that lazy-load.
In this repository14 other files it gives its agents.
- date-picker-widgetSkill
- detect-captchaSkill
- dismiss-cookie-bannerSkill
- dismiss-newsletter-popupSkill
- exit-tracking-popupSkill
- extract-table-paginationSkill
- fill-multi-step-formSkill
- handle-modal-dialogSkill
- login-flowSkill
- pagination-next-pageSkill
- searchable-dropdownSkill
- search-and-filterSkill
- upload-download-fileSkill
- verify-page-loadedSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 59
JS-heavy sites that pause loading on tab-blur: if the test runs in a headless context that the site sniffs as "not visible," loading never …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Handle Infinite Scroll
When to invoke
When the page extends its content as the user scrolls down (Twitter/X feeds, Reddit posts, Instagram search, news homepages, search-result feeds). The matcher cannot easily detect infinite-scroll a priori — it's a runtime behavior, not a DOM marker. So this skill is typically invoked when:
- The user task explicitly mentions "scroll to load more" / "all posts" / "everything available"
- A previous
extract_*skill returned fewer rows than the user expected - The page has
<button>Load more</button>(visual cue) — though "load more" buttons are a different skill,pagination-next-page
Recipe
- wait_for_dom_ready timeout=3s
- scroll_until condition="no_more_content" max_iters=20 delay=400ms
- wait extra=500ms
Success criteria
- assert scrolled_at_least_once
There's no strict "succeeded" semantic here — if max_iters was hit, the skill returns success and the caller decides if it has enough rows. The trace records the actual iteration count and final page height.
Configurable knobs
The recipe above is the default. Authors can override via the agent invoking with vars:
vars.max_scroll_iters→ overridesmax_iters(cap: 100)vars.target_selector→ switches condition toselector_present:<css>(stops when the named selector becomes visible)
When NOT to use
- The page paginates instead of scrolling — use
pagination-next-page. - The "infinite" scroll is actually a "load more" button — use
pagination-next-page(the button-click variant). - Virtualized lists where scrolling DESTROYS earlier rows from the DOM (some React virtualization). The extractor must be invoked during the scroll loop, not after — a future composite skill
infinite-scroll-and-extractwill handle this.
Known failures
- Virtualized lists (~15% of modern feeds): offscreen rows are unmounted; by the time
scroll_untilstops, only the last viewport's rows are in the DOM. Workaround: invokeextract_*skill at each iteration (manual composition). - JS-heavy sites that pause loading on tab-blur: if the test runs in a headless context that the site sniffs as "not visible," loading never triggers. Use
--headedmode for these. - Sites with anti-scroll-bot detection: some sites detect "too fast" scrolling and stop serving content.
delay=400msis calibrated for "human-like"; lower values trigger blocks. - Sites that load content based on screen size: running with a tiny viewport produces fewer rows per scroll. Default viewport in
start_browseris 1280×800 — keep that for benchmark consistency.
Example usage
Agent task: "Show me all posts on this Reddit page."
→ invoke_skill("verify-page-loaded") → success
→ invoke_skill("handle-infinite-scroll") → success, scrolled 12 times
→ invoke_skill("extract-list-pagination") → all rows capturedRelated skills
pagination-next-page— for paginated alternatives to infinite scrollverify-page-loaded— run first; need a stable initial stateextract-table-pagination/extract-list-pagination— typically chained after scrolling
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

