Hi,
I've been trying to get the total page size of an url, for example:
https://google.com, if I analyze the page in GTMetrix the total page size is like 32KB.
I have my Chrome Extension that get some performance details like TTFB and more but I can't get the page size of the current URL, is there a way to do it?
I tried to use WebRequest API by using onResponseStarted callback and in the response I get the Content-Length and I sum all responses, but the result is innacurate compared to GTMetrix result.
Also tried to use:
window.performance.getEntriesByType("resource");
Then loop on each and sum the
decodedBodySize or
encodedBodySize but the same, the result is innacurate.
The only Chrome API that works perfectly is the debugger API, but opens a bar at the top of the browser window which won't fit on my UI specifications.
Does anyone alredy achieved this?
Thanks!