The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Enable request interception, then call request.continue() with only the fields you want to change: headers, method, postData, or url. Every intercepted request must be continued, responded to, or aborted; otherwise it can remain stalled.
Basic pattern: continue a request with a header override
Turn interception on before the request you want to handle. This complete example adds a header to each request while preserving its existing headers:
As an Amazon Associate I earn from qualifying purchases.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.setRequestInterception(true);
page.on('request', request => {
if (request.isInterceptResolutionHandled()) return;
const headers = {
...request.headers(),
'x-example': 'value',
};
request.continue({ headers }).catch(error => {
console.error('Could not continue request:', error);
});
});
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
} finally {
await browser.close();
}
})();
The copied header object matters: passing a new object without copying the existing headers replaces them. Puppeteer reports header names in lower case. Its documented pattern also allows an undefined value to remove a header.
Free tools Windows power users keep installed
One-click scans. No signup required.
Which override should you use?
HTTPRequest.continue() accepts a ContinueRequestOverrides object. The optional fields are:
#1 Best Overall
| Field | Use it to | Important detail |
|---|---|---|
headers |
Replace or modify request headers. | Copy request.headers() first if you want to retain existing values; header names are lower case. |
method |
Change the HTTP method for this request. | Supply the intended method as an override; do not assume other request properties change automatically. |
postData |
Set the request body data. | request.postData() may not be available for long or not-readily-decoded data; use fetchPostData() for that case. |
url |
Change the URL used for the request. | Puppeteer says this changes the request URL; it is not a redirect. |
Use only the fields relevant to the change. For example, to modify both a header and the URL, provide both in the same object: request.continue({ headers, url: 'https://example.com/other' }).
Make sure every intercepted request is resolved
After page.setRequestInterception(true), intercepted requests pause until they are continued, responded to, aborted, or completed using the browser cache. A handler that does not need to customize a particular request must still continue it.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
page.on('request', request => {
if (request.isInterceptResolutionHandled()) return;
if (request.url().includes('/api/')) {
request.continue({ headers: { ...request.headers(), 'x-example': 'value' } });
} else {
request.continue();
}
});
Enable interception before navigation or before the particular request starts. Calling request.continue() without interception enabled throws. Puppeteer documents these behaviors in its HTTPRequest.continue() API and Page.setRequestInterception() API.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePrevent duplicate resolution when handlers overlap
Multiple request listeners may be registered by your code or by libraries. Before resolving a request, check request.isInterceptResolutionHandled(). If your handler awaits asynchronous work, check again immediately before calling continue(), abort(), or respond(); another listener may have handled the request while your handler was waiting.
Rank #3
page.on('request', async request => {
if (request.isInterceptResolutionHandled()) return;
const shouldAddHeader = await decideWhetherToModify(request);
// Another listener may have resolved it during the await.
if (request.isInterceptResolutionHandled()) return;
const headers = shouldAddHeader
? { ...request.headers(), 'x-example': 'value' }
: request.headers();
await request.continue({ headers });
});
Use the guard consistently in handlers that may share a page. A second attempt to resolve a request can fail because the request has already been handled.
When multiple listeners need priority control
Puppeteer supports cooperative interception when every resolving handler supplies a numeric priority. The highest priority wins. If actions tie, the order is abort ahead of respond, and respond ahead of continue. If even one handler omits a priority, legacy immediate resolution applies instead.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
| Mode | How it behaves | Choose it when |
|---|---|---|
| Legacy immediate resolution | A handler resolves the request as soon as it calls a resolution method without a priority. | You own the listeners or do not need them to weigh in together. |
| Cooperative priority resolution | All resolving handlers pass numeric priorities; Puppeteer selects the winning action after considering them. | Handlers need to participate in a shared decision. |
For a continuation that simply passes the request along in cooperative mode, Puppeteer recommends the default priority, 0. Do not mix priority and no-priority calls if you expect cooperative behavior. See Puppeteer’s network interception guide for the handling model and resolution checks.
Common problems and fixes
continue()throws because interception is not enabled: callawait page.setRequestInterception(true)before navigation or before the request is issued.- A page or resource appears to hang: inspect every request listener and ensure each intercepted request reaches a resolution path. Requests are paused until resolved, subject to browser-cache completion.
- A request is resolved twice: guard with
isInterceptResolutionHandled(); after anyawait, check again immediately before resolving. - Existing headers disappear: merge the desired changes into
request.headers()instead of passing only the new header. - The URL change behaves unlike navigation redirection: a
urloverride changes the intercepted request URL; Puppeteer explicitly does not describe it as a redirect. - POST data is missing:
postData()can be unavailable when the body is too long or is not readily decoded. UsefetchPostData()where that applies. - Priority values do not produce the expected winner: confirm every listener resolving the request supplies a numeric priority. A no-priority resolution switches to legacy immediate handling.
Version and source notes
Puppeteer’s API pages identify HTTPRequest.continue() as version 25.12.0 and ContinueRequestOverrides as version 25.10.0. APIs can change between releases, so check the documentation matching the Puppeteer version installed in your project.
Best Value
Or skip the browser setup
If you need screenshots rather than custom interception logic, ScreenshotNeo is a website screenshot API and MCP server. Its one-call API returns a screenshot or PDF:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for options. Cookie banners are accepted and removed before capture, along with supported newsletter popups and chat widgets; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server lets AI agents use take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo’s free plan.
Frequently Asked Questions
Can I change a request URL with `request.continue()`?
Yes. Pass a `url` override; Puppeteer specifies that this changes the request URL and is not a redirect.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Where can I check request body data if `postData()` is unavailable?
Puppeteer’s request reference advises using `fetchPostData()` when the body is too long or not readily decoded.
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.




