如何在使用HTTP观察者时将传入响应映射到传出请求:https://developer.mozilla.org/en/Setting_HTTP_request_headers#Observers?
答案 0 :(得分:1)
比较nsIHttpChannel对象,例如HttpFox:
getPendingRequestForRequestEvent: function(request) {
// check for matching request
for (var i = 0; i < this.Requests.length; i++) {
if (request.HttpChannel === this.Requests[i].HttpChannel) {
return i;
}
}
// no match found
return -1;
},