Files
puppeteer/website/versioned_docs/version-25.4.0/api/puppeteer.predefinednetworkconditions.md
browser-automation-botGitHubrelease-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
4d7b677d1d chore: release main (#15201)
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2026-07-27 14:29:23 +02:00

1.1 KiB

sidebar_label
sidebar_label
PredefinedNetworkConditions

PredefinedNetworkConditions variable

A list of pre-defined network conditions to be used with Page.emulateNetworkConditions().

Signature

PredefinedNetworkConditions: Readonly<{
  'Slow 3G': NetworkConditions;
  'Fast 3G': NetworkConditions;
  'Slow 4G': NetworkConditions;
  'Fast 4G': NetworkConditions;
}>;

Example

import {PredefinedNetworkConditions} from 'puppeteer';
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.emulateNetworkConditions(PredefinedNetworkConditions['Slow 3G']);
await page.goto('https://www.google.com');
await page.emulateNetworkConditions(PredefinedNetworkConditions['Fast 3G']);
await page.goto('https://www.google.com');
// alias to Fast 3G.
await page.emulateNetworkConditions(PredefinedNetworkConditions['Slow 4G']);
await page.goto('https://www.google.com');
await page.emulateNetworkConditions(PredefinedNetworkConditions['Fast 4G']);
await page.goto('https://www.google.com');
// other actions...
await browser.close();