How to modify response headers in Chrome
Chrome has no built-in way to change response headers. Headerbench lets you set or remove them for the sites you pick, for example to allow CORS from your dev server or to drop a Content-Security-Policy while debugging.
Allow CORS from localhost
- Install Headerbench and create a profile named Local CORS.
- Open Response headers and apply the Allow CORS preset. It adds Access-Control-Allow-Origin, -Methods, -Headers and -Credentials.
- Change
Access-Control-Allow-Originfrom*tohttp://localhost:3000. Browsers ignore*when the request sends cookies, which is why the preset’s Credentials row needs a real origin. - If your requests send an
Authorizationheader, setAccess-Control-Allow-HeaderstoAuthorization, Content-Type;*does not cover Authorization. - On Filters, add the domain
api.example.comand the type fetch/XHR, so only API calls change. - Open your app, turn the profile on in the popup and allow access to
api.example.comand your app’s page when Chrome asks. - Reload your app. The popup’s Applied on this tab lists the response rule against each matching request.
Remove a header
Add a response row with the operation remove, or apply the
Remove Content Security Policy preset, which removes
Content-Security-Policy and Content-Security-Policy-Report-Only. A
policy set in a <meta> tag inside the page still applies.
Why this works on every request
Headerbench hands rules to Chrome’s declarativeNetRequest engine, which edits headers before the page sees the response. It applies to fetch and XHR responses as well as page loads, and nothing runs inside the page. DevTools may still show the original headers; Applied on this tab shows what Chrome changed.
Install Headerbench
Free, no account, no tracking. Pro is optional.
The Chrome Web Store and Edge Add-ons listings are on their way. Install links appear here as soon as they are live.