问题
I've been googling for some time but haven't found any clear solution for this.
I want to measure full webpage weight / size (all doucment + scripts + fonts + styles etc.). I know the network tab in the devtools has size/content - but I want to have it summed (and not sum it every time).
I've been looking for chrome.devtools.* API but haven't found anything straight-forward.
Do you have some ideas how to achieve that?
回答1:
In the Network tab, make sure 'Disable cache' is checked and then when you load a page, look at the bottom panel for the total transfer size. See screenshot below:
The individual sizes are rounded, but the total at the bottom uses the byte size, which you can see in the HAR. The total then is rounded for display. If you find a slight mismatch between summing the individuals and the total shown by DevTools, that is the reason.
来源:https://stackoverflow.com/questions/38239980/measure-full-page-size-in-chrome-devtools