Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutepage.setViewport() sets Puppeteer’s page viewport; it does not guarantee that the browser window, live CSS viewport, full document, or screenshot bitmap has the same dimensions. First identify which dimensions you mean, then measure that surface directly. Puppeteer’s page.viewport() returns the configured settings “without checking the actual page viewport.”
Which dimensions are you comparing?
“Page dimensions” can refer to several different surfaces. They are related, but they are not interchangeable, and they may use different units or include different parts of the browser.
As an Amazon Associate I earn from qualifying purchases.
| What you mean | How to inspect it | What it represents |
|---|---|---|
| Configured viewport | page.viewport() |
Puppeteer’s stored viewport settings—not a measurement of the live page. |
| Live CSS viewport | window.innerWidth and window.innerHeight |
The page’s current viewport dimensions in CSS pixels. |
| Outer browser window | window.outerWidth and window.outerHeight |
The browser window dimensions, which can include space beyond the page content area. |
| Document or full-page extent | Document dimensions or screenshot options such as fullPage |
The page’s scrollable extent, which may be larger than the visible viewport. |
| Screenshot bitmap | The screenshot output and its capture options | The image produced by viewport capture, full-page capture, or a clip; its pixel dimensions need not equal CSS viewport dimensions. |
Puppeteer’s default viewport is 800 × 600 unless overridden. That is a viewport setting, not a promise that the outer browser window will be 800 × 600. See the Puppeteer ConnectOptions documentation for the documented default.
Measure the live page before changing settings
Log the configured viewport and evaluate the actual browser-reported dimensions in the page context. This runnable Node.js example prints both:
#1 Best Overall
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({ width: 1280, height: 800 });
await page.goto('https://example.com');
console.log('Configured viewport:', page.viewport());
console.log('Live window dimensions:', await page.evaluate(() => ({
innerWidth: window.innerWidth,
innerHeight: window.innerHeight,
outerWidth: window.outerWidth,
outerHeight: window.outerHeight,
})));
await browser.close();
})();
Use innerWidth and innerHeight when you need the live page viewport; compare outerWidth and outerHeight when you suspect the browser window itself is the mismatch. Puppeteer’s window-management guide demonstrates that inner and outer sizes can differ.
Set the responsive page viewport before navigation
For a responsive layout test or a screenshot of a particular CSS viewport, set the viewport before navigating when practical:
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
await page.setViewport({
width: 1280,
height: 800,
deviceScaleFactor: 1,
});
await page.goto('https://example.com');
The Puppeteer Page.setViewport() reference warns that many websites do not expect phones to change size, so setting the viewport before navigation is preferable. Changes involving isMobile or hasTouch can reload the page. Use deviceScaleFactor when the intended rendering scale matters; CSS dimensions and output image pixels are not necessarily the same.
Set the browser content area instead
If your target is the browser’s page content area—not merely Puppeteer’s configured viewport—the current Puppeteer window-management guide shows removing the default viewport constraint and resizing the page content area:
Rank #3
await page.setViewport(null);
await page.resize({ contentWidth: 600, contentHeight: 400 });
page.resize() is marked experimental in the Puppeteer Page API, so its status may change. The guide’s example reports a 600 × 400 content area and a 600 × 487 outer window; the extra outer height illustrates why content and window dimensions differ. That figure is the guide’s example, not a universal browser-chrome measurement. Because resize reporting is asynchronous, wait for a resize event before reading the new values. The guide includes a window-management example.
Check screenshot options when the image is the wrong size
A screenshot is not a direct synonym for the viewport. Review the capture options and choose the surface you intend to save:
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
fullPagecaptures the page beyond the visible viewport.cliprestricts the capture to a specified rectangle.captureBeyondViewportaffects whether capture can extend beyond the viewport.deviceScaleFactoraffects rendering scale, so do not assume bitmap pixels equal CSS pixels.
These are separate capture controls documented in Puppeteer’s ScreenshotOptions reference. For example, if the viewport is correct but the screenshot is taller than expected, check whether fullPage is enabled before changing the viewport.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsHeadless screen size is a separate setting
Puppeteer documents an 800 × 600 default headless screen unless --window-size is specified. The --screen-info option is available only in headless mode. Screen configuration does not replace the page viewport setting; change the setting that corresponds to the dimensions your code actually measures. See Puppeteer’s screen configuration guide.
Best Value
Common mismatch symptoms and fixes
page.viewport()looks right, butinnerWidthdoes not: the first value is stored configuration, not a live measurement. Evaluatewindow.innerWidthandwindow.innerHeightafter navigation.- Outer dimensions differ from inner dimensions: you are comparing the browser window with its page content area. Use
page.resize({ contentWidth, contentHeight })for the documented content-area workflow, noting its experimental status. - The screenshot is larger than the viewport: inspect
fullPage,clip, andcaptureBeyondViewportbefore changing viewport settings. - A mobile layout changes or reloads unexpectedly: set viewport options before navigation when possible, especially when changing
isMobileorhasTouch. - Image pixels do not match CSS pixel counts: check
deviceScaleFactorand the capture mode; these describe different dimensions. - Click coordinates seem offset: Puppeteer documents mouse coordinates in main-frame CSS pixels relative to the viewport. Compare against that coordinate space rather than the outer window or screenshot bitmap; see the Page API.
Or skip the browser setup
If your goal is to get a screenshot rather than manage Chromium dimensions yourself, ScreenshotNeo returns a screenshot or PDF from one GET request. For example, save a WebP screenshot with cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo API documentation for parameters. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000. Sign up for the free plan.
Frequently Asked Questions
Does page.setViewport() resize the outer browser window?
No. It configures the page viewport; Puppeteer’s content-area resize workflow uses page.setViewport(null) followed by page.resize(), which is marked experimental.
Free tools Windows power users keep installed
One-click scans. No signup required.
Why is my full-page screenshot taller than window.innerHeight?
A full-page capture can include document content beyond the visible viewport. Check the screenshot options rather than assuming the viewport changed.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




