本文介绍了如何在使用“http-on-modify-request”时映射对请求的响应和“http-on-examine-response”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用HTTP观察器将传入响应映射到传出请求:?

How to map incoming responses to the outgoing requests when using HTTP observers: https://developer.mozilla.org/en/Setting_HTTP_request_headers#Observers ?

推荐答案

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

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

这篇关于如何在使用“http-on-modify-request”时映射对请求的响应和“http-on-examine-response”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 17:59
查看更多