Devtools resize viewport dimensions overlay included in screenshots
See original GitHub issueSteps 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();
})();
- Run the above script
- open
example.png
What is the expected result?

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.

Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The issue can be solved by rolling back to previous behaviour. To do so, you should pass argument
captureBeyondViewport: falseto screenshot, implemented in the PR #7063Feel free to reopen the issue if the approach doesn’t work for you.