(blob, filename, extension)
| 905 | } |
| 906 | |
| 907 | function forceDownload(blob, filename, extension) { |
| 908 | // ref: https://stackoverflow.com/questions/49474775/chrome-65-blocks-cross-origin-a-download-client-side-workaround-to-force-down |
| 909 | var a = document.createElement("a"); |
| 910 | if (replaceJpegWithJpg) extension = extension.replace("jpeg", "jpg"); |
| 911 | a.download = filename + "." + extension; |
| 912 | a.href = blob; |
| 913 | // For Firefox https://stackoverflow.com/a/32226068 |
| 914 | document.body.appendChild(a); |
| 915 | a.click(); |
| 916 | a.remove(); |
| 917 | } |
| 918 | |
| 919 | // Current blob size limit is around 500MB for browsers |
| 920 | function downloadResource(url, filename) { |
no test coverage detected