FF 扩展:需要一些帮助来观察 POST
我正在尝试编写一个扩展来观察 HTTP 请求,特别是 POST。我在访问所有这些内容时遇到了问题 - 有些内容会被忽略,但我不知道为什么。我认为这是由于其他选项卡、iframe 或 XHR 请求造成的。我想做的是创建一个侦听器/处理程序,并通过它传输所有请求。有人可以帮忙吗?例如:
myObj = function(){}
myObj.prototype = {
observe: function(aSubject, aTopic, aData) {
if (aTopic == "http-on-modify-request") {
aSubject.QueryInterface(Components.interfaces.nsIHttpChannel);
// aSubject is now looking at the request, call method
}
}
}
var observerService = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
observerService.addObserver(myObj, "http-on-modify-request", false);
I'm trying to write an extension that observes HTTP requests, and specifically POSTs. I'm having trouble accessing all of them - some things are slipping through, and I don't know why. I assume it's due to other tabs, iframes or XHR requests. What I'd like to do is create a single listener/handler, and funnel all the requests through it. Can someone assist? For example:
myObj = function(){}
myObj.prototype = {
observe: function(aSubject, aTopic, aData) {
if (aTopic == "http-on-modify-request") {
aSubject.QueryInterface(Components.interfaces.nsIHttpChannel);
// aSubject is now looking at the request, call method
}
}
}
var observerService = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
observerService.addObserver(myObj, "http-on-modify-request", false);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论