如何编写一个拦截某些 HTTP 请求的 Firefox 插件
有没有办法让 Firefox 插件拦截某些请求并在不影响网络的情况下响应它们?
示例:每次浏览器即将请求 http://www.example.com/page.html,插件自动返回“Hello world!”对于该页面。
干杯!
Is there a way to make a Firefox plugin intercept certain requests and respond to them without hitting the network?
Example: every time the browser is about to request http://www.example.com/page.html, the plugin automatically returns "Hello world!" for that page.
Cheers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Tamper Data 是一个很好的选择。
您可以在 mozdev 中检查 tamper 数据源并了解该扩展程序的工作原理,并借鉴一些想法,或者获取通过
adamsplugins [AT] gmail {DOT} com
与作者联系。我不知道这是否正是您想要的,但它确实很强大。我经常将它与 Firebug 一起使用,因此您可以在苍蝇并测试某些行为。
Tamper Data is a good one.
You can checkout tamper data sources and see how the extension works in mozdev and borrow some ideas, or get in touch with the author in
adamsplugins [AT] gmail {DOT} com
.I don't know if it's exactly what you're looking for, but it's really powerful. I use it a lot with Firebug, so you can edit your pages on the fly and test for some behaviors.
您可以制作一个扩展来“重写”锚元素并插入您需要的 JavaScript。
我很确定您可以使用 Greasemonkey 脚本来完成此操作,但已经有一段时间了。我知道你绝对可以在 Chrome 上做到这一点。
You could craft an extension that "rewrites" the anchor elements and inserts the javascript you need.
I am pretty sure you can do this with a Greasemonkey script but it's been a while. I know you can definitely do this on Chrome.