在 Firefox 中修改 HTTP 响应标头

发布于 2024-08-26 18:33:55 字数 98 浏览 3 评论 0原文

有谁知道 Firefox 扩展是否允许修改 HTTP 响应标头?例如,扩展程序可以删除 x-frame-options 标头以使页面加载到 iframe 中吗?

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

回首观望 2024-09-02 18:33:55

我认为用于修改标头的最佳 Firefox 插件是 TamperData :

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

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

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

不顾 2024-09-02 18:33:55

S. Wong 是正确的。目前Modify Headers仅支持修改请求头。但是,我正在考虑在未来版本中支持响应标头。

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.

梨涡少年 2024-09-02 18:33:55

已经晚了,但我发现了一些东西,我正在查看“脾气数据”扩展的代码,并且我能够将响应修改为:

  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);
   }

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);
   }
凉城凉梦凉人心 2024-09-02 18:33:55

有一个修改响应插件仅限于内容类型,但应该适用于所有(大多数)其他类型。

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

信愁 2024-09-02 18:33:55

安装适用于 Firefox 的 PourBico

打开 PourBico 窗口。
重新加载 URL、修改标题、重新加载页面。

Install PourBico for Firefox.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文