Use Puppeteer’s page.emulateNetworkConditions() to test a page with a predefined or custom network profile, and use page.setOfflineMode(true) when you need to simulate a disconnected browser. Apply the setting before the navigation or interaction you want to test.
Emulate a slower connection with a preset
The current Puppeteer API exposes the PredefinedNetworkConditions collection. This example uses its Slow 3G profile before loading the page:
As an Amazon Associate I earn from qualifying purchases.
import puppeteer, {PredefinedNetworkConditions} from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.emulateNetworkConditions(
PredefinedNetworkConditions['Slow 3G'],
);
await page.goto('https://example.com');
// Interact with and inspect the page under the emulated conditions.
} finally {
await browser.close();
}
The profile name is a preset label; it is not itself a promise of a particular measured speed. The Page.emulateNetworkConditions() API reference documents the method and supported arguments. Check the API reference for the Puppeteer version installed in your project, since API details can change.
Use the setting before the event under test
Set the profile before page.goto() when testing initial page loading, as in the example. For a later interaction, set it before performing that interaction so the relevant request occurs under the intended conditions.
#1 Best Overall
Choose between network throttling and offline mode
| What you want to simulate | Use | What it controls |
|---|---|---|
| A constrained but connected network | page.emulateNetworkConditions(profile) |
Emulated download, upload, and latency parameters. |
| A disconnected browser | page.setOfflineMode(true) |
Offline state. |
These are separate controls. Setting offline mode does not change download, upload, or latency parameters already set through network-condition emulation. The Page.setOfflineMode() reference describes this behavior.
await page.emulateNetworkConditions(
PredefinedNetworkConditions['Slow 3G'],
);
await page.setOfflineMode(true); // Offline state; does not reset the profile's parameters.
Passing null to emulateNetworkConditions() disables network-condition emulation. It is not documented as a substitute for calling setOfflineMode(false); use the control that matches the state you intend to test.
Use a custom network profile
The method accepts a NetworkConditions value as well as a predefined profile. A custom profile is useful when a preset does not match your test, but the exact fields and units should come from the API/type reference for your installed Puppeteer release. Do not copy field names or numeric values from examples meant for a different version without verifying them.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #2
// Replace this with a NetworkConditions value matching your installed version's type reference.
await page.emulateNetworkConditions(customConditions);
The method reference links the relevant API; consult the matching version’s NetworkConditions definition before constructing customConditions.
Know what the emulation does not cover
Puppeteer documents that network-condition emulation does not affect WebSockets or WebRTC PeerConnections. If your application uses either transport, this method alone does not reproduce constrained-network behavior for that traffic. See the note in the official method reference.
The API is documented on Puppeteer’s Page class. Do not assume identical behavior across every browser or protocol combination; verify the support documented for your installed Puppeteer version and browser setup.
Rank #3
Version and browser setup
Puppeteer v22.0.0 removed the older networkConditions name in favor of PredefinedNetworkConditions, according to its changelog. If older snippets fail because that name is unavailable, check the release and API documentation matching your installed package.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC 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 & 11For installation context, Puppeteer’s installation guide says installing puppeteer downloads a compatible Chrome for Testing build and chrome-headless-shell by default. puppeteer-core does not download Chrome and is intended for setups where you manage the browser or connect remotely.
Troubleshooting
PredefinedNetworkConditionsis undefined or cannot be imported: check the installed Puppeteer version and its API reference. Older code may use a historical name removed in v22.0.0; update the code to match the installed release.- The page seems to load normally: confirm the emulation call completed before navigation or the request being tested, and confirm you are testing traffic covered by this API. WebSockets and WebRTC PeerConnections are not affected.
- The page is offline but the saved network parameters remain: this is expected. Offline mode does not modify those parameters; treat connectivity state and network conditions as separate settings.
- A custom profile is rejected or behaves unexpectedly: verify its shape and units against the
NetworkConditionstype for the exact installed release rather than guessing from a different version’s example.
Or skip the browser setup
If your goal is to capture a rendered page rather than exercise Puppeteer’s network emulation in a test, ScreenshotNeo is a website screenshot API and MCP server. This one-call cURL request saves a WebP screenshot; see the ScreenshotNeo API documentation for request options.
Rank #4
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
- Cookie banners are accepted and removed before capture; known newsletter popups and chat widgets are removed too, and each step can be turned off.
- Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; response headers identify the page verdict and billing status.
- An MCP server provides
take_screenshot,get_page_info, andcapture_pdftools for AI agents and MCP clients. - The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo free: 1,000 screenshots a month, no card required.
Frequently Asked Questions
Does page.emulateNetworkConditions(null) put the browser online?
The API reference says null disables network-condition emulation; it does not document that call as equivalent to page.setOfflineMode(false).
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 →Can Puppeteer network emulation throttle WebSockets?
No. Puppeteer documents that this emulation does not affect WebSockets or WebRTC PeerConnections.
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.




