Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,6 @@ const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();

const client = await page.target().createCDPSession();
await client.send('Network.enable');
// Simulated network throttling (Slow 3G)
await page.emulateNetworkConditions(puppeteer.networkConditions['Slow 3G']);
await browser.close();
Expand All @@ -321,9 +318,6 @@ const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();

const client = await page.target().createCDPSession();
await client.send('Network.enable');
// Simulated network throttling (Slow 3G)
await page.emulateNetworkConditions(puppeteer.networkConditions['Slow 3G']);
await page.emulateCPUThrottling(4);
Expand Down Expand Up @@ -471,10 +465,6 @@ async function getLCP(url) {

try {
const page = await browser.newPage();
const client = await page.target().createCDPSession();

await client.send('Network.enable');
await client.send('ServiceWorker.enable');
await page.emulateNetworkConditions(puppeteer.networkConditions['Good 3G']);
await page.emulateCPUThrottling(4);
await page.emulate(phone);
Expand Down Expand Up @@ -550,10 +540,6 @@ async function getCLS(url) {

try {
const page = await browser.newPage();
const client = await page.target().createCDPSession();

await client.send('Network.enable');
await client.send('ServiceWorker.enable');
await page.emulateNetworkConditions(puppeteer.networkConditions['Good 3G']);
await page.emulateCPUThrottling(4);
await page.emulate(phone);
Expand Down
4 changes: 0 additions & 4 deletions cumulative-layout-shift.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ async function getCLS(url) {

try {
const page = await browser.newPage();
const client = await page.target().createCDPSession();

await client.send('Network.enable');
await client.send('ServiceWorker.enable');
await page.emulateNetworkConditions(puppeteer.networkConditions['Good 3G']);
await page.emulateCPUThrottling(4);
await page.emulate(phone);
Expand Down
4 changes: 0 additions & 4 deletions largest-contentful-paint.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ async function getLCP(url) {

try {
const page = await browser.newPage();
const client = await page.target().createCDPSession();

await client.send('Network.enable');
await client.send('ServiceWorker.enable');
await page.emulateNetworkConditions(puppeteer.networkConditions['Good 3G']);
await page.emulateCPUThrottling(4);
await page.emulate(phone);
Expand Down
4 changes: 1 addition & 3 deletions throttle-network-cpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();

const client = await page.target().createCDPSession();
await client.send('Network.enable');

// Simulated network throttling (Slow 3G)
await page.emulateNetworkConditions(puppeteer.networkConditions['Slow 3G']);
await page.emulateCPUThrottling(4);
Expand Down
2 changes: 0 additions & 2 deletions throttle-network.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ const puppeteer = require('puppeteer');
const browser = await puppeteer.launch();
const page = await browser.newPage();

const client = await page.target().createCDPSession();
await client.send('Network.enable');
// Simulated network throttling (Slow 3G)
await page.emulateNetworkConditions(puppeteer.networkConditions['Slow 3G']);
await browser.close();
Expand Down