(url)
| 45 | } |
| 46 | |
| 47 | function corsEnabled (url) { |
| 48 | var xhr = new XMLHttpRequest() |
| 49 | // use sync to avoid popup blocker |
| 50 | xhr.open('HEAD', url, false) |
| 51 | try { |
| 52 | xhr.send() |
| 53 | } catch (e) {} |
| 54 | return xhr.status >= 200 && xhr.status <= 299 |
| 55 | } |
| 56 | |
| 57 | // `a.click()` doesn't work for all browsers (#465) |
| 58 | function click (node) { |