(url, name, opts)
| 86 | } |
| 87 | |
| 88 | function download(url, name, opts) { |
| 89 | var xhr = new XMLHttpRequest(); |
| 90 | xhr.open('GET', url); |
| 91 | xhr.responseType = 'blob'; |
| 92 | |
| 93 | xhr.onload = function () { |
| 94 | saveAs(xhr.response, name, opts); |
| 95 | }; |
| 96 | |
| 97 | xhr.onerror = function () { |
| 98 | console.error('could not download file'); |
| 99 | }; |
| 100 | |
| 101 | xhr.send(); |
| 102 | } |
| 103 | |
| 104 | function corsEnabled(url) { |
| 105 | var xhr = new XMLHttpRequest(); |
no outgoing calls
no test coverage detected