Created
August 23, 2016 19:59
-
-
Save axlevisu/dd5cc946df506b2bf48e394e016a2069 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var list = document.getElementsByTagName('a'); | |
for (i=1;i<list.length;i++){ | |
var a = document.createElement('a') | |
a.href = list[i].href | |
a.text = "Download" | |
url = decodeURI(list[i].href) | |
a.download = url.substr(url.lastIndexOf('/')+1,url.length) | |
document.body.appendChild(a); | |
a.click(); | |
document.body.removeChild(a); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment