Reputation: 79
I am looking for a programmatic way to display how much data was transferred when accessing a website - for example as seen in Google Chrome's DevTools:
Is there a browser API to read this information from?
I was looking and searching everywhere, but it seems it cannot be done? Does anyone have any experience with this? Thanks for any help!
Upvotes: 0
Views: 99
Reputation: 1449
Have a look at the Performance API: https://developer.mozilla.org/en-US/docs/Web/API/Window/performance
and in particular the transferSize
prop : https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/transferSize
Upvotes: 1