时间GET请求到特定站点

时间:2011-09-21 20:09:29

标签: firefox firefox-addon

我正在尝试编写一个firefox插件来记录为特定网站提供所有GET请求所需的时间。例如google并将此数据记录到file.In换句话说,我想将每个GET请求用作一个事件来配置计时器。

有人能指出我正确的方向吗?

1 个答案:

答案 0 :(得分:0)

您需要收听http-on-modify-requesthttp-on-examine-response通知。这些通知您when a request is about to be sent and when a response has been received。有关使用http-on-modify-request的示例,请参阅https://developer.mozilla.org/en/Setting_HTTP_request_headers,您将记录时间戳而不是设置标头。另外,我想你会想要get the tab that the request belongs to。最后,您通过比较其频道对象,将http-on-examine-response与之前的http-on-modify-request通知进行匹配:How to map response to request when using "http-on-modify-request" and "http-on-examine-response"?