What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the browser viewport to the required width and height in CSS pixels before loading the page, then choose whether the screenshot should use CSS pixels or device pixels. For an automated capture, Playwright makes both choices explicit; Chrome DevTools is convenient for a manual capture. Use mobile emulation as well when the page must respond to mobile-specific browser behavior, not merely fit a narrow layout.

What an exact CSS viewport does—and does not—specify

A viewport of 390 × 844 means the page lays out in a visible area 390 CSS pixels wide and 844 CSS pixels high. Those values are not necessarily the screenshot file’s pixel dimensions. The device pixel ratio (DPR) describes how device pixels map to CSS pixels; screenshot scaling determines whether the output follows CSS-pixel dimensions or device-pixel dimensions. With a DPR greater than 1, a device-scaled image can therefore be larger than the CSS viewport.

  • Use a CSS-scaled capture when you need one output image pixel per CSS pixel.
  • Use a device-scaled capture when you need the output to reflect device-pixel density.
  • Use a viewport capture for the configured visible area. A full-page capture includes the full scrollable page and is not a fixed-height viewport screenshot.

These are separate choices: setting viewport width and height does not, by itself, determine the output pixel dimensions or make the browser behave like a particular phone.

Capture an exact mobile viewport with Playwright

Create a browser context with the viewport set before opening the page. The example uses 390 × 844 CSS pixels, enables mobile emulation, sets DPR to 1, and requests CSS-pixel screenshot scaling. Replace the example URL with the page you need.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Motorola Moto g - 2026 | Unlocked | Made for US 4/128GB | 50MP Camera | Pantone Slipstream, Cellular_Phone
  • Universal unlocked. Compatible with all major U.S. carriers, including Verizon, AT&T, T-Mobile and other prepaid carriers.
  • Super-bright, super-smooth 6.7" display. See your screen clearly even outdoors in sunlight, and enjoy seamless views with a fast-refreshing 120Hz display.*
  • AI-powered camera system. Take stunning photos in any light with the 50MP camera**, look your best with a 32MP selfie cam*****, and capture extreme close-ups.
  • Superfast 5G performance. Unleash your entertainment at 5G speed*** with the MediaTek Dimensity 6300 chipset and up to 12GB of RAM with RAM Boost****.
  • Long-lasting battery + TurboPower charging. Power through day after day with a 5200mAh battery, then get hours of power in just minutes.****
const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  const context = await browser.newContext({
    viewport: { width: 390, height: 844 },
    isMobile: true,
    deviceScaleFactor: 1,
  });
  const page = await context.newPage();
  await page.goto('https://example.com');
  await page.screenshot({ path: 'mobile-390x844.png', scale: 'css' });
  await browser.close();
})();

This is runnable in a Node.js project with Playwright installed. The configuration—not a reported test result—illustrates how to set the viewport and capture scale.

Choose settings for the output you need

  • CSS-sized image: keep scale: 'css'; the image uses one pixel per CSS pixel.
  • Device-sized image: use scale: 'device'. Image dimensions then reflect the device pixel scale, so a higher DPR can produce a larger file.
  • Layout-only check: set the exact viewport; use mobile emulation only if mobile-specific behavior is part of the question.
  • Phone-like behavior: use a device profile or explicitly configure mobile properties such as mobile mode and device scale factor. A profile can also supply user agent, screen size, and touch capability.
  • Full scrollable page: set fullPage: true in the screenshot options. This captures beyond the viewport and changes the kind of image being produced; Playwright’s documented default is false.

Override a device profile’s viewport

A built-in device profile includes its own viewport. If you spread its settings into a context but need a different exact CSS viewport, set viewport afterward so the custom dimensions override the preset’s viewport. Keep the profile’s other emulation settings if they match your purpose.

Rank #2
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

Capture manually in Chrome DevTools

  1. Open Chrome DevTools and enable Device Mode.
  2. Choose Responsive Viewport Mode and enter the required width and height in the viewport fields.
  3. If the page must behave like a mobile device, select a mobile device type or configure a custom device. Set DPR when the output or behavior depends on it.
  4. Choose Capture screenshot for the visible viewport, or Capture a full size screenshot for the entire page.

Custom device definitions can include a name and dimensions; DPR, user agent, and device type are optional fields. The separate capture commands matter: a full-size screenshot is not the same deliverable as a fixed-height viewport image. See Chrome DevTools Device Mode documentation for the current controls.

Use Puppeteer for scripted Chrome captures

