How to map incoming responses to the outgoing requests when using HTTP observers: https://developer.mozilla.org/en/Setting_HTTP_request_headers#Observers ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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;
},