Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's important to download JS-generated data as well, such as something in a Blob. You can't set a HTTP header on local content. The 'download' attribute lets the user "download" that without having to wastefully post it to a server and back.


To make what AshleysBrain said a little more concrete, imagine an image editor program (or a music editor, or a word processor, or whatever) that's written completely in client-side JS. There are starting to be a lot of these, actually. Without a working download attribute, the only way to save your work is to post it back to the server and redownload it. That is a slow, ugly, and unsatisfying hack to get data that's actually already present on the local machine.

Even IE 11 has a way to do this (non-standard, of course, but it does have a way to do it :-). Edge supports the standard way.

As I noted in a different post, though, support for the download attribute has already landed in Webkit Nightly for macOS, and is apparently being worked on for iOS.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: