The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Set the screenshot’s visible page dimensions with the browser context’s viewport option, and set its emulated pixel density with deviceScaleFactor. Then choose screenshot scale: 'css' produces one output pixel per CSS pixel, while 'device' produces one per device pixel. These settings work the same as Playwright browser-emulation options on Windows; there is no separate Windows-only setting.
Set viewport and device scale factor when creating the context
For repeatable initial conditions, configure both options in browser.newContext() before creating or navigating the page:
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const context = await browser.newContext({
viewport: { width: 1280, height: 720 },
deviceScaleFactor: 2,
});
const page = await context.newPage();
await page.goto('https://example.com');
await page.screenshot({ path: 'screenshot.png', scale: 'device' });
await context.close();
await browser.close();
})();
Save this as a JavaScript file and run it in a Windows terminal where Playwright is installed. The dimensions are an example, not a required Windows resolution. Playwright’s documented context defaults are a 1280 × 720 viewport and a deviceScaleFactor of 1. See the BrowserType API.
Understand viewport, device scale factor, and screenshot scale
These settings control different things, so changing one does not substitute for another.
#1 Best Overall
- Spacious Design: Measuring 21.1" wide and 14.1" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
- Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy ergonomic support with the integrated cushioned wrist rest.
- Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
- Durable Surface: Work with confidence on our lap desk's solid surface, featuring a sleek black carbon color, ensuring optimal air circulation to prevent your laptop from overheating.
- On-the-Go Convenience: With an integrated handle and lightweight design (2.8 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
| Setting | What it controls | When to use it |
|---|---|---|
viewport |
The emulated visible page width and height, in CSS pixels. | Choose the layout size you want the site to render, such as a desktop or mobile layout. |
deviceScaleFactor |
The emulated device pixel ratio (DPR). | Set the pixel density the page should emulate. Its documented default is 1. |
Screenshot scale |
How CSS pixels map to pixels in the output image. | Use 'css' for one image pixel per CSS pixel, or 'device' for one image pixel per device pixel. |
For a compact visual baseline, use scale: 'css'. For an image at the emulated device-pixel density, use scale: 'device'; when the device scale factor is greater than 1, the resulting image can be substantially larger. Playwright documents these screenshot options in the Page API.
Resize a page with setViewportSize
If you already have a page, resize its viewport with page.setViewportSize():
Rank #2
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
await page.setViewportSize({ width: 1280, height: 720 });
Set the size before navigation when the site may choose its initial layout based on the viewport. A later resize changes the page and resets its screen size. If the emulated screen dimensions should be set independently of the viewport, configure both screen and viewport when creating the browser context. See Playwright’s Emulation guide.
Choose settings for your screenshot goal
- Match a target layout: Set
viewportto the desired CSS width and height. Choose adeviceScaleFactorfor the emulated DPR, then select'css'or'device'output according to whether you need CSS-pixel or device-pixel dimensions. - Keep image files smaller: Use
scale: 'css'when device-pixel resolution is unnecessary. - Capture high-density output: Use
scale: 'device'and account for the larger image dimensions when the device scale factor exceeds 1. - Test responsive behavior: Set the viewport before loading the page so the site sees the intended initial dimensions.
- Control screen emulation separately: Configure context
screenas well asviewportwhen those dimensions need to differ.
Why a screenshot may be twice as large
A screenshot can have more image pixels than the viewport’s CSS-pixel dimensions when deviceScaleFactor is greater than 1 and the screenshot uses scale: 'device'. For example, a factor of 2 maps each CSS pixel to two device pixels per dimension. If you want output dimensions in CSS pixels, use scale: 'css'; if you want device-pixel output, keep 'device' and expect a larger image.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
- Note: Not suitable for MacBooks released after 2023 or devices with a protruding front camera; Not applicable to full-screen or notch-style tempered glass screen protectors; Do not use on the rear camera of the phone.
- 💻 Why Do You Need a Webcam Cover Slide? — Safeguard your privacy by covering your webcam with our reliable webcam cover when not in use. Don't let anyone secretly watch you. Stay protected!
- ✅ Thin & Stylish — Enhance your laptop's functionality and aesthetics with our 0.027" ultra-thin webcam covers. Seamlessly close your laptop while adding a touch of sophistication.
- ✅ Fits Most Devices — Compatible with laptops, phones, tablets, desktops! Keep your privacy intact on Ap/ple, Mac/Book, iPh/one, iP/ad, H/P, L/novo, De/ll, Ac/er, As/us, Sa/msung devices.
- ✅ 365 Days Protection — Our upgraded 3.0 adhesive ensures a strong hold that won't damage your equipment. Experience reliable, long-term privacy protection day in and day out.
Keep Windows visual comparisons consistent
Viewport and device scale factor are browser-emulation settings, but matching them does not guarantee pixel-identical screenshots across different machines. Playwright warns that rendering can vary with the host OS, browser version, settings, hardware, power source, and headless mode. Generate and compare baselines in the same environment where possible; see Visual comparisons.
Troubleshoot common dimension problems
- Unexpectedly large image: Check both
deviceScaleFactorand screenshotscale. Use'css'for CSS-pixel output, or reduce the emulated factor if high-density output is not needed. - Page uses the wrong responsive layout: Set
viewportinbrowser.newContext()before creating or navigating the page. If resizing an existing page, callsetViewportSize()before navigation when the initial viewport matters. - Page and screen dimensions do not match:
setViewportSize()resets the page’s screen size. Configure contextscreenandviewporttogether if the emulated screen must differ. - Visual baseline differs between runs or computers: Keep the host OS, browser version, settings, hardware conditions, and headless mode consistent as far as practical.
Or skip the browser setup
ScreenshotNeo can return an image or PDF from one API request. Its cleanup accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the page verdict and billing status in headers. It also provides an MCP server for AI agents.
Example cURL request:
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 request options. One thousand screenshots per month are free with no card; paid plans start at $5 for 3,000. Learn about ScreenshotNeo or sign up for the free plan.
Rank #4
- Anti-Slip Surface - Transform your laptop into a mobile workstation with the AboveTEK portable laptop lap desk. The anti-slip surface provides a strong grip for laptops up to 15.6 inches(Diagonal), while the double rubber strip on the bottom ensures a stable display or typing experience on your lap, couch, or bed.
- Retractable Mouse Pad - Retractable laptop mouse pad extends on both directions for the left/right handed with elevation along the edges for stopping mouse from falling off. The size of laptop tray is 14" X 9.7" and the size of mouse pad is 7.4" X 6.1".
- Effective Heat Shield - The effective heat shield made of sturdy and thick material protects your laptop from overheating. Prioritizes your comfort and safety, an ideal lap pad or board for working anywhere.
- EASY to Carry and Store - With an ergonomic and simplistic design, the lap desk is portable to store in a backpack. Only 15" in size, 2.2 lb of weight and with slim 0.6 inch thickness, it is ready to be easily carried around.
- Widely Applicable - The smooth platform accommodates laptops and tablets up to 15.6 inches(Diagonal), making it a versatile accessory and one of the best gifts for mom, dad, students and professionals. Perfect for use as a laptop bed tray or tablet holder anywhere at home, library, or park.
Frequently Asked Questions
Does Windows require a different Playwright deviceScaleFactor setting?
No. Playwright documents viewport and device scale factor as browser context emulation settings, not Windows-specific options.
Quick Recap
Best Value
- Spacious Design: Measuring 21.1" wide and 12" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
- Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy laptop support with the integrated device ledge.
- Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
- Durable Surface: Work with confidence on our lap desk's solid surface, featuring a blush pink color, ensuring optimal air circulation to prevent your laptop from overheating.
- On-the-Go Convenience: With an integrated handle and lightweight design (2.14 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
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.

