CreateJS / PreloadJS

PreloadJS makes preloading assets & getting aggregate progress events easier in JavaScript. It uses XHR2 when available, and falls back to tag-based loading when not.
http://createjs.com/
MIT License
2.88k stars 764 forks source link

LoadQueue() fires multiple times on firefox 69.0.1 #265

Closed Falcikas closed 5 years ago

Falcikas commented 5 years ago

I have create a fiddle to illustrate the example:

https://jsfiddle.net/23kot0s7/

Result on Firefox 69.0.1 :

image

Result on Chrome 77.0.3865.90:

image

lannymcnie commented 5 years ago

This is probably just due to a race condition, and potentially how the browsers handle threading and caching. You are calling loadFile() multiple times, which will append to an open queue, or start a new one. Because you are loading the same file, one of the browsers is returning immediately causing an additional load, the other one has a short delay, resulting in the file getting added to the internal queue.

If you are loading separate files, it should not happen.

The best practice is to append to a queue array, and use loadManifest() instead one time.

Hope that helps!

Falcikas commented 5 years ago

I was loading different files on my local project and still queue callback fired for each file on Firefox, but loading via loadManifest() fixed the problem. Thank you for your answer, closing.