How to access performance object of every resource in a web page?

前端 未结 3 1137
-上瘾入骨i
-上瘾入骨i 2021-01-19 00:14

I can see, in Chrome Developer tools, loading time, time it took to get a particular resource from server and other info, for all of the resources in a webp

3条回答
  •  遇见更好的自我
    2021-01-19 01:00

    There is still a bug in latest version of chrome - 29.0.1547.76 m When you raise an xmlhttprequest, lets say while downloading an image, you can see that the resource is downloaded with status code 200 OK in network tab, but the performance.getEntries() or performance.getEntriesByName(resourceUrl) doesn't list the resource entry. When the page load is complete and you evaluate performance.getEntriesByName(resourceUrl) in console, it lists properly. So, there is a lag in chrome while populating the resource entries in performance entries? In IE10, this works perfectly fine.

提交回复
热议问题