File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -46,16 +46,20 @@ function getPreserveDrawingBuffer() {
4646 } ) ;
4747
4848 if ( ! hasDrawingBuffer ) {
49- var allParts = ua . split ( '/ ' ) ;
50- for ( var i = 0 ; i < allParts . length ; i ++ ) {
49+ var allParts = ua . split ( ' ' ) ;
50+ for ( var i = 1 ; i < allParts . length ; i ++ ) {
5151 var part = allParts [ i ] ;
5252 if ( part . indexOf ( 'Safari' ) !== - 1 ) {
5353 // find Safari version
54- var v = part . split ( '.' ) [ 0 ] ;
55- if ( isNumeric ( v ) ) v = + v ;
54+ var prevPart = allParts [ i - 1 ] ;
55+ if ( prevPart . substr ( 0 , 8 ) === 'Version/' ) {
56+ var v = prevPart . substr ( 8 ) . split ( '.' ) [ 0 ] ;
5657
57- // to fix https://github.com/plotly/plotly.js/issues/5158
58- if ( v >= 14 ) return true ;
58+ if ( isNumeric ( v ) ) v = + v ;
59+
60+ // to fix https://github.com/plotly/plotly.js/issues/5158
61+ if ( v >= 14 ) return true ;
62+ }
5963 }
6064 }
6165 }
You can’t perform that action at this time.
0 commit comments