October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Continue an Intercepted Request in Puppeteer

Enable interception before navigation, then explicitly continue each request that should proceed. Learn how to avoid double resolutions, modify headers, use priorities, and fix stalled requests.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enable request interception before navigation, listen for each request event, and call request.continue() on requests you want the browser to send. Every intercepted request needs a resolution—continue, respond, abort, or complete through the browser cache—or it can stall page loading.

Continue requests with the basic interception pattern

Use this sequence: enable interception, register the handler, then navigate. The Puppeteer guide demonstrates this enable-listen-continue flow. The documentation consulted is labeled Puppeteer 25.12.0; check the documentation for your installed release if you target an older version.

As an Amazon Associate I earn from qualifying purchases.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();

  await page.setRequestInterception(true);
  page.on('request', request => {
    if (request.isInterceptResolutionHandled()) return;

    // Continue requests that need no special handling.
    request.continue();
  });

  await page.goto('https://example.com');
} finally {
  await browser.close();
}

Interception must be enabled before using the request-continuation API. See Page.setRequestInterception() and HTTPRequest.continue().

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why pass-through requests still need handling

Once interception is active, a request does not simply proceed because your handler has no changes to make. Explicitly continue it. As the Puppeteer Request Interception guide puts it, “Puppeteer requires request.continue() to be called explicitly or the request will hang.”

Avoid resolving a request twice

Another request listener or package may already have continued, responded to, or aborted the request. Resolving it again can raise Request is already handled!. Check isInterceptResolutionHandled() immediately before acting.

If your handler awaits asynchronous work, check again afterward. A check made before an await can become stale while the handler is paused; keep the final check and resolution adjacent and synchronous:

page.on('request', async request => {
  if (request.isInterceptResolutionHandled()) return;

  await decideWhatToDo(request);

  // Another handler may have resolved it during the await.
  if (request.isInterceptResolutionHandled()) return;
  request.continue();
});

Use this guard when other listeners may be installed. For a handler with no asynchronous decision-making, the simple synchronous pattern avoids an unnecessary race window.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Continue with request overrides

request.continue(overrides?, priority?) accepts optional overrides and an optional priority, and returns a Promise<void>. The documented header example copies existing headers, adds one, and removes another by assigning undefined:

page.on('request', request => {
  if (request.isInterceptResolutionHandled()) return;

  const headers = {
    ...request.headers(),
    foo: 'bar',
    origin: undefined, // remove the origin header
  };
  request.continue({ headers });
});

Use the installed release’s ContinueRequestOverrides type to confirm which request fields are supported; the available overrides are defined by Puppeteer’s API and can vary by version. Do not assume every property of a request can be changed.

Coordinate multiple handlers with priorities

Without a priority, a resolution takes effect immediately using legacy behavior. Cooperative Intercept Mode applies only when every resolution supplies a numeric priority; Puppeteer then waits for asynchronous handlers and selects the highest priority. For equal priorities, the order is abort, then respond, then continue. A single legacy resolution can still act immediately, so keep the handled-state check when other listeners may exist.

If a handler has no special preference and should allow another handler to make a deliberate decision, the guide recommends an unopinionated continuation at priority 0 or DEFAULT_INTERCEPT_RESOLUTION_PRIORITY. A higher custom priority is for a handler that intentionally wants to override another resolution.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import puppeteer, {
  DEFAULT_INTERCEPT_RESOLUTION_PRIORITY,
} from 'puppeteer';

page.on('request', request => {
  if (request.isInterceptResolutionHandled()) return;

  request.continue(
    request.continueRequestOverrides(),
    DEFAULT_INTERCEPT_RESOLUTION_PRIORITY,
  );
});

Confirm that the constant is exported by your installed Puppeteer release before using this version-specific import. For exact semantics, see the network interception guide and the continue API reference.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot stalled or failed interception

Symptom Likely cause What to check or change
Navigation or page loading stalls An intercepted request never received a resolution. Ensure every request your handler receives is continued, responded to, or aborted as appropriate. A pass-through request still needs continue().
Request is already handled! A different listener or package resolved the same request first, or it did so during an asynchronous wait. Check isInterceptResolutionHandled() immediately before resolving and repeat the check after any await.
Continuation fails because interception is disabled setRequestInterception(true) was not called before using the continuation API. Enable interception on the page before navigation and before calling request.continue().
Handlers produce an unexpected result At least one handler may be resolving without a priority, invoking legacy behavior instead of cooperative finalization. Review every handler that can resolve the request. Cooperative resolution requires numeric priorities for all resolutions.

Or skip the browser setup

If your goal is to get a clean screenshot rather than control individual browser requests, ScreenshotNeo provides a screenshot API and MCP server. A single GET request can return a PNG, JPEG, WebP, or PDF; the API is not a replacement for Puppeteer’s request-interception logic.

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 documentation for request options. Cookie banners, newsletter popups, and chat widgets are removed before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo and get 1,000 free screenshots a month with no card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.