Skip to content

Commit 724e418

Browse files
committedDec 18, 2020
parse Safari version after Version header identical to Safari
1 parent 725838d commit 724e418

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed
 

‎src/plots/gl3d/scene.js

+10-6
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)
Please sign in to comment.