Firefox – Send a custom HTTP header to one certain host only

firefoxfirefox-extensionsheadershttp

Is there a way (Firefox add-on or about:config setting) to send a custom HTTP header for requests to a certain host?

Example: Send the header Foobar: true if (and only if) I request a resource from the host foo.example.com.

Bonus points if the protocol can be specified, too (e.g. only send the header when requesting over HTTPS).

(see my question Use additional “password” in Referer to hide private site? on IT Security SE on why I’d like to do it)

What I found so far

Best Answer

If you are not restricted with Firefox, you can use Google Chrome's extension Header Hacker.

It provides:

  1. custom request headers (you're able either add new headers or override existing ones)
  2. permanent headers for specified hosts (you're able either add new headers or override existing ones)

So that you can solve your problem with second feature.

I'm using the extension a lot and it works fine for me.