File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2586,10 +2586,14 @@ class GLTFParser {
25862586
25872587 if ( typeof navigator !== 'undefined' ) {
25882588
2589- isSafari = / ^ ( (? ! c h r o m e | a n d r o i d ) .) * s a f a r i / i. test ( navigator . userAgent ) === true ;
2590- safariVersion = isSafari ? navigator . userAgent . match ( / V e r s i o n \/ ( \d + ) / ) [ 1 ] : - 1 ;
2591- isFirefox = navigator . userAgent . indexOf ( 'Firefox' ) > - 1 ;
2592- firefoxVersion = isFirefox ? navigator . userAgent . match ( / F i r e f o x \/ ( [ 0 - 9 ] + ) \. / ) [ 1 ] : - 1 ;
2589+ const userAgent = navigator . userAgent ;
2590+
2591+ isSafari = / ^ ( (? ! c h r o m e | a n d r o i d ) .) * s a f a r i / i. test ( userAgent ) === true ;
2592+ const safariMatch = userAgent . match ( / V e r s i o n \/ ( \d + ) / ) ;
2593+ safariVersion = isSafari && safariMatch ? parseInt ( safariMatch [ 1 ] , 10 ) : - 1 ;
2594+
2595+ isFirefox = userAgent . indexOf ( 'Firefox' ) > - 1 ;
2596+ firefoxVersion = isFirefox ? userAgent . match ( / F i r e f o x \/ ( [ 0 - 9 ] + ) \. / ) [ 1 ] : - 1 ;
25932597
25942598 }
25952599
You can’t perform that action at this time.
0 commit comments