Does any browser support a JS API to query the status of submitting a form? I would like to add generic code to our application that monitors any submitted form and displays a progress bar for the form. Origin server cannot report the status if there's buffering reverse proxy between client and the origin server (e.g. Cloudflare) so I would need something supported by the client.
Assume that I run code document.getElementById("myForm").submit();
. Is there any way to figure out how much of the form has been submitted? The client obviously knows the exact byte count it will be sending so it should be able to report how much (count of bytes or a percentage) of the full transfer has been pushed to net socket. I understand that this is not the same as getting the data to the origin server but I'm not interested on that. I would like to support long forms (lots of text over very slow internet connection) and forms with huge files (files bigger than 2 GB over fast internet connection).
Update: I asked about this on WHATWG mailing list. I believe the best answer this far is https://stackoverflow.com/a/28386477/334451 which does not deal great with HTTP 303 but should be otherwise okay.