Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note about ProgressEvent.loaded reporting different values depending on the browser #32781

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

Zwyx
Copy link
Contributor

@Zwyx Zwyx commented Mar 21, 2024

Description

Add note about ProgressEvent.loaded reporting different values depending on the browser

In Firefox, loaded is the size of the compressed data; in Chrome, it's the size of the decompress data. I would have loved to find sources for this, but the only thing I could find is that the RFC doesn't specify which value it should be! Browsers implement it differently.

I also did some rephrasing to make all sentences similar.

Motivation

Make developers aware that the values of loaded might be different for their users.

Additional details

  • In Chrome, downloading a content of 1.3MB (1,345,276 bytes), while logging the value of loaded, shows a total of 1345276 at the end.
  • In Firefox, downloading the same content of 1,345,276 bytes, while logging the value of loaded, shows a total of 1017454 at the end.

…nding on the browser

In Firefox, `loaded` is the size of the compressed data; in Chrome, it's the size of the decompress data. I would have loved to find sources for this, but the only thing I could find is that the RFC doesn't specify which value it should be! Browsers implement it differently.
@Zwyx Zwyx requested a review from a team as a code owner March 21, 2024 12:13
@Zwyx Zwyx requested review from sideshowbarker and removed request for a team March 21, 2024 12:13
@github-actions github-actions bot added Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Mar 21, 2024
@Zwyx Zwyx changed the title Add note about ProgressEvent.loadel reporting different values depending on the browser Add note about ProgressEvent.loaded reporting different values depending on the browser Mar 21, 2024
Copy link
Contributor

Copy link
Collaborator

@sideshowbarker sideshowbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work.

I would have loved to find sources for this, but the only thing I could find is that the RFC doesn't specify which value it should be! Browsers implement it differently.

Please consider taking time to raise a spec issue at https://github.com/whatwg/xhr/issues/new/choose about that

@sideshowbarker sideshowbarker merged commit 76c3857 into mdn:main Mar 21, 2024
8 checks passed
@Zwyx
Copy link
Contributor Author

Zwyx commented Mar 22, 2024

Thank you very much! It's done: whatwg/xhr#388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants