Closed
Bug 1297396
Opened 9 years ago
Closed 9 years ago
webRequest onCompleted - onBeforeRequest timeStamp does not match resource latency
Categories
(WebExtensions :: Untriaged, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: josesigna, Unassigned)
Details
Attachments
(1 file)
730 bytes,
application/zip
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Steps to reproduce:
Subtracting timeStamps from webRequest.onCompleted minus webRequest.onBeforeRequest gives a considerably larger number than the network latency reported by the "Network" tab of the developer tools or any HTTP/S monitor software (such as Charles Proxy).
Actual results:
See attached extension's console.log output to compare webRequest API resource latency times vs the "Network" tab of the developer tools.
Comment 1•9 years ago
|
||
If you care about the latency for the network-specific components of resource loading time, I don't think the webRequest api is the right tool for the job. You might consider the resource timing api? (https://developer.mozilla.org/en-US/docs/Web/API/Resource_Timing_API/Using_the_Resource_Timing_API)
I was under the impression that the Performance Timing API was only available for main_frame resource loads... is this actually available for all resource loads? And if so, how is it exposed? (since window.performance.timing seems to only hold values for the main_frame.)
Comment 3•9 years ago
|
||
I don't have a lot of firsthand experience with that API but I believe each frame has its own collection of resource timings, so you would need to gather the timings for each subframe you care about separately.
Its hard to say if that's an appropriate technique without knowing more about what larger goal you're trying to accomplish.
I am building a browser extension that goes through all resources that load on a page and gets the load latency of each. I've been looking at your links and they indeed look quite promising.
Comment 5•9 years ago
|
||
I'm going to close this bug since I don't think webRequest is a good match for what you're trying to do here.
I'm glad to hear that the resource timing API avenue looks promising. If that ends up not working out for some reason, I think that something like chrome's devtools network API [1] would be a good fit for this, we can create a new bug for that if it comes to it.
[1] https://developer.chrome.com/extensions/devtools_network
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Updated•7 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•