且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在使用“http-on-modify-request”时映射对请求的响应和“http-on-examine-response”?

更新时间:2022-03-19 05:18:17

比较nsIHttpChannel对象,如 HttpFox 的确如此:

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;
},