Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: not working long page screenshot #403

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

TheCutestCat
Copy link
Contributor

Bug fix for long page screenshot.

Error:

The fixed SCREENSHOT_HEIGHT_TRESHOLD (default 10000) was too large, preventing scrolling for most pages. This resulted in only single viewport screenshots instead of full-page captures.

Fix:

Replaced the threshold check with a comparison of scrollHeight and viewportHeight. Scrolling now occurs when scrollHeight exceeds viewportHeight, ensuring full-page screenshots.

@unclecode unclecode merged commit 07b4c1c into unclecode:main Jan 5, 2025
@unclecode
Copy link
Owner

Thanks for this great improvement to the screenshot logic! The refactoring makes the code more efficient by avoiding unnecessary scrolling operations. I've approved the PR and will merge it.

As a small enhancement, we could add error handling to page_need_scroll, but I can follow up with that change.

By the way, I really appreciate your contribution. If you're interested in becoming a regular collaborator, we have a Discord community where we discuss features and improvements. Let me know if you'd like to join, if you are please share your email address I will share.

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