react-file-download
Advanced tools
Comparing version
@@ -6,5 +6,9 @@ var React = require('react'); | ||
if (typeof window.navigator.msSaveBlob !== 'undefined') { | ||
// IE workaround for "HTML7007: One or more blob URLs were revoked by closing the blob for which they were created. These URLs will no longer resolve as the data backing the URL has been freed." | ||
window.navigator.msSaveBlob(blob, filename); | ||
} else { | ||
// IE workaround for "HTML7007: One or more blob URLs were | ||
// revoked by closing the blob for which they were created. | ||
// These URLs will no longer resolve as the data backing | ||
// the URL has been freed." | ||
window.navigator.msSaveBlob(blob, filename); | ||
} | ||
else { | ||
var csvURL = window.URL.createObjectURL(blob); | ||
@@ -14,4 +18,7 @@ var tempLink = document.createElement('a'); | ||
tempLink.setAttribute('download', filename); | ||
tempLink.setAttribute('target', '_blank'); | ||
document.body.appendChild(tempLink); | ||
tempLink.click(); | ||
document.body.removeChild(tempLink); | ||
} | ||
} | ||
} |
{ | ||
"name": "react-file-download", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "React component that trigger browser to save javascript-generated content to a file", | ||
@@ -5,0 +5,0 @@ "main": "file-download.js", |
3318
5.33%20
42.86%