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-requestandhttp-on-examine-responsenotifications. 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 usinghttp-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 matchhttp-on-examine-responseto precedinghttp-on-modify-requestnotifications by comparing their channel objects: How to map response to request when using "http-on-modify-request" and "http-on-examine-response"?