Unable to get loading progress for current page.
However, if you download something through AJAX, it is actually quite simple.
The server (or at least should) should include the Content-Length header in the response you can read ( xhr.getResponseHeader("Content-Length") ), and you can also read the amount loaded so far ( xhr.responseText.length ), and work out as a percentage.
However, the above will not work in some older browsers - they don't like it when you access xhr.responseText before it is fully loaded.
In later browsers, namely those that support "XMLHttpRequest2", you can use the progress event and related properties to get progress. More on MDN , but the general idea is to use evt.loaded / evt.total to load fractions.
source share