Need help with fetch-progress-indicators?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

196 Stars 21 Forks MIT License 64 Commits 5 Opened issues


Progress indicators/bars using Streams, Service Workers, and Fetch APIs

Services available


Need anything else?

Contributors list

# 97,998
63 commits
# 138,570
1 commit

Examples for showing progress bars and progress indicators for

. Uses the Fetch API, Streams API, and Service Worker API.



  • Fetch: A ReadableStream is used to show download progress during a
  • Fetch - Enhanced: Same as above with robust code for preventing multiple downloads and handling other real-world UI interactions and edge cases.
  • Service Worker: A ReadableStream is used in a Service Worker to simulatenously show download progress for the
    of an inline

Gzip & Content-Encoding Support


Browser Support

The aforementioned APIs are new/expermiental and do not currently work on all browsers. Testing was done with the browsers below:

| Browser | Test Results | | :--- | :--- | | Chrome 64 | Full support | | Firefox 58/59 | Full support (requires activation of experimental flags) | | iOS Safari 8 | Unsupported | | iOs Safari 11 | Fetch support only. Service Workers unsupported | | Mac Safari 11.0 | Fetch support only. Service Workers unsupported | | Mac Safari 11.1 | Full Support | | IE/Edge | Not tested (no device available) |


Prior to the recent addition of fetch(), the XMLHttpRequest.onprogress callback handler was traditionally used to show progress bars and progress indicators. The Fetch API is great and we should use it, but "onprogress" handlers are not currently implemented with Fetch. These examples allow us to leverage Fetch while providing users with immediate feedback during certain "loading" states. Progress indicators could be especially useful to users on slow networks.

Lessons & Conclusions

This repository began as a proof of concept for showing progress indicators from Service Workers. Everything seemed to work out and a few important lessons and caveats were discovered: 1. Firefox successfully stops network reading and cancels downloads on fetch events that implement custom

readers when the user signals the cancelation/abort of a page load (e.g. pressing ESC, clicking stop button, invoking
) 1. Chrome and Safari don't stop network reading and files continue to download when a page load cancel/abort occurs. 1. The
event does not seem to be firing on Chrome, Firefox, or Safari as defined in the HTML spec 7.8.12 Aborting a document load. 1.
callbacks are not called. 1.
callbacks are not called. 2. see Abort Event Detection Test 1. A Firefox bug was discovered when using hash fragments in URLs:

Back-End Image Server

To properly exemplify progress indicators for slow downloads or large files, a small (100kb) JPEG is being served from a remote HTTP/2 Nginx server that limits download speeds. The buffer/packet size is also reduced to show smoother, or more frequent progress updates (more iterations of
). Otherwise,
would send fewer progress updates that result in choppy progress indicators. Caching is disabled to force network requests for repeated tests.

Both Baseline and Progressive JPEG files are available for testing with other speeds:

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.