如何从 Firefox 工具栏中访问 HTTP 标头
具体来说,我想在从 Firefox 工具栏中加载/刷新页面时读取响应 HTTP 标头。
这可能吗?我不需要写,只需读取响应头即可。
编辑:有些人误解并建议 Firebug。我正在开发一个工具栏,我想从我的代码访问标题数据。
Specifically I want to read the response HTTP headers when the page is loaded/refreshed from within my Firefox toolbar.
Is this possible? I don't need to write, just read the response headers.
Edit: some people are misunderstanding and suggesting Firebug. I am developing a toolbar, I want to access the header data from my code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要为
http-on-examine-response
通知添加观察者。这样,您就会知道何时收到服务器响应,并且可以查看标头。有关代码示例,您可以查看 https://developer.mozilla.org/en/Setting_HTTP_request_headers - 本质上是相同的事情,但监听不同的通知。You need to add an observer for the
http-on-examine-response
notification. That way you will know whenever a server response is received and you can take a look at the headers. For a code example you can have a look at https://developer.mozilla.org/en/Setting_HTTP_request_headers - that's essentially the same thing but listening to a different notification.Firebug 是我使用的 - 激活网络面板,您可以看到标头、响应等等!
Firebug is what I use - activate the Net panel and you can see Headers, Responses and lots more!
如果我正确理解您的问题,您应该能够通过 Firebug 附加组件读取 HTTP 标头。
If I understand your question correctly, you should be able to read the HTTP headers through the Firebug Add-On.