Created
December 20, 2015 14:08
-
-
Save rudiedirkx/88a954f63fda0312438f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
javascript: | |
([].forEach.call(document.scripts, function(el, p) { | |
var code = el.innerHTML.trim(); | |
if ( (p = code.indexOf('q("talkPage.init",')) > -1 ) { | |
var json = code.slice(p + 18, -1).trim(); | |
var talk = JSON.parse(json).talks[0]; | |
var url = talk.nativeDownloads.high || talk.nativeDownloads.medium; | |
var a = document.createElement('a'); | |
a.href = url; | |
a.download = url.match(/([^\/\?]+)(\?.+?)?$/)[1]; | |
a.style.display = 'none'; | |
document.body.appendChild(a); | |
a.click(); | |
a.remove(); | |
} | |
}))(); | |
void(0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment