Skip to content

feat: add force viewport screenshot - #1694

Merged
unclecode merged 1 commit into
unclecode:developfrom
theredrad:feat-add-force-viewport-screenshot
Feb 1, 2026
Merged

unclecode merged 1 commit into
unclecode:developfrom
theredrad:feat-add-force-viewport-screenshot

Conversation

@theredrad

@theredrad theredrad commented Jan 6, 2026 •

Copy link
Copy Markdown
Contributor

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.py
    Adds a new configuration option to enable capturing screenshots limited to the viewport.
  • crawl4ai/async_crawler_strategy.py
    Implements 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 True and False on short and long pages, verifying that the correct screenshot type is produced in each case.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added/updated unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@theredrad

Copy link
Copy Markdown
Contributor Author

cc @unclecode

@theredrad

Copy link
Copy Markdown
Contributor Author

cc @ntohidi

@theredrad

Copy link
Copy Markdown
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!

@unclecode
unclecode changed the base branch from main to develop February 1, 2026 01:00
@unclecode

unclecode commented Feb 1, 2026 •

Copy link
Copy Markdown
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
@unclecode
unclecode merged commit e19492a into unclecode:develop Feb 1, 2026
@unclecode

Copy link
Copy Markdown
Owner

This has been merged into develop. Closing.

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