question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

8.0.0 how to take a screenshot without blinking viewport

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 8.0.0
  • Platform / OS version: macOS
  • URLs (if applicable): -
  • Node.js version: 14

What steps will reproduce the problem?

Please include code that reproduces the issue.

  1. Open browser with changed defaultViewport
  2. Open page
  3. Take a screenshot
const browser = await puppeteer.launch({
  headless: true,
  defaultViewport: {
      // MacBook PRO 13"
      width: 1366,
      height: 900,
      deviceScaleFactor: 2,
    },
});

const page = await browser.newPage();

await page.goto(link);

await page.screenshot({
    type: 'jpeg',
    quality: 80,
  });

What is the expected result?

Normal screenshot as it was in version 6.0.0

What happens instead?

Sometimes it is ok, sometimes page is resized to some small dimension, sometimes screenshot it seems to taken in the middle of page resize O_o

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

6reactions
mahnunchikcommented, Apr 1, 2021

Setting captureBeyondViewport to false solves the issue: https://github.com/puppeteer/puppeteer/blob/v8.0.0/src/common/Page.ts#L1727-L1732

How to set this option from page.screenshot? 🤔

0reactions
stale[bot]commented, Jul 24, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to enable/disable screenshot flash on ... - AddictiveTips
Open the Settings app. · Go to the Ease of Access group of settings. · Select the Display tab. · Look for the...
Read more >
How to Take a Screenshot on Windows (7, 8, 10), and Save ...
Taking a screenshot with LightShot. To save the files, you can either press the save icon or use the Windows standard Ctrl +...
Read more >
How to Enable/Disable Screenshot Flash on Windows 10
How to Enable/Disable Screenshot Flash on Windows 10. Windows 10 supports two different methods for taking screenshots ; PrntScrn, ...
Read more >
1493742 - Flickering of (some) sticky elements on Twitter and ...
For some weeks I see some flickering and invalidating issue on some pages that use position:fixed (and maybe position: sticky too), while scrolling....
Read more >
HelpScribble Version History
If you ever hit a snag with HelpScribble, check here whether you have the ... help compilers now shows its progress without flickering...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found