FormularSumo / Galaxy-Collection-Web

Love.JS Web port of https://github.com/FormularSumo/Galaxy-Collection hosted on GitHub Pages
https://formularsumo.github.io/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 2 months ago

FormularSumo commented 2 months 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 2 months 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 2 months 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