Set the user agent and viewport before the page loads, then capture the visible viewport or the full page. A user-agent string identifies the browser or device to the site; the viewport dimensions determine the responsive layout. For repeatable captures, use Playwright or Puppeteer. For a one-off check, use Chrome DevTools Device Mode.
What to set before you capture
Decide which browser engine, user-agent string, and viewport dimensions the test needs. A device preset can bundle a user agent with screen and viewport dimensions, touch support, and other emulation settings. If you need a custom user agent or exact dimensions, inspect and override the preset rather than assuming it matches your target. Playwright’s device emulation documentation explains the configurable parameters and viewport overrides: Playwright emulation.
- User agent: the browser/device identity sent to the site.
- Viewport: the page’s CSS layout area; this is what usually determines responsive breakpoints.
- Device scale factor and touch: relevant when the target behavior depends on pixel density or touch input.
- Capture extent: choose the visible viewport, a specific element, or the full scrollable page.
Changing only the user agent does not set a mobile-sized viewport. For a responsive layout test, set both deliberately.
Use Playwright for a repeatable screenshot
Install Playwright in a Node.js project and install its Chromium browser. The example below uses a custom user agent and viewport, applies them before navigation, waits for the page to load, and saves a full-page PNG.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, 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 minute#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
npm install playwright
npx playwright install chromium
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const context = await browser.newContext({
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1',
viewport: { width: 390, height: 844 },
deviceScaleFactor: 2,
isMobile: true,
hasTouch: true
});
const page = await context.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({ path: 'responsive.png', fullPage: true });
await browser.close();
})();
Replace the user-agent string, dimensions, and URL with the values for your test. The example’s string is an input, not a guarantee that the capture will match a particular physical iPhone. If you need a preset, spread the selected Playwright device descriptor into browser.newContext(), then place any overrides after it so your custom values take precedence. Check the descriptor’s user agent: Playwright notes that a preset may use a platform-specific string, and recommends leaving the preset user agent undefined when you want the running test platform’s own user agent.
Choose the screenshot extent
await page.screenshot({ path: 'viewport.png' })captures the visible viewport.await page.screenshot({ path: 'full.png', fullPage: true })captures the whole scrollable page.await page.locator('main').screenshot({ path: 'element.png' })captures one element.
Playwright documents viewport, full-page, and element screenshot options at Playwright screenshots.
Handle delayed and lazy-loaded content
networkidle can be a useful wait condition, but it is not proof that every image or animation is ready. Some sites keep network requests open, while lazy-loaded media may not load until it approaches the viewport. If a particular component matters, wait for it explicitly with await page.locator('.target').waitFor(). For content lower on the page, scroll through the document to trigger lazy loading before taking a full-page capture, or otherwise trigger the relevant media and verify the saved image.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Use Puppeteer when your automation already uses it
Puppeteer’s Page.emulate(device) applies a known device profile’s metrics and user agent. Its documentation describes the method as a shortcut for Page.setUserAgent() and Page.setViewport(), and advises applying emulation before navigation because some sites do not expect a phone-sized page to be resized after loading: Puppeteer Page.emulate().
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →npm install puppeteer
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setUserAgent(
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1'
);
await page.setViewport({ width: 390, height: 844, deviceScaleFactor: 2 });
await page.goto('https://example.com', { waitUntil: 'networkidle2' });
await page.screenshot({ path: 'responsive.png', fullPage: true });
await browser.close();
})();
For a built-in device profile, import the profile exposed by your installed Puppeteer version and call await page.emulate(profile) before page.goto(). For an arbitrary user agent or custom dimensions, set the user agent and viewport explicitly as above. The available device profiles can change between releases; use the profile names provided by the version installed in your project.
Capture manually with Chrome DevTools
Device Mode is convenient for an individual visual check. Open the page in Chrome, open DevTools, and enable the device toolbar. Select Responsive or a device preset, then set the viewport dimensions. Device Mode also provides controls for device pixel ratio, user-agent string, and device type; set the fields that matter to your test. Chrome’s guide is at Chrome DevTools Device Mode.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Use the DevTools screenshot controls to capture the page in the emulated view. Device-specific screenshot capture can include a frame when the device frame is enabled. The precise controls can vary with Chrome versions, so consult the current Device Mode guide if a menu label differs.
Choose the right workflow and verify the result
| Workflow | Best fit | What to control |
|---|---|---|
| Playwright | Repeatable captures across URLs or regression checks | Browser engine, device/context settings, user agent, viewport, and screenshot extent |
| Puppeteer | Projects already using Puppeteer or a known device profile | Apply device emulation or explicit user-agent and viewport settings before navigation |
| Chrome DevTools Device Mode | A quick manual inspection | Responsive dimensions, device pixel ratio, user-agent string, and device type |
These workflows emulate selected browser parameters; they do not establish that every behavior matches a physical phone. If the question depends on hardware-specific behavior, confirm it on the target device. For practical visual checks, make sure the captured page has the expected breakpoint, content, images, and menus before treating the screenshot as evidence.
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 →Troubleshooting common capture problems
The page still looks like desktop
Check the viewport width, not just the user-agent string. Make sure the chosen preset or explicit context sets the intended dimensions and that custom overrides are applied before navigation.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
The first load differs from later captures
Apply emulation before opening the target URL. Puppeteer specifically cautions that resizing after navigation can affect pages that do not expect a phone-size change. With Playwright, create the context with the desired settings before creating or navigating the page.
Images or page sections are missing
Wait for the required element, trigger lazy loading by scrolling, and allow any relevant animation or network activity to finish. A full-page screenshot does not guarantee that off-screen lazy content was loaded beforehand.
The screenshot has the wrong size or extent
Distinguish viewport capture from full-page capture. Check the viewport width and height and, where relevant, device scale factor. A full-page capture is taller than the viewport by design; use the default viewport screenshot when only the visible region is required.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- 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.
The emulated page does not match a real device
Confirm the browser engine and device parameters required by the test. Emulation is useful for responsive checks, but physical-device behavior can depend on hardware or browser behavior outside the settings being emulated; verify on the device when that distinction matters.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
For a one-call capture, ScreenshotNeo is a website screenshot API and MCP server. It accepts a URL and returns a PNG, JPEG, WebP, or PDF. To request a particular viewport and user agent, use the supported request parameters; see the ScreenshotNeo API documentation for parameter names and options.
curl -G "https://api.screenshotneo.com/v1/shot"
-d access_key=YOUR_API_KEY
--data-urlencode url=https://example.com
-o shot.webp
ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers indicate the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan: 1,000 screenshots a month, no card required.
Frequently Asked Questions
Does changing the user agent alone make a page responsive?
No. The user agent identifies the browser or device to the site; set the viewport dimensions as well to test a specific responsive layout.
Should I test a screenshot on a real phone?
Use browser emulation for routine responsive checks. If the result depends on hardware-specific behavior, verify it on the target physical device.
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.

