|
@@ -2262,10 +2262,18 @@ class GLTFParser {
|
|
|
|
|
|
// Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the
|
|
|
// expensive work of uploading a texture to the GPU off the main thread.
|
|
|
+
|
|
|
+ let isSafari = false;
|
|
|
+ let isFirefox = false;
|
|
|
+ let firefoxVersion = - 1;
|
|
|
|
|
|
- const isSafari = /^((?!chrome|android).)*safari/i.test( navigator.userAgent ) === true;
|
|
|
- const isFirefox = navigator.userAgent.indexOf( 'Firefox' ) > - 1;
|
|
|
- const firefoxVersion = isFirefox ? navigator.userAgent.match( /Firefox\/([0-9]+)\./ )[ 1 ] : - 1;
|
|
|
+ if ( typeof navigator !== 'undefined' ) {
|
|
|
+
|
|
|
+ isSafari = /^((?!chrome|android).)*safari/i.test( navigator.userAgent ) === true;
|
|
|
+ isFirefox = navigator.userAgent.indexOf( 'Firefox' ) > - 1;
|
|
|
+ firefoxVersion = isFirefox ? navigator.userAgent.match( /Firefox\/([0-9]+)\./ )[ 1 ] : - 1;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
if ( typeof createImageBitmap === 'undefined' || isSafari || ( isFirefox && firefoxVersion < 98 ) ) {
|
|
|
|