I am working on a project with chrome extension V3.
I want to show a progress bar when users upload files.
What I am struggling here is that Fetch API does not seem to support something like 'xhr' in ajax.
With the chrome extension V2, I was able to do the following.
$.ajax({
.....
xhr: () => {
const myXhr = $.ajaxSettings.xhr();
myXhr.upload.addEventListener(
'progress',
myHandleEvent,
false
);
}
.....
});
Since ajax is no longer available with chrome V3, I need to find a way to do the same with Fetch API.
I did some researches by myself with the following pages.
- https://developer.chrome.com/articles/fetch-streaming-requests/
- https://developer.mozilla.org/en-US/docs/Web/API/Streams_API/Using_readable_streams
- Upload progress indicators for fetch?
- https://chromestatus.com/feature/5274139738767360
- https://groups.google.com/a/chromium.org/g/blink-dev/c/zwKGB0_ksQU/m/mtVsZDH1AwAJ
- https://github.com/w3ctag/design-reviews/issues/754
My conclusion so far is that Streaming support for upload is not ready yet.
Did I make a correct conclusion?
Do I just have to wait until it is available?
Or does anybody have any workaround?
Lastly, am I missing anything here?