FormularSumo / Star-Wars-Galaxy-Collection-Web

Website version of the game hosted on GitHub Pages
https://formularsumo.github.io/Star-Wars-Galaxy-Collection-Web/
GNU Affero General Public License v3.0
2 stars 0 forks source link

Progress bar doesn't update on Firefox if game.data set to preload #16

Open FormularSumo opened 4 days ago

FormularSumo commented 4 days ago

Both Chrome and Firefox call onprogress repeatedly throughout loading, however for Chrome if (event.loaded) is returning true while in Firefox it's not.

If I force the code to run regardless of whether it's true, Firefox gets the correct total figure but shows loaded as 0 for the duration of the loading screen..

image

Outputing the onprogress event shows these differences image image IMG_0472

Or in more detail image image

FormularSumo commented 4 days ago

I have reported this issue on the Firefox bug tracker - https://bugzilla.mozilla.org/show_bug.cgi?id=1918728 - as it seems to be caused by a bug in the browser.

Other things I could potential try to work around it include using Fetch instead of XMLHttpRequest, or try to get the progress of the preloaded request directly instead of XMLHttpRequesting it again.

FormularSumo commented 4 days ago

Have tried looking into getting the progress of the element but it seems like the only way to do that is through requesting the object - which is what I'm already doing through XMLHttpRequest