|
@@ -94,22 +94,24 @@ export const saveAs: SaveAs =
|
|
a.download = name;
|
|
a.download = name;
|
|
a.rel = "noopener";
|
|
a.rel = "noopener";
|
|
|
|
|
|
- if (typeof blob === "string") {
|
|
|
|
- a.href = blob;
|
|
|
|
- if (a.origin !== location.origin) {
|
|
|
|
- if (corsEnabled(a.href)) {
|
|
|
|
- return download(blob, name, opts);
|
|
|
|
- }
|
|
|
|
- a.target = "_blank";
|
|
|
|
- }
|
|
|
|
- return click(a);
|
|
|
|
- } else {
|
|
|
|
- a.href = URL.createObjectURL(blob);
|
|
|
|
|
|
+ // if (typeof blob === "string") {
|
|
|
|
+ // a.href = blob;
|
|
|
|
+ // if (a.origin !== location.origin) {
|
|
|
|
+ // if (corsEnabled(a.href)) {
|
|
|
|
+ // return download(blob, name, opts);
|
|
|
|
+ // }
|
|
|
|
+ // a.target = "_blank";
|
|
|
|
+ // }
|
|
|
|
+ // return click(a);
|
|
|
|
+ // } else {
|
|
|
|
+ a.href = typeof blob === "string" ? blob : URL.createObjectURL(blob);
|
|
|
|
+ if (typeof blob !== "string") {
|
|
setTimeout(function () {
|
|
setTimeout(function () {
|
|
URL.revokeObjectURL(a.href);
|
|
URL.revokeObjectURL(a.href);
|
|
}, 4e4); // 40s
|
|
}, 4e4); // 40s
|
|
- return click(a);
|
|
|
|
}
|
|
}
|
|
|
|
+ return click(a);
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
: "msSaveOrOpenBlob" in navigator
|
|
: "msSaveOrOpenBlob" in navigator
|
|
? (blob, name = "download", opts) => {
|
|
? (blob, name = "download", opts) => {
|