User:Pcj/DownloadRedirectsList.js

a = new mw.Api; redirects = ""; function downloadObject(obj, filename){ var blob = new Blob([obj], {type: "text/plain;charset=utf-8",endings:"native"}); var url = URL.createObjectURL(blob); var elem = document.createElement("a"); elem.href = url; elem.download = filename; document.body.appendChild(elem); elem.click; document.body.removeChild(elem); } function gAR(cont) { v = {action:"query",list:"allpages",apfilterredir:"redirects",aplimit:5000}; if (cont != "") v.apcontinue = cont; a.get(v).done(function(data) {		for (p in data.query.allpages) 	redirects += data.query.allpages[p].title+"\n";		if (data.continue != undefined) gAR(data.continue.apcontinue);		else downloadObject(redirects,"redirects.txt");	}); } gAR("");