Are the servers really not sending the content-length header?  If e.lengthComputable is false, then I can see that you would have to do this, but otherwise, I think you could do bar.value = e.loaded/e.total;

If you really know that you can never get content-length in this case, then you should use an indeterminate progress bar rather than using this % hack.

Also, is this the code path we take for the blob case? That seems like bad UX since the user has already seen the file download in the download manager, so they wouldn't expect to get another downloading progress bar, especially one that finishes almost instantly.