Is it possible to calculate how much traffic my page uses? I know I can see it in Developer's Tools, but would it possible to get it in plain JavaScript?
I know I could read content-length header for AJAX requests, but this isn't something I'm looking for. I need to get all traffic that my page generates. Could put it into an iframe as well, it that helps.
Thanks.

in chrome there is
window.performance.memoryand read https://developer.mozilla.org/en-US/docs/Web/API/Navigation_timing_API
you can use as solution but it is third party js :-
http://phantomjs.org/network-monitoring.html