CodeByZach / pace

Automatically add a progress bar to your site.
https://codebyzach.github.io/pace/
MIT License
15.66k stars 1.91k forks source link

Add a monitor for `window.fetch` #333

Open neon64 opened 8 years ago

neon64 commented 8 years ago

This would help the adoption of the new 'standard' to set to replace XMLHttpRequest.

The only issue is at the moment there aren't any progress events from fetch. However this should change with streams. For now I think it would be possible to copy the naive (without progress events) implementation for XMLHttpRequest.

htchaan commented 7 years ago

For now, to enable pace on fetch, I have to do something like:

global.fetch = undefined;
require('whatwg-fetch');
const fetch = global.fetch;
imRichardNg commented 7 years ago

great library!

but, tried h0ward's method to enable fetch tracking, but doesn't work. any plan to support fetch tracking in future??

tobiaszuercher commented 7 years ago

are there any plans to support fetch? would love to see that!

dwiyatci commented 4 years ago

Anyone? :smiley:

dwiyatci commented 4 years ago

Ok. I managed to workaround it for browsers. 😁 The key is to force polyfilling fetch inwindow (global object in the web browsers) so that it falls back using XMLHttpRequest 💯

<script>window.fetch = undefined;</script>
<script src="https://unpkg.com/whatwg-fetch@latest/dist/fetch.umd.js"></script>

https://jsfiddle.net/glenn/eagtm29n/

MangaD commented 4 years ago

Shocked to see this issue is from 2016 and nothing has been done about it. :(

ajaniramon commented 4 years ago

Shocked to see this issue is from 2016 and nothing has been done about it. :(

I think the same. Just migrated all my $.ajax calls to fetch and I'm missing this feature a lot...

stefacchio commented 1 month ago

any updates?