Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
method Page.prototype.emulateNetworkConditions
import { Page } from "https://deno.land/x/puppeteer@14.1.1/vendor/puppeteer-core/puppeteer/common/Page.js";

Examples

Example 1

const puppeteer = require('puppeteer');
const slow3G = puppeteer.networkConditions['Slow 3G'];

(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.emulateNetworkConditions(slow3G);
await page.goto('https://www.google.com');
// other actions...
await browser.close();
})();

Parameters

networkConditions: NetworkConditions | null
  • Passing null disables network condition emulation.

Returns

Promise<void>