Headerwise

How to set a request header in Chrome

You want every request to your API to carry Authorization: Bearer …, or a staging cookie, or X-Env: staging so a router sends you to the right backend. Here's what works, from the quickest to the most complete.

What DevTools can and can't do

Chrome DevTools is great for looking at headers, but it can't add a request header to the requests a page makes. Its local overrides change response headers, and for headers "Network conditions" changes only the User-Agent. Both work only while DevTools is open, in that one tab.

One request: curl, or "Copy as cURL"

To try a single call, right-click it in DevTools' Network panel, choose Copy → Copy as cURL, and add your header:

curl 'https://api.example.com/me' -H 'Authorization: Bearer YOUR_TOKEN'

In browser tests

Playwright has extraHTTPHeaders, and Selenium can call the DevTools protocol's Network.setExtraHTTPHeaders. Both add the header to every request from that page, including third-party ones. More in headers in Selenium, Playwright and Puppeteer.

Every request, in your everyday browser: an extension

For pages you open by hand, a header extension is the way. With Headerwise (free, open source):

  1. Install it from the Chrome Web Store (Edge, Brave and Vivaldi install from there too) and click Allow on all sites in its popup: Chrome only lets an extension change headers on sites it has access to.
  2. In the profile, type the header name and value, for example Authorization and Bearer YOUR_TOKEN. Or paste a request copied as cURL, fetch or PowerShell and tick the headers you want.
  3. Keep it to your own sites: add an only on filter such as ||api.example.com^. Otherwise the token goes to every site, which Headerwise warns about.
  4. Reload the page. The popup's On this tab shows how many requests the profile changed; DevTools may still show the original headers, because the browser changes them after DevTools records the request.

Tokens and cookies show as dots in the popup until you click the eye, and a profile can switch itself off after 15 minutes up to 8 hours, so a production header isn't left on by accident.

Set, not append, for most headers. Chrome lets extensions append to only a few request headers (Accept, Cookie and some others); for the rest, use set. Headerwise says so in the popup when a rule won't apply.

Removing a header

The same works the other way: choose remove instead of set to stop the browser sending Referer, Cookie or Accept-Language to some sites.