如何构建 Firefox 扩展来拦截 HTTP 请求和响应?
如何插入 Firefox http 请求和响应的侦听器,以便弹出一个包含请求地址和响应正文的窗口?
注意:
我必须构建 Firefox 的扩展。
我需要一个按钮来激活或禁用该功能。
对于每个请求,我需要弹出一个带有“确定”按钮的窗口以允许发出请求。同样,我需要弹出一个窗口,其中包含来自 Web 服务器的响应正文,并带有“确定”按钮以允许浏览器显示内容。
我知道我必须使用nsIHttpChannel,如图所示此处,但是我不知道将此类代码放在扩展架构的何处。
我对javascript知之甚少。
有人可以帮助我吗?
how do I insert a listener to Firefox http requests and responses, so that I popup a window with the address requested and the response body?
Note:
I have to do this building an extension to Firefox.
I need a button to activate or disable the feature.
For every request, I need to popup a window with an "Ok" button to allow the request to be made. Likewise, I need to popup a window with the response body from the web server, with an "Ok" button to allow the content to be displayed by the browser.
I know that I have to use nsIHttpChannel, as shown here, but I don't know where to put such code on the extention's architecture.
I have very little knowledge about javascript.
Could anyone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 Firebug 源代码可能会有所帮助
http://code.google.com/p/ fbug/
It might help to take a look at Firebug source code
http://code.google.com/p/fbug/