Altering HTTP Responses in Firefox Extension

后端 未结 3 1671
南旧
南旧 2020-12-09 03:47

How can I alter the HTTP response body in a Firefox extension? I have setup an http-on-examine-response observer and an nsIStreamListener object with the code below. After I

3条回答
  •  情话喂你
    2020-12-09 04:28

    You can use nsITraceableChannel to intercept the response.

    You should modify the data which is available to what you need and pass it to the innerListener's OnDataAvailable

    Below links would help you understand this better.

    http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/

    http://www.ashita.org/howto-xhr-listening-by-a-firefox-addon/

提交回复
热议问题