Is there a navigation interface for XMLHttpRequests?

The window.performance object provides information about the performance of the last page load made by the browser, including dns search time among others. However, I could not find anything like this for Ajax calls.

The higher level problem I'm trying to solve is to use Google Analytics to track load times. You can set up custom events and track synchronization in javascript, but there is currently no way to get search time and other relevant performance data. Maybe there is a way to get this information from an XMLHttpRequest object?

+7
source share
2 answers

window.performance.timing - defined in W3C NavigationTiming specifies only the performance metrics for loading the page of the root document.

The W3C ResourceTiming specification, on the other hand, provides performance information for all page resources, such as img , script and XMLHttpRequest . ResourceTiming is implemented in IE10 + and currently has a prefix in Chrome.

+4
source

If you need the same level of information that you use with window.performance , I think the answer is NOT .

In the w3.org spec XMLHttpRequest you will only find a list of events, using what you could get several times, but not the same information about network times.

Maybe you can find something similar to Firebug-NetPanel which uses XPCOMInterface nsIHttpActivityObserver

0
source

All Articles