removed encodeURI and fixed Safari detection
This commit is contained in:
+2
-2
@@ -94,13 +94,13 @@ var saveAs = saveAs || (function(view) {
|
|||||||
}
|
}
|
||||||
// on any filesys errors revert to saving with object URLs
|
// on any filesys errors revert to saving with object URLs
|
||||||
, fs_error = function() {
|
, fs_error = function() {
|
||||||
if (target_view && typeof safari !== "undefined" && typeof FileReader !== "undefined") {
|
if (target_view && /Version\/[\d\.]+.*Safari/.test(navigator.userAgent) && typeof FileReader !== "undefined") {
|
||||||
// Safari doesn't allow downloading of blob urls
|
// Safari doesn't allow downloading of blob urls
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.onloadend = function() {
|
reader.onloadend = function() {
|
||||||
var base64Data = reader.result;
|
var base64Data = reader.result;
|
||||||
base64Data = base64Data.replace(/^data:.*?;/, 'data:attachment/file;');
|
base64Data = base64Data.replace(/^data:.*?;/, 'data:attachment/file;');
|
||||||
target_view.location.href = encodeURI(base64Data);
|
target_view.location.href = base64Data;
|
||||||
filesaver.readyState = filesaver.DONE;
|
filesaver.readyState = filesaver.DONE;
|
||||||
dispatch_all();
|
dispatch_all();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user