File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -733,6 +733,11 @@ lib.isIE = function() {
733
733
return typeof window . navigator . msSaveBlob !== 'undefined' ;
734
734
} ;
735
735
736
+ var IS_SAFARI_REGEX = / V e r s i o n \/ [ \d \. ] + .* S a f a r i / ;
737
+ lib . isSafari = function ( ) {
738
+ return IS_SAFARI_REGEX . test ( window . navigator . userAgent ) ;
739
+ } ;
740
+
736
741
/**
737
742
* Duck typing to recognize a d3 selection, mostly for IE9's benefit
738
743
* because it doesn't handle instanceof like modern browsers
Original file line number Diff line number Diff line change 24
24
var fileSaver = function ( url , name ) {
25
25
var saveLink = document . createElement ( 'a' ) ;
26
26
var canUseSaveLink = 'download' in saveLink ;
27
- var isSafari = / V e r s i o n \/ [ \d \. ] + .* S a f a r i / . test ( navigator . userAgent ) ;
28
27
var promise = new Promise ( function ( resolve , reject ) {
29
28
// IE <10 is explicitly unsupported
30
29
if ( typeof navigator !== 'undefined' && / M S I E [ 1 - 9 ] \. / . test ( navigator . userAgent ) ) {
31
30
reject ( new Error ( 'IE < 10 unsupported' ) ) ;
32
31
}
33
32
34
33
// First try a.download, then web filesystem, then object URLs
35
- if ( isSafari ) {
36
34
// Safari doesn't allow downloading of blob urls
37
35
document . location . href = 'data:application/octet-stream' + url . slice ( url . search ( / [ , ; ] / ) ) ;
38
36
resolve ( name ) ;
37
+ if ( Lib . isSafari ( ) ) {
39
38
}
40
39
41
40
if ( ! name ) {
You can’t perform that action at this time.
0 commit comments