Hi
I am trying to monitor browser network traffic and would like to get for a given requestId both the request the response headers. I can see the request headers listening onSendHeaders and the response headers with onResponseStarted or onHeadersReceived, but not both at the same place. I tried to maintain an object using the request id as the key and the request headers as value, so those headers are available in the response listener, but there is not a perfect match and that object keeps growing with requests I don’t get a response for, so I cannot delete the corresponding entry in the object. I could use a timer to purge the object but I am concerned with overall performance impact on the browser.
In the old addon SDK, there was a channel.visitRequestHeaders() function that could be called in the response listener, but this seems to have disappeared in webextensions.
Any advice on the best way to achieve this ?
Thanks.