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.

Devtools resize viewport dimensions overlay included in screenshots

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 7.0.0
  • Platform / OS version: MacOS Big Sur
  • URLs (if applicable): -
  • Node.js version: 14.13.0

What steps will reproduce the problem?

const puppeteer = require('puppeteer');

(async () => {
    const browser = await puppeteer.launch({
        headless: false,
        devtools: true,
    });
    const page = await browser.newPage();
    await page.goto('https://example.com');

    await page.screenshot({ path: 'example.png', fullPage: true });

    await browser.close();
})();
  1. Run the above script
  2. open example.png

What is the expected result?

example

What happens instead?

Notice the viewport dimensions in the top right corner of the screenshot. I expect them not to be there. They are seemingly injected by the devtools somehow. They are not present when the devtools panel isn’t open. Doesn’t seem to be injected into the pages HTML either, otherwise I’d be able to hide it via CSS or something.

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sadym-chromiumcommented, Apr 13, 2021

The issue can be solved by rolling back to previous behaviour. To do so, you should pass argument captureBeyondViewport: false to screenshot, implemented in the PR #7063

0reactions
sadym-chromiumcommented, Apr 13, 2021

Feel free to reopen the issue if the approach doesn’t work for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Performance features reference - Chrome Developers
A reference on all the ways to record and analyze performance in Chrome DevTools.
Read more >
1003629 - Capture Node does not screenshot the ... - Monorail
Alternative solution (and probably preferred) for this issue would be to set the viewport to contents size before taking the screenshot.
Read more >
Set size of browser inner window for screenshots in Chrome
Set size of browser inner window for screenshots in Chrome · 2. Click the Toggle Device Mode option near top left of the...
Read more >
Overlay domain - Chrome DevTools Protocol - GitHub Pages
Chrome DevTools Protocol - version tot - Overlay domain. ... Whether to include distance info. ... Paints viewport size upon main frame resize....
Read more >
The trick to viewport units on mobile | CSS-Tricks
First we get the viewport height and we multiple it by 1% to get a ... We can update the value of --vh...
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