After reading through the documentation, I figure not, but better safe than sorry :
Can user scripts interact with a download dialog, changing the file name? The file name is not known before clicking the download link so it's not simply a matter of finding foo.bar.zip on the page and replacing foo.bar by the new name.
Yes, you can explicitly specify file name via the download
attribute:
<a href="index.html" download="test.html">Download index page</a>
However there are caveats:
Content-Disposition
header, that header is prefered over what you specifiedIf you're on the same domain, the Content-Disposition
header can be erased if you download the file via XMLHttpRequest
and then use createObjectURL
and have the user download that. Ask yourself if it's worth the effort.