ImageBitmapLoader (GLTFLoader) fails in Firefox ESR
See original GitHub issueDescribe the bug
GLTF models don´t load in Firefox ESR due to lack of support for ImageBitLoader.
To Reproduce
- Install Firefox ESR (version number 91) from https://www.mozilla.org/en-GB/firefox/all/#product-desktop-esr
- Open https://www.geofront.eu/tmp/ironmen_bugreport_fail
- GLTF model is not being loaded. See also error: THREE.GLTFLoader: Couldn´t load texture tex.webp
Code
The problem lies in the removal of a check for Firefox to avoid usage of ImageBitmapLoader (compare r130). The most recent Firefox version works fine with this - but Firefox ESR (used internally in the museum that has published this webpage) is not yet capable of handling ImageBitmapLoader. We therefore suggest an additional check for Firefox and its ESR-channel version number 91 in this code snippet of GLTFLoader.js:
if ( typeof createImageBitmap !== 'undefined' && /^((?!chrome|android).)*safari/i.test( navigator.userAgent ) === false && /Firefox\/91/.test( navigator.userAgent ) === false) {
this.textureLoader = new ImageBitmapLoader( this.options.manager );
} else {
this.textureLoader = new TextureLoader( this.options.manager );
}
Note: This will have to be extended to later Firefox ESR versions (we did not track down the exact version where Firefox´ ImageBitmapLoader starts working).
Live example
- Fail: https://www.geofront.eu/tmp/ironmen_bugreport_fail
- Fixed: https://www.geofront.eu/tmp/ironmen_bugreport_fixed
Expected behavior
The GLTF should have loaded and displayed, just like in Firefox 99.
Platform:
- Device: Desktop
- OS: Windows
- Browser: Firefox ESR release 91.8.0esr (64-bit) https://support.mozilla.org/en-US/kb/firefox-esr-release-cycle
- Three.js version: r139
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Let’s see if @donmccurdy and @mrdoob are happy with the PR^^.
@Mugen87 You are of course welcome to remove the detection code from three.js whenever you like; I only needed it for the museum and will keep it around in pages we create for them until they have upgraded their systems.