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

To trace every redirect in headless Chrome, record each navigation request and response rather than inspecting only the final URL. Puppeteer provides the shortest path: call page.goto(), obtain the returned response’s request, and read redirectChain(). For protocol-level evidence—request IDs, headers, timings, subresource redirects, or interception—use Chrome DevTools Protocol (CDP) Network events. Use the CDP Fetch domain when you must pause or modify a redirect.

This guide shows all three approaches, explains what each hop means, and includes recovery steps for the cases where a trace appears to contain only the destination.

What a redirect trace must contain

A redirect chain is a sequence of HTTP requests. The browser sends a request to a source URL, receives a redirect response, reads its Location header, and sends the next request. The final URL alone does not tell you how the browser got there.

For each hop, retain:

  • the source URL and the destination URL from Location;
  • the HTTP status, normally 301, 302, 303, 307, or 308;
  • the request method (such as GET or POST);
  • request and response headers, especially Location;
  • the browser request ID when using CDP; and
  • timestamps or timing data.

Keep the final response separately: it has its own status, URL, MIME type, and timing and is not itself a redirect hop.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Fastest method: Puppeteer’s redirectChain()

Puppeteer is the right level of abstraction when you need the navigation chain and final result without implementing the protocol event model. The request returned by the final navigation response contains the preceding redirected requests.

Complete Node.js example

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();

try {
  const response = await page.goto('http://example.com', {
    waitUntil: 'networkidle0',
    timeout: 30000
  });

  if (!response) {
    throw new Error('Navigation produced no response');
  }

  const finalRequest = response.request();
  const hops = finalRequest.redirectChain().map((request) => ({
    url: request.url(),
    method: request.method(),
    headers: request.headers()
  }));

  console.log(JSON.stringify({
    hops,
    finalUrl: response.url(),
    finalStatus: response.status()
  }, null, 2));
} finally {
  await browser.close();
}

Install Puppeteer with npm install puppeteer, then run the file as an ES module (for example, give it an .mjs extension or set "type":"module" in package.json). In the documented HTTP-to-HTTPS example, the chain has one request. A URL with no redirects produces an empty array.

How to interpret the result

Each object in hops is a request that was redirected. The response’s url() is the destination after the last hop, and status() is the final response status. Puppeteer’s chain does not by itself provide every response status or every redirect header; use CDP when that evidence matters.

Raw CDP Network events for complete evidence

CDP exposes the browser’s Network domain directly. Enable it before navigation and listen for Network.requestWillBeSent and Network.responseReceived. A request event whose redirectResponse field is populated represents the next request after a redirect.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Capture navigation redirects with a CDP session

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
const client = await page.createCDPSession();

const requests = new Map();
const redirects = [];
const responses = [];

await client.send('Network.enable');

client.on('Network.requestWillBeSent', (event) => {
  const { requestId, request, timestamp, redirectResponse } = event;
  requests.set(requestId, {
    requestId,
    url: request.url,
    method: request.method,
    timestamp,
    headers: request.headers
  });

  if (redirectResponse) {
    redirects.push({
      requestId,
      sourceUrl: redirectResponse.url,
      destinationUrl: request.url,
      status: redirectResponse.status,
      location: redirectResponse.headers?.location ??
        redirectResponse.headers?.Location ?? null,
      method: request.method,
      timestamp
    });
  }
});

client.on('Network.responseReceived', (event) => {
  const { response, requestId, timestamp, type } = event;
  responses.push({
    requestId,
    url: response.url,
    status: response.status,
    mimeType: response.mimeType,
    type,
    timestamp,
    headers: response.headers
  });
});

try {
  await page.goto('http://example.com', {
    waitUntil: 'load',
    timeout: 30000
  });
  await page.waitForNetworkIdle({ idleTime: 500, timeout: 10000 });
  console.log(JSON.stringify({ redirects, responses }, null, 2));
} finally {
  await browser.close();
}

Register listeners before calling goto(); otherwise the first hop can be missed. The redirectResponse object supplies the prior response’s URL, status, and headers. The following request event supplies the destination URL and method, allowing you to connect the two records. responseReceived gives the final status, MIME type, headers, and timing for each observed response.

Navigation versus subresource redirects

CDP reports more than top-level navigation. Images, scripts, stylesheets, fonts, XHR, and fetch requests can redirect too. Use the event’s resource type and request ID to separate a document chain from subresource activity. Puppeteer’s redirectChain() is focused on the request associated with the navigation response, so it is not a replacement for Network events when you need every resource.

Intercept a redirect with the CDP Fetch domain

Use Fetch interception when you need to pause a redirect, inspect it before continuation, or alter how the browser proceeds. A paused redirect response is identifiable by status 301, 302, 303, 307, or 308 plus a Location header. The subsequent request includes redirectedRequestId, linking it to the request that caused the redirect.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
const client = await page.createCDPSession();

await client.send('Fetch.enable', {
  patterns: [{ requestStage: 'Response' }]
});

client.on('Fetch.requestPaused', async (event) => {
  const { requestId, request, responseStatusCode, responseHeaders,
          redirectedRequestId } = event;
  const locationHeader = responseHeaders?.find((h) =>
    h.name.toLowerCase() === 'location');

  if ([301, 302, 303, 307, 308].includes(responseStatusCode) && locationHeader) {
    console.log({
      requestId,
      redirectedRequestId: redirectedRequestId ?? null,
      sourceUrl: request.url,
      status: responseStatusCode,
      location: locationHeader.value
    });
  }

  // Continue so navigation is not left paused.
  await client.send('Fetch.continueRequest', { requestId });
});

try {
  await page.goto('http://example.com', { waitUntil: 'load', timeout: 30000 });
} finally {
  await client.send('Fetch.disable').catch(() => {});
  await browser.close();
}

Do not call Fetch.getResponseBody for a redirect response. Redirect bodies are unavailable through the official Fetch interface; record the status and headers instead. Always continue or fail a paused request, and disable Fetch interception during cleanup, or the page can remain suspended.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Manual validation in Chrome DevTools

  1. Open Chrome DevTools before starting navigation.
  2. Select the Network panel and enable recording.
  3. Navigate to the URL in the same tab.
  4. Inspect the request table’s Status, Initiator, type, size, time, and waterfall columns.
  5. Open each document request and inspect response headers, including Location.

The Initiator column can identify an HTTP redirect and helps distinguish it from a parser- or script-initiated request. Starting recording before navigation matters: opening DevTools after the page has loaded cannot recover earlier hops.

Which approach should you choose?

Approach Best for Redirect metadata Interception Complexity
Puppeteer redirectChain() A quick top-level navigation report Redirected request URLs, methods, and headers; final URL and status No Lowest
CDP Network Request IDs, response headers, timings, and subresources Full event-level linkage through redirectResponse No Medium
CDP Fetch Pausing, modifying, or conditionally continuing redirects Status, Location, request linkage Yes Highest
DevTools Network panel Human validation and waterfall inspection Visible request and response details Limited manual controls Lowest for one-off checks

Why a trace shows only the final URL

Listeners started too late

If CDP listeners are attached after goto(), the initial request and first redirect may already be gone. Create the session, enable Network, and register handlers first.

The wrong request was inspected

A page can perform many requests. The final document response’s request is the one Puppeteer uses for navigation-chain reporting. In CDP, group events by request ID and resource type instead of taking the last URL printed globally.

The navigation produced no HTTP response

Downloads, aborted navigations, renderer errors, and some client-side transitions can result in no usable Puppeteer response. Check for a null response, capture browser console and page errors, and inspect CDP events.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

The redirect is client-side

Meta refresh and JavaScript navigation do not appear as an HTTP Location response. Network events still show the subsequent document request, but there is no preceding 3xx hop. Record the initiator and document timing to distinguish these cases.

Service workers or cache affect the sequence

A service worker can fulfill a request without a network round trip, and cached responses can change what appears in the panel. For reproducible diagnostics, use a fresh browser context, clear relevant storage, and compare a run with cache disabled in DevTools.

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

Status codes, methods, and URL handling

Do not treat all redirects as interchangeable. 301 and 308 are commonly permanent; 302 and 303 can change how a user agent handles the next request; 307 and 308 preserve the method and request body by definition. Capture the method on both sides rather than inferring it from the status. Resolve relative Location values against the source URL before storing a canonical destination, while retaining the raw header for audit purposes.

Redirects can also cross origins, change schemes, or add and remove ports. A cross-origin hop may alter which cookies and authorization headers are sent. Never log sensitive authorization or cookie values in shared reports; redact them while keeping header names and redirect status.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Timeouts, reliability, and performance

  • Set an explicit navigation timeout. A page that waits indefinitely for a long-polling request should not block redirect reporting.
  • Choose waitUntil: 'load' when the redirect chain is the goal. Use networkidle0 only when you also need post-load requests, because analytics and persistent connections can prevent quiescence.
  • Keep event handlers lightweight. Store structured records and write them after navigation rather than performing slow file or network operations inside every CDP callback.
  • Use one browser instance with isolated contexts for batches, but create a new context when cookies, service workers, or cache could contaminate a comparison.
  • Use a monotonic CDP timestamp for ordering and retain wall-clock time separately if reports must be correlated with server logs.

Or skip the browser setup

If your actual goal is a clean visual capture after a URL settles—not a protocol audit—ScreenshotNeo provides a single screenshot request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and each response identifies the page verdict and billing result in X-Page-Verdict and X-Billed headers. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

For redirect-aware visual checks, let the browser follow the URL, then capture the resulting page:

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 parameters and response headers. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

Troubleshooting checklist

  • Empty chain: verify that the URL really returns an HTTP redirect and that listeners were installed before navigation.
  • Missing Location: inspect the raw response headers; malformed servers may return a 3xx status without a usable destination.
  • Navigation timeout: lower the wait condition to load, retain the events already collected, and investigate the page’s long-running requests separately.
  • Repeated redirects: record every hop and stop after a defined maximum; check scheme, host, cookie, and trailing-slash rules for a loop.
  • Unexpected credentials in logs: redact cookie, authorization, and proxy-authentication values before persisting records.
  • Paused page under Fetch: ensure every Fetch.requestPaused event receives continueRequest, fulfillRequest, or failRequest.
  • No body available: expected for redirect responses in Fetch; use status and headers instead.

Frequently Asked Questions

Can Puppeteer follow redirects without exposing them?

Yes. Normal navigation follows them automatically; use the final response request’s redirectChain() to expose the preceding requests.

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

Does a 200 response prove there were no redirects?

No. It only describes the final response. Check the Puppeteer chain or CDP request events to establish whether earlier 3xx responses occurred.

Can CDP show redirects made by an image or script?

Yes. Network events include subresource requests; classify them by resource type and keep their request IDs separate from the document navigation.

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.