Repository navigation
feat: add force viewport screenshot - #1694
Merged
unclecode merged 1 commit intoFeb 1, 2026
Merged
Conversation
Contributor
Author
|
cc @unclecode |
Contributor
Author
|
cc @ntohidi |
Contributor
Author
|
@unclecode @ntohidi Hi, could you please help me by reviewing this PR or let me know if something's missing here? I'm waiting for a review for more than 1 month! |
Owner
|
Thanks for this clean contribution @theredrad! I've merged this into develop. It will be included in the next release (0.8.1) and we'll acknowledge your contribution. Appreciate the well-scoped PR, viewport-only screenshots are a solid addition for users who don't need full-page captures. |
unclecode
added a commit
that referenced
this pull request
Feb 1, 2026
- Add TheRedRad to CONTRIBUTORS.md for PR #1694 - Document force_viewport_screenshot in API parameters reference - Add viewport screenshot note in browser-crawler-config guide - Add viewport-only screenshot example in screenshot docs
Owner
|
This has been merged into develop. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
At the moment, the crawler only supports full-page screenshots. In some cases, users only need a viewport screenshot, which is significantly smaller and faster to capture, especially for long pages. This change introduces optional viewport-only screenshots to address that use case.
List of files changed and why
crawl4ai/async_configs.pyAdds a new configuration option to enable capturing screenshots limited to the viewport.
crawl4ai/async_crawler_strategy.pyImplements the logic for capturing viewport-only screenshots (no scrolling, naive).
How Has This Been Tested?
I tested the feature by capturing screenshots with the viewport option set to both
TrueandFalseon short and long pages, verifying that the correct screenshot type is produced in each case.Checklist: