Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

How to Check Whether a Puppeteer Response Came from a Service Worker

Check a Puppeteer response’s service-worker provenance with HTTPResponse.fromServiceWorker(), and distinguish it from browser cache and interception state.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Call response.fromServiceWorker() on Puppeteer’s HTTPResponse. It returns true when the response was served by a service worker. In a page-level response handler, the event supplies the response object to inspect.

Check service-worker provenance in the response event

Register a response listener and call fromServiceWorker() on each response:

As an Amazon Associate I earn from qualifying purchases.

page.on('response', response => {
  if (response.fromServiceWorker()) {
    console.log('Served by a service worker:', response.url());
  }
});

The event callback receives an HTTPResponse. The method is documented in Puppeteer’s HTTPResponse.fromServiceWorker() API reference; the version shown there is 25.4.0. If your project uses another Puppeteer version, check that version’s API documentation.

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

Check one response directly

If you already have an HTTPResponse, use the same method without registering a listener:

const servedByServiceWorker = response.fromServiceWorker();
console.log(servedByServiceWorker);

The result is a boolean. It answers whether that response came from a service worker; it does not identify which worker handled it.

Do not confuse service workers with browser cache or interception

Puppeteer exposes separate methods and state for these different questions. fromServiceWorker() checks service-worker provenance; fromCache() checks whether the response came from the browser’s disk or memory cache. A cache result alone does not establish whether a service worker served the response. See the HTTPResponse API for the distinction.

What you want to know What to inspect
Was this response served by a service worker? response.fromServiceWorker()
Did this response come from browser cache? response.fromCache()
Has Puppeteer’s intercepted request been resolved, and how? isInterceptResolutionHandled() or interceptResolutionState()

Request interception is a separate mechanism. When enabled, Puppeteer stalls intercepted requests until your code continues, fulfills, or aborts them. Interception-resolution methods describe that process; they are not substitutes for the response’s service-worker provenance check. See Puppeteer’s request interception guide.

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

Handle HTTP errors as responses, not automatically as request failures

A response with an HTTP status such as 404 or 503 still arrives through the response event. Its status code alone does not make it a request failure. You can inspect the status and service-worker provenance on the same response:

page.on('response', response => {
  console.log({
    url: response.url(),
    status: response.status(),
    servedByServiceWorker: response.fromServiceWorker(),
  });
});

Puppeteer documents the response event payload and HTTP error-response behavior in its Page events reference. Keep response handling distinct from request-failure handling: an HTTP error status is still a received response.

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

Or skip the browser setup

ScreenshotNeo is a website screenshot API, not a Puppeteer diagnostic tool: it does not report whether a response came from a service worker. If your goal is to get a page screenshot rather than inspect response provenance, a single request can return an image:

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. It removes cookie/consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. It also provides an MCP server for AI agents. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for the free plan.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.