For a named device preset, call page.emulate(device) before navigating. Puppeteer documents this as applying device metrics and user agent, and advises emulating before navigation because resizing can affect sites that do not expect a phone-size change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Samsung Galaxy A16 5G 128GB Cell Phone, Unlocked Android Smartphone, Large AMOLED Display, Durable Design, Super Fast Charging, Expandable Storage, US Version, 2025, Blue Black (Renewed)
  • Charger NOT Included, 6.7" Super AMOLED FHD+, 90Hz Refresh Rate, 385 ppi, 800 nits (HBM), 1080x2340px, 5000mAh Battery
  • 128GB, 4GB RAM, microSDXC, Exynos 1330 (5nm), Octa-Core, Mali-G68 MP2 or Mali-G57 MC2 GPU
  • Rear Camera: 50MP, f/1.8 (wide) + 5MP, f/2.2 (ultrawide) + 2MP, f/2.4 (macro), LED flash, panorama, HDR; Front Camera: 13MP, f/2.0, Android 14, up to 6 major Android upgrades, One UI 6.1
  • 3G: HSDPA 850/900/1700(AWS)/1900/2100; 4G LTE: 1/2/3/4/5/7/12/13/14/20/25/26/28/29/30/38/39/40/41/48/66/71, 5G: 2/5/25/41/66/71/77/78 SA/NSA/Sub6/mmWave - Nano-SIM + eSIM
  • US Model – Global Connectivity – Compatible with Most GSM Carriers like T-Mobile, AT&T, MetroPCS, etc. Will Also work with CDMA Carriers Such as Verizon, Straight Talk.
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.setViewport({ width: 390, height: 844, deviceScaleFactor: 1 });
  await page.goto('https://example.com');
  await page.screenshot({ path: 'mobile-390x844.png' });
  await browser.close();
})();

For a named preset, apply page.emulate(device) before page.goto(), then capture. For an exact custom CSS viewport, configure the viewport directly and add any mobile emulation settings the page requires. Puppeteer’s API details are documented in Page.emulate().

Which workflow should you use?

Approach Best suited to Main control
Playwright Repeatable automated captures or tests Set the context viewport explicitly; choose CSS or device screenshot scale
Chrome DevTools Device Mode Quick manual capture and visual inspection Enter viewport width and height; choose device type and DPR if needed
Puppeteer Scripted Chrome automation using device presets Emulate before navigation and keep device metrics consistent

Playwright’s documented viewport, device emulation, and screenshot controls are described in its emulation guide and Page API. No single workflow is required for every task: choose based on whether you need manual inspection, repeatable automation, or mobile browser behavior.

Rank #4
Sale
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

Make captures comparable

For a meaningful visual comparison, keep the browser, viewport width and height, DPR, emulation options, page state, and capture mode consistent. Changing one of these can change layout, pixel dimensions, or both. Also make sure both captures represent the same kind of image: viewport versus full page, and CSS-scaled versus device-scaled.

Troubleshooting exact viewport screenshots

  • The file dimensions are larger than the requested viewport. Check whether the capture uses device scaling and whether the DPR is above 1. Use CSS scaling for one image pixel per CSS pixel, or retain device scaling if device-pixel output is intended.
  • The layout does not look like a phone. A narrow CSS viewport controls layout width, but may not supply mobile browser characteristics. Add mobile emulation or use a device profile if user agent, touch, screen size, or mobile behavior matters.
  • The capture has the wrong height or includes the whole page. Check that you did not enable full-page capture. Use a viewport capture when you need only the visible configured area.
  • A site changes or breaks after it loads. In Puppeteer, apply emulation before navigation as its documentation recommends; changing device metrics after load can affect pages that do not expect the resize.
  • A preset uses unexpected dimensions. Device profiles carry their own viewport settings. Set your custom viewport after spreading the profile into the context.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo can return a screenshot from one GET request; its API accepts viewport dimensions in CSS pixels. See the ScreenshotNeo API documentation for request options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -d viewport=390x844 -o shot.webp

ScreenshotNeo accepts cookie and consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Frequently Asked Questions

Does a 390 × 844 CSS viewport guarantee a 390 × 844 image file?

No. The viewport sets the CSS layout area; screenshot scale and device pixel ratio determine how CSS dimensions map to image pixels.

Should I use mobile emulation for every narrow screenshot?

No. Use it when mobile-specific browser behavior matters. A custom CSS viewport may be sufficient for a layout-only check.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.