How to map incoming responses to the outgoing requests when using HTTP observers: https://developer.mozilla.org/en/Setting_HTTP_request_headers#Observers ?
views:
6answers:
1
+1
Q:
How to map response to request when using "http-on-modify-request" and "http-on-examine-response"??
A:
Compare nsIHttpChannel objects, like HttpFox does:
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;
},
spektom
2010-10-06 16:22:19