将GET请求定时到特定的站点 [英] Timing GET requests to a specific site

查看:122
本文介绍了将GET请求定时到特定的站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编写一个Firefox插件来记录将所有GET请求提供给特定网站的时间。例如谷歌和记录这个数据文件。换句话说,我想使用每个GET请求作为事件来trigure一个计时器。



任何人都可以指向我的权利您需要监听 http-on-modify-request $ c>和 http-on-examine-response 通知。当请求即将发送并收到响应时,这些通知 。请参阅 https://developer.mozilla.org/en/Setting_HTTP_request_headers ,以获取使用 http-on-modify-request ,你会记录时间戳而不是设置一个头。另外,我想你会希望获得标签该请求属于。最后,通过比较匹配 http-on-examine-response 到前面的 http-on-modify-request 通知他们的渠道对象:如何在使用http-on-modify-request时映射对请求的响应和http-on-examine-response?


I am trying to write a firefox plug in to record the time taken to serve all GET requests to a specific website. eg google and log this data to file.In other words I would like to use each GET request as an event to trigure a timer.

Could anyone point me in the right direction?

解决方案

You need to listen to the http-on-modify-request and http-on-examine-response notifications. These notify you when a request is about to be sent and when a response has been received. See https://developer.mozilla.org/en/Setting_HTTP_request_headers for an example using http-on-modify-request, you would record the timestamp instead of setting a header. In addition, I guess that you will want to get the tab that the request belongs to. And finally, you match http-on-examine-response to preceding http-on-modify-request notifications by comparing their channel objects: How to map response to request when using "http-on-modify-request" and "http-on-examine-response"?

这篇关于将GET请求定时到特定的站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