Kar
Kar

Reputation: 6365

Modifying HTTP response headers in Firefox

Does anyone know if Firefox extensions are allowed to modify HTTP response headers? For example, can an extension remove the x-frame-options header to let the page load in an iframe?

Thanks

Upvotes: 18

Views: 23032

Answers (5)

Christophe Roussy
Christophe Roussy

Reputation: 17059

Install PourBico for Firefox.

Open PourBico window. Reload URL, modify the header, reload page.

Upvotes: 1

amit
amit

Reputation: 337

it's late but i found some thing, i was going through code of "temper data" extention and i was able to modify the response as:

  observe: function(aSubject, aTopic, aData) {

    if (aTopic == 'http-on-modify-request') {
        aSubject.QueryInterface(Components.interfaces.nsIHttpChannel);
        this.onModifyRequest(aSubject);
       }
}   


   onModifyRequest(oHttp){
     //this is how i modify the set-cookie field from header
      oHttp.setResponseHeader("Set-Cookie", enc, false);
   }

Upvotes: 2

Etienne
Etienne

Reputation: 63

I think the best firefox addon for modifying headers is TamperData :

https://addons.mozilla.org/en-US/firefox/addon/966/

Upvotes: 6

Bogdan Harjoc
Bogdan Harjoc

Reputation: 11

There is a Modify Response addon that is limited to Content-Type, but should be adaptable to all (most) others.

Upvotes: 1

Gareth
Gareth

Reputation: 46

S. Wong is correct. Modify Headers supports modification of request headers only at present. However, I am looking at supporting response headers for a future version.

Upvotes: 3

Related Questions