How to change Firefox's referer header for all http requests

15,864

Solution 1

The Firefox add-on RefControl can do this.

It has an option to always replace the Referer with the host only (stripping of the URL path). So if the real Referer is http://example.com/foo/bar.html, it becomes http://example.com/.

Solution 2

network.http.sendRefererHeader is Firefox option to control Referer header.

There are also some extensions like refspoof or "No Referrer".

Share:
15,864
Zac Webb
Author by

Zac Webb

Updated on September 17, 2022

Comments

  • Zac Webb
    Zac Webb over 1 year

    When making a request for (for example) http://example.com/foo/bar.baz, Firefox sends a referer header indicating which page I clicked a link from, or is loading a picture, etc. Eg:

    Referer: http://somewhere.else.com/page.html
    

    I would like it to send

    Referer: http://example.com/
    

    instead, ie, to just send the root page of the site it's requesting from. How can I accomplish this?

  • Zac Webb
    Zac Webb over 13 years
    (Probably should have mentioned this in the question, but) I already know about sendRefererHeader, it keeps Firefox from sending any referer at all, whereas I want to send a fake one. Will look into those extensions though.
  • Vallabh Patade
    Vallabh Patade over 13 years
    If this is one-off you can use modify headers extension to set your own headers. Then your Referrer header will be always the same. But my understanding of question is that you want to change your referrer header dynamically per request. As far as I know there is no easy way to do this.
  • Zac Webb
    Zac Webb over 13 years
    coder, yeah, thats about right, I guess I'll have to write my own extention for it when I have some free time.
  • Zac Webb
    Zac Webb about 11 years
    This is almost exactly what I was looking for; thanks!
  • a3nm
    a3nm about 4 years
    The link is dead.