| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <a download="suggested-filename" href="">link</a> |
| 5 |
| 6 <!-- In addition to initiating a download using a Blob URL, the script below |
| 7 will immediately revoke the URL as soon as the click() event has been |
| 8 dispatched. This tests that, in addition to handling the blob URL, that |
| 9 proper lifetime extensions are in place to prevent the blob from going away |
| 10 before the download is complete. --> |
| 11 |
| 12 <script> |
| 13 var anchorElement = document.querySelector('a[download]'); |
| 14 var blob = new Blob(['hello world!'], {type: 'text/plain'}); |
| 15 var url = URL.createObjectURL(blob); |
| 16 anchorElement.href = url; |
| 17 anchorElement.click(); |
| 18 URL.revokeObjectURL(url); |
| 19 </script> |
| 20 </body> |
| 21 </html> |
| OLD | NEW |