Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Enable interception before navigation, read each HTTPRequest with request.headers(), and always resolve the intercepted request. The essential pattern is:
await page.setRequestInterception(true);
page.on('request', request => {
const headers = request.headers();
console.log(request.method(), request.url(), headers);
request.continue();
});
await page.goto('https://example.com');
headers() returns Puppeteer’s associated request headers as an object with lower-case names. This is browser-level request inspection, not a raw packet capture: it does not promise original casing, byte-for-byte wire output, or a guaranteed outgoing order.
What Puppeteer captures
The request event fires when the page issues a request. Its HTTPRequest object exposes the method, URL, post data, resource type, and headers. Calling request.headers() gives a Record<string, string>-like object whose header names are lower-case, so compare names case-insensitively.
Interception covers requests initiated during the page run, including the main document, stylesheets, scripts, images, fonts, XHR and fetch calls. Redirects create additional request lifecycle events; failures and successful completions are reported separately. If you need a complete run log, record requestfailed, requestfinished, and every redirected request rather than treating the first request as the whole transaction.
#1 Best Overall
- DUAL-BAND WIFI 6 ROUTER: Wi-Fi 6(802.11ax) technology achieves faster speeds, greater capacity and reduced network congestion compared to the previous gen. All WiFi routers require a separate modem. Dual-Band WiFi routers do not support the 6 GHz band.
- AX1800: Enjoy smoother and more stable streaming, gaming, downloading with 1.8 Gbps total bandwidth (up to 1200 Mbps on 5 GHz and up to 574 Mbps on 2.4 GHz). Performance varies by conditions, distance to devices, and obstacles such as walls.
- CONNECT MORE DEVICES: Wi-Fi 6 technology communicates more data to more devices simultaneously using revolutionary OFDMA technology
- EXTENSIVE COVERAGE: Achieve the strong, reliable WiFi coverage with Archer AX1800 as it focuses signal strength to your devices far away using Beamforming technology, 4 high-gain antennas and an advanced front-end module (FEM) chipset
- OUR CYBERSECURITY COMMITMENT: TP-Link is a signatory of the U.S. Cybersecurity and Infrastructure Security Agency’s (CISA) Secure-by-Design pledge. This device is designed, built, and maintained, with advanced security as a core requirement.
Complete capture script
Install Puppeteer with npm install puppeteer. This CommonJS example writes one JSON line per request and records failures and completions. It enables interception before goto, which is essential: requests made before interception is enabled cannot be replayed into the handler.
const puppeteer = require('puppeteer');
const fs = require('node:fs');
(async () => {
const browser = await puppeteer.launch({headless: true});
const page = await browser.newPage();
const log = fs.createWriteStream('requests.ndjson', {flags: 'w'});
await page.setRequestInterception(true);
page.on('request', request => {
// Keep this callback synchronous when possible.
if (request.isInterceptResolutionHandled()) return;
const record = {
event: 'request',
method: request.method(),
url: request.url(),
resourceType: request.resourceType(),
headers: request.headers(),
postData: request.postData() ?? null,
timestamp: new Date().toISOString()
};
log.write(JSON.stringify(record) + 'n');
if (!request.isInterceptResolutionHandled()) request.continue();
});
page.on('requestfailed', request => {
log.write(JSON.stringify({
event: 'requestfailed', url: request.url(),
method: request.method(), failure: request.failure()
}) + 'n');
});
page.on('requestfinished', request => {
log.write(JSON.stringify({
event: 'requestfinished', url: request.url(), method: request.method()
}) + 'n');
});
await page.goto('https://example.com', {waitUntil: 'networkidle2', timeout: 60000});
await page.waitForNetworkIdle({idleTime: 500, timeout: 30000}).catch(() => {});
log.end();
await browser.close();
})();
The handler calls continue() for every request. Without a resolution, an intercepted request stalls and the navigation can hang until timeout. The final network-idle wait is optional; use a page-specific readiness condition when the site has long-polling or analytics traffic.
Understanding the request lifecycle
Read headers at the request event
Call request.headers() inside the request listener, before resolving it. Copy the object if you will retain it, because your logging pipeline should not depend on later request state. Header values are strings as exposed by Puppeteer; cookies may appear as a single cookie header.
Track redirects as separate requests
A redirect can produce a request for the original URL, a response with a redirect status, and a new request for the destination. Log each request event and correlate records by URL, timing, or your own generated run identifier. Do not assume the original request’s headers are identical to those on the redirected request.
Rank #2
- Dual-band Wi-Fi with 5 GHz speeds up to 867 Mbps and 2.4 GHz speeds up to 300 Mbps, delivering 1200 Mbps of total bandwidth¹. Dual-band routers do not support 6 GHz. Performance varies by conditions, distance to devices, and obstacles such as walls.
- Covers up to 1,000 sq. ft. with four external antennas for stable wireless connections and optimal coverage.
- Supports IGMP Proxy/Snooping, Bridge and Tag VLAN to optimize IPTV streaming
- Access Point Mode - Supports AP Mode to transform your wired connection into wireless network, an ideal wireless router for home
- Advanced Security with WPA3 - The latest Wi-Fi security protocol, WPA3, brings new capabilities to improve cybersecurity in personal networks
Record failures and completions
requestfailed tells you that the browser could not finish a request and exposes a failure description. requestfinished indicates completion. A successful HTTP error status is still a finished request, not a failed network request, so inspect the corresponding response when status codes matter.
Interception and asynchronous handlers
Multiple listeners or packages can attempt to resolve the same request. The safe baseline is to check request.isInterceptResolutionHandled() immediately before continue(), abort(), or respond(). If you await asynchronous work, check again afterward because another listener may have resolved the request while you were waiting.
page.on('request', async request => {
if (request.isInterceptResolutionHandled()) return;
const headers = request.headers();
await saveHeaders(request.url(), headers);
// The state may have changed during the await.
if (request.isInterceptResolutionHandled()) return;
request.continue();
});
Keep the final check and resolution together without another asynchronous boundary. Puppeteer’s current interception guide also describes Cooperative Intercept Mode: it is active only when every resolution supplies a numeric priority. A listener that resolves without a priority invokes legacy immediate resolution, so third-party listeners should be treated as potentially competing handlers.
Capturing selectively without losing the full run
Filter after reading
To capture only API traffic, inspect request.resourceType() or the URL, but still resolve every request:
Rank #3
- NIGHTHAWK WIFI 6 ROUTER FOR YOUR WHOLE HOME: Delivers fast, reliable WiFi across every room of your apartment or small home for streaming, gaming, video calls, and smart home devices, all running at the same time without slowing each other down.
- WORKS WITH YOUR EXISTING INTERNET SERVICE: Pairs with your existing modem or gateway via ethernet. Compatible with most cable, fiber, DSL, and satellite providers. Some gateways and modem router combos may require bridge mode. No coax needed.
- SET UP AND MANAGE YOUR NETWORK WITH THE NIGHTHAWK APP: Download the free Nighthawk app on iOS or Android for guided setup. Manage WiFi, run speed tests, pause devices, and set up guest networks from anywhere. Active internet required.
- READY FOR THE DEVICES YOU ALREADY OWN: Your phones, laptops, and TVs work right out of the box. WiFi 6 delivers speeds up to 1.8 Gbps across 2.4 GHz and 5 GHz bands. Backward compatible with WiFi 5 and earlier.
- COVERAGE IN EVERY ROOM: Covers up to 1,500 sq. ft. for up to 20 connected devices. Walls, floors, and interference can reduce range. Larger or multi-story homes may benefit from a NETGEAR Orbi mesh WiFi system.
page.on('request', request => {
const isApi = request.resourceType() === 'xhr' ||
request.resourceType() === 'fetch';
if (isApi) console.log(request.url(), request.headers());
if (!request.isInterceptResolutionHandled()) request.continue();
});
Filtering what you print does not permit you to leave other requests unresolved. If you need a reproducible audit, store the complete header object and add a separate classification field.
Redact secrets before storage
Authorization tokens, session cookies, API keys and custom credentials can appear in headers. Redact values before writing logs or sending them to a shared system:
function safeHeaders(headers) {
const secret = /^(authorization|cookie|set-cookie|x-api-key)$/i;
return Object.fromEntries(Object.entries(headers).map(([name, value]) => [
name, secret.test(name) ? '[REDACTED]' : value
]));
}
Keep the original values only in an access-controlled store when your test or incident procedure genuinely requires them.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Changing headers while inspecting them
request.continue({headers}) can override headers for an individual request. Start with request.headers() if you want to preserve the values Puppeteer exposed, then modify or delete specific keys:
Rank #4
- 𝐅𝐮𝐭𝐮𝐫𝐞-𝐑𝐞𝐚𝐝𝐲 𝐖𝐢-𝐅𝐢 𝟕 - Designed with the latest Wi-Fi 7 technology, featuring Multi-Link Operation (MLO), Multi-RUs, and 4K-QAM. Achieve optimized performance on latest WiFi 7 laptops and devices, like the iPhone 16 Pro, and Samsung Galaxy S24 Ultra.
- 𝟔-𝐒𝐭𝐫𝐞𝐚𝐦, 𝐃𝐮𝐚𝐥-𝐁𝐚𝐧𝐝 𝐖𝐢-𝐅𝐢 𝐰𝐢𝐭𝐡 𝟔.𝟓 𝐆𝐛𝐩𝐬 𝐓𝐨𝐭𝐚𝐥 𝐁𝐚𝐧𝐝𝐰𝐢𝐝𝐭𝐡 - Achieve full speeds of up to 5764 Mbps on the 5GHz band and 688 Mbps on the 2.4 GHz band with 6 streams. Enjoy seamless 4K/8K streaming, AR/VR gaming, and incredibly fast downloads/uploads.
- 𝐖𝐢𝐝𝐞 𝐂𝐨𝐯𝐞𝐫𝐚𝐠𝐞 𝐰𝐢𝐭𝐡 𝐒𝐭𝐫𝐨𝐧𝐠 𝐂𝐨𝐧𝐧𝐞𝐜𝐭𝐢𝐨𝐧 - Get up to 2,400 sq. ft. max coverage for up to 90 devices at a time. 6x high performance antennas and Beamforming technology, ensures reliable connections for remote workers, gamers, students, and more.
- 𝐔𝐥𝐭𝐫𝐚-𝐅𝐚𝐬𝐭 𝟐.𝟓 𝐆𝐛𝐩𝐬 𝐖𝐢𝐫𝐞𝐝 𝐏𝐞𝐫𝐟𝐨𝐫𝐦𝐚𝐧𝐜𝐞 - 1x 2.5 Gbps WAN/LAN port, 1x 2.5 Gbps LAN port and 3x 1 Gbps LAN ports offer high-speed data transmissions.³ Integrate with a multi-gig modem for gigplus internet.
- 𝐎𝐮𝐫 𝐂𝐲𝐛𝐞𝐫𝐬𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐂𝐨𝐦𝐦𝐢𝐭𝐦𝐞𝐧𝐭 - TP-Link is a signatory of the U.S. Cybersecurity and Infrastructure Security Agency’s (CISA) Secure-by-Design pledge. This device is designed, built, and maintained, with advanced security as a core requirement.
page.on('request', request => {
if (request.isInterceptResolutionHandled()) return;
const headers = {
...request.headers(),
'x-debug-run': 'capture-2026-09-29'
};
delete headers['x-remove-me'];
request.continue({headers});
});
This changes the browser request path; it does not create a raw-wire recorder. Header casing and ordering should not be used as a protocol fingerprint.
When setExtraHTTPHeaders() is the better API
If your goal is simply to add the same headers to every request initiated by the page, use Puppeteer’s dedicated page-wide API instead of interception:
await page.setExtraHTTPHeaders({
'x-tenant-id': 'demo',
'accept-language': 'en-US'
});
Puppeteer lower-cases these additional header names and requires string values. It does not guarantee outgoing header order. Use this API for uniform additions; use interception when you must inspect, filter, abort, respond to, or alter individual requests.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesRequest headers versus response headers
The request object’s headers() method is not a response inspection API. For response headers, use the response object’s headers() method in a response listener:
Best Value
- Dual band router upgrades to 1200 Mbps high speed internet (300mbps for 2.4GHz plus 900Mbps for 5GHz), reducing buffering and ideal for 4K stream
- Full Gigabit Ports - Gigabit Router with 4 Gigabit LAN ports, ideal for any internet plan and allow you to directly connect your wired devices
- Boosted Coverage - Four external antennas equipped with Beamforming technology extend and concentrate the Wi-Fi signals
- MU-MIMO technology - (5GHz band) allows high speeds for multiple devices simultaneously
- Access Point Mode - Supports AP Mode to transform your wired connection into wireless network, an ideal wireless router for home
page.on('response', response => {
console.log(response.status(), response.url(), response.headers());
});
Puppeteer documents response names as lower-case as well. Duplicate response values are combined with commas, except Set-Cookie, which is separated by newlines. Capture request and response records independently so a response header is not mistaken for a header the browser sent.
Troubleshooting
The page hangs or navigation times out
- Cause: interception was enabled but one code path never resolved a request.
- Fix: call
continue(),abort(), orrespond()for every request, including branches that fail validation. Add an immediate handled check when multiple listeners exist.
“Request is already handled” or a resolution error
- Cause: another listener or package resolved the request, often while your handler awaited a promise.
- Fix: check
isInterceptResolutionHandled()before and after every await, and coordinate or remove duplicate listeners.
Headers appear lower-case or seem incomplete
- Cause: Puppeteer normalizes names and exposes associated browser headers rather than a packet-level byte stream.
- Fix: compare names case-insensitively, and do not rely on original casing, wire order, or an assumption that every transport-level detail is represented.
Only the first URL is logged
- Cause: the script records navigation but ignores redirects or subresource events.
- Fix: attach the listener before
goto, log everyrequest, and includerequestfinishedandrequestfailedevents.
Extra headers do not appear exactly as expected
- Cause:
setExtraHTTPHeaders()does not guarantee order, and browser-managed headers can vary by request. - Fix: test for the header’s presence and value, not its position. Use interception overrides when the decision must be per request.
Performance, reliability and privacy notes
- Logging every request can produce large files on media-heavy pages. Stream NDJSON, sample static assets, or filter after recording a short diagnostic run.
- Synchronous, lightweight handlers minimize the time requests remain paused. If storage is asynchronous, use the post-await handled check shown above.
- Network-idle waits are unsuitable for pages with persistent sockets, polling, or advertisements. Prefer a known selector or application-ready signal.
- Never publish captured cookies or authorization values. Redaction should happen before logs leave the machine.
- The API details referenced here correspond to Puppeteer documentation labeled versions 25.9.0 through 25.12.0. Match the guidance to the version installed in your project and recheck interception behavior when upgrading.
Or skip the browser setup
If you need a clean visual capture rather than a header audit, ScreenshotNeo provides a website screenshot API and MCP server. A single GET returns PNG, JPEG, WebP or PDF; it accepts consent banners before removing more than 60 known consent platforms, newsletter popups and chat widgets. Only clean shots are billed: bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and the response identifies the result with X-Page-Verdict and X-Billed.
cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
See the ScreenshotNeo documentation for options such as CSS-selector capture, custom headers and cookies, JavaScript, waits, blocking, device presets, PDFs, caching, signed links, asynchronous webhooks and bulk capture. Its MCP tools—take_screenshot, get_page_info and capture_pdf—let Claude, Cursor and other MCP clients operate without a custom browser harness. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
Frequently Asked Questions
Does interception capture headers from every browser process or tab?
It captures requests issued by the page on which interception is enabled. Configure each page you use and account separately for service workers, pop-ups, redirects and other browser contexts.
Can Puppeteer prove which headers reached the server?
No. The API exposes headers associated with the browser request, not a packet trace or server-side receipt. Use server logs or a controlled endpoint when wire-level confirmation is required.
Should I use interception to add one global header?
Usually no. Use page.setExtraHTTPHeaders() for page-wide additions; reserve interception for per-request inspection or decisions.
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.
Recommended Free Tools

