HeaderDial › Guides

Send a header only on requests made by one site

To add a header only when a request comes from pages on one site, use HeaderDial's Page domain filter (added in 0.6.0). Say your app runs on localhost:3000 and calls api.example.com. A rule with Only on → Page domain → localhost adds your test token to those calls. The same API opened in another tab, or used by another site, gets nothing. A plain Domain filter can't do this, because it looks at where the request goes, not which page sent it.

Domain vs Page domain

FilterLooks atExample
DomainThe host the request is sent toapi.example.com: every request to the API, from any tab
Page domainThe site of the page that made the request (the browser calls it the initiator)localhost: requests that pages on localhost make, to any host

Use both in one profile to get "requests from my local app to the API only". The two filters must both match. Several Page domain filters in one profile mean "any of these sites".

Steps

  1. Open HeaderDial and click + Request header. Enter the name and value, for example Authorization and Bearer <test token>.
  2. Open Where it applies and click + Only on…. In the second select choose Page domain and type the page's host, for example localhost or app.example.com. Leave out the port and the http://.
  3. To limit the target too, add another + Only on… filter with Domain api.example.com.
  4. Give HeaderDial site access to both the API host and the page's host. In our CORS test, Chrome changed a call between two hosts only when HeaderDial had access to both. Access to just one of them changed nothing. The banner in the popup asks for access.

Use Never on → Page domain the other way round, for example to add a header everywhere except on requests made by your admin console.

What we measured

Measured with HeaderDial 0.6.0's end-to-end tests: a local echo server reachable as both localhost and 127.0.0.1, and a profile limited to Page domain localhost. Chrome 159.0.8154.6 and Firefox 158.0.1, 20 November 2026.

RequestChrome 159Firefox 158
fetch() from a page on localhost to 127.0.0.1header sentheader sent
The same fetch() from a page on 127.0.0.1not sentnot sent
Typing the API URL in the address barnot sentnot sent
A navigation started by script on the localhost page (location.href = …)header sentnot measured

The typed address gets nothing because a request you type has no initiator page. Bookmarks and new tabs behave the same way. If you need the header on page loads you open yourself, use a Domain filter instead.

Things to know

"Never on" no longer switches off your other profiles

The same release fixes a quieter problem. Browsers implement a "Never on" URL filter as an allow rule, and an allow rule switches off every lower-priority rule of the extension, not just its own profile's. Before 0.6.0, a "Never on */health*" filter in your top profile therefore also stopped the profiles below it on /health. HeaderDial now copies the lower profiles' header rules above the exclusion, limited to the excluded URLs. In both browsers above, the lower profile's headers now arrive on the excluded URL, and the upper profile still wins on other URLs. In one case the browser rules cannot express this: two active profiles that both have "Never on" URL filters. HeaderDial then shows a warning in the popup that names both profiles. Using a Domain exclusion in one of them avoids the problem.

Add to ChromeFirefox: coming soon