I have a Chrome extension that dynamically creates links and adds them to a webpage. The links download files. They each have a download
attribute to name the files correctly (only works in Chrome, afaik - but it only needs to), as well as href
for the url of the file. How can I simulate clicking one of these links?
I don't need to click the version within the document necessarily, just the link object.
Basically, how can I write, in Javascript/JQuery, code to have Chrome download a file named with download
at the href
location?
The JQuery click()
command didn't seem to do anything, though I can't figure out why.