User:Mikevoir/BetterUpload.js

$(function{	var links = [];	var PAGE = 0;	var id = mw.config.get('wgUserId');	var name = mw.config.get('wgUserName');	var allMess = document.createElement('span');	allMess.classList.add('MESSAGELIST');	function getPage(PAGE) {		$.ajax({ url: mw.config.get('wgScriptPath') + '/wikia.php' + '?controller=Fandom\\UserProfileActivity\\UserProfileActivity' + '&method=getData' + '&format=html' + '&page=' + PAGE + '&token=85bcaf43d8c8435d636c65755b044eae64da2d0c%2B\\' + '&type=messages' + '&userId=' + id + '&userName=' + name }).then(function (html) { if (html) { allMess.innerHTML += html; PAGE++; if (allMess.querySelector('.UserProfileActivity__loadMore')) { allMess.querySelector('.UserProfileActivity__loadMore').remove; getPage(PAGE); } else { allMess.querySelectorAll('.Message__description').forEach(function(Msg){   					if (Msg.children[2] && Msg.children[2].href) {    						links.push(Msg.children[2].href);    					}    				}); console.log(links); }   		} else { console.log(allMess); }   	});	}	getPage(PAGE); });