sindresorhus / capture-website

Capture screenshots of websites
MIT License
1.93k stars 137 forks source link

workaround fullPage clipping bug by using clip #95

Closed shemgp closed 2 years ago

shemgp commented 2 years ago

Fixes: #1

Actually, puppeteer, when using fullPage: true does get the whole screen, so no need to scroll around when capturing FIXED items. (So the issueHunt bounty might have to go to someone since it's already fixed.)

However, puppeteer does clip the body's margin-right: clipped This PR solves that by getting the body's margin-right and using clip to include it in fullPage.

Of course, if you give me the issueHunt bounty, it will be great :)


IssueHunt Summary ### Referenced issues This pull request has been submitted to: - [#1: Full page screenshot](https://issuehunt.io/repos/169625338/issues/1) ---
sindresorhus commented 2 years ago

when using fullPage: true does get the whole screen, so no need to scroll around when capturing FIXED items

Does it cause lazy-loaded items further down the page to load?

sindresorhus commented 2 years ago

However, puppeteer does clip the body's margin-right:

Can you open a Puppeteer issue about that?

shemgp commented 2 years ago

Upon further investigation, I think this PR is not needed anymore since all it does is add the right body margin so that it's the same with the left, where as in both Chrome and Firefox, that right margin is not shown by default, so it's not a bug in Puppeteer.

Chrome: Screenshot from 2022-01-23 18-57-28

Firefox: Screenshot from 2022-01-23 18-57-26

So #1 was actually fixed already via #28. So bounty could go to the author. But could go to me to for pointing out that it's fixed :) hehe

sindresorhus commented 2 years ago

So #1 was actually fixed already via #28. So bounty could go to the author. But could go to me to for pointing out that it's fixed :) hehe

It was not completely fixed. See: https://github.com/sindresorhus/capture-website/pull/65