HeaderDial › Guides

How to override response headers in Chrome DevTools, and when to use an extension instead

Since Chrome 113, DevTools can override response headers without an extension. In the Network panel, right-click a request and choose Override headers. Then edit the header, or put rules for many URLs in a .headers file under Sources › Overrides. In our test in Chrome 159, the overrides reached page loads and fetch() calls, and an added Set-Cookie was stored. They applied only in the tab whose DevTools was open, and stopped as soon as DevTools closed. They did not reach CORS preflight responses, and DevTools overrides cannot change request headers at all. For a quick look at one response, DevTools is enough. If the change has to cover requests or preflights, stay on without DevTools, or work in Firefox, use an extension.

Setting up a header override in DevTools

These steps are taken from Chrome's documentation: Override web content and HTTP response headers locally and What's new in DevTools (Chrome 113). Our test (below) set up the overrides folder through Chrome's profile settings, so we did not click through these screens ourselves.

  1. Open DevTools (F12), go to the Network panel and reload the page.
  2. Right-click the request and choose Override headers. The first time, DevTools asks you to Select folder for override files; pick an empty folder and click Allow in the bar that appears.
  3. Under Response Headers, hover over a value and click the edit icon to change it, or add a header of your own.
  4. To manage every header override in one place, open the .headers file under Sources › Overrides. Add override rule applies headers to many URLs with * wildcards.
  5. Untick Enable Local Overrides in Sources › Overrides to switch them off, or click Clear to delete them.

The .headers file is JSON. This is the file we wrote by hand for the test, and Chrome 159 applied it:

[
  {
    "applyTo": "*",
    "headers": [
      { "name": "x-added", "value": "yes" },
      { "name": "access-control-allow-origin", "value": "*" }
    ]
  }
]

A .headers file at the top of the overrides folder applied to every site. One in a sub-folder named after the host and port, 127.0.0.1:18765/, applied to that host only. A folder named 127.0.0.1%3A18765/ did nothing.

What we measured

We tested in November 2026 with Chrome for Testing 159.0.8154.6 on Linux, and HeaderDial 0.4.0 for comparison. Chrome ran headless with a real DevTools window opened for each tab (--auto-open-devtools-for-tabs). We registered the overrides folder in the browser profile's DevTools settings with local overrides switched on, and wrote the .headers file above. Two local servers on different ports stood in for a site and its API. The HeaderDial run used response header rows with the same names and values, plus one request header, with no DevTools open. The results:

CheckDevTools overridesHeaderDial
Changed or added response header on a page loadappliedapplied
Same header read by fetch() through response.headersoverridden valueoverridden value
Set-Cookie: dtc=1; Path=/ addedcookie storedcookie stored
Same tab after DevTools was closedserver's headers againunaffected (does not use DevTools)
A second tab whose DevTools was closed, while the first tab kept DevTools openserver's headersapplied in every tab, unless the profile is limited to one
Cross-origin fetch(), API sends no CORS headers, Access-Control-Allow-Origin: * addedsucceededsucceeded
Same, with a custom request header (needs a preflight)blocked: the OPTIONS preflight got the server's headerssucceeded
Add a request header (X-Debug: 1)not possible with overridesserver received it

For the two CORS rows we started Chrome with --disable-features=LocalNetworkAccessChecks. Both test servers ran on the same machine. While DevTools overrides were active, Chrome's local network access check blocked the call to the second port before CORS was checked, so without the flag the rows told us nothing about CORS. HeaderDial gave the same results with and without the flag. We did not test Edge, which has the same DevTools feature, or a site on the public internet.

What DevTools overrides cannot do

When DevTools is the right tool

When an extension is the better tool

Steps with HeaderDial

  1. Click the HeaderDial icon. If the site-access banner appears, choose Allow on all sites or Only <current host>. For a page on one host that calls an API on another, allow both.
  2. Click + Response header and enter the header and value, for example Access-Control-Allow-Origin and http://localhost:3000. Keep the operation on set, or choose remove to drop a header the server sends. Request headers work the same way with + Request header.
  3. Open Where it applies, click + Only on… and choose Domain with your host, so the change stays on the site you are testing.
  4. Reload. The change stays in place when you close DevTools, and applies in every tab that matches the filter.

The curl equivalent

curl cannot override what a server sends back, but it shows exactly what the server sends, including the preflight answer that DevTools overrides do not change:

# the response headers the server really sends
curl -sI https://staging.example.com/

# the CORS preflight a browser would send before a request with a custom header
curl -si -X OPTIONS https://api.example.com/items \
  -H "Origin: http://localhost:3000" \
  -H "Access-Control-Request-Method: GET" \
  -H "Access-Control-Request-Headers: x-custom"

# send a request header, which DevTools overrides cannot do
curl -H "X-Debug: 1" https://staging.example.com/

Pitfalls

Both tools change only what your browser sees. Once the header works, fix it on the server too: other visitors, and your own production build, still get the original response.

Add to ChromeFirefox: coming soon