Skip to main content
Deno 2 is finally here 🎉️
Learn more
Extremely Popular
Go to Latest
method Page.prototype.emulateNetworkConditions
Re-export
import { Page } from "https://deno.land/x/fresh@1.5.4/tests/deps.ts";

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>