Jump to content

User:GeorgeMoney/UserScripts/hacks/FilterLinksearchMainspace

From Wikipedia, the free encyclopedia

//

function filter_main() {
	var lis = document.getElementById('bodyContent').getElementsByTagName('li'); 
	var len = lis.length;
	for(var i=0; i<len; i++) { 
		var li = lis[i]; 
		if(li.getElementsByTagName('a')[1].innerHTML.indexOf(':') != -1) { 
			//li.parentNode.removeChild(li);
			li.style.display = 'none';
		}
	}
}

if(wgPageName == 'Special:Linksearch') {
	addOnloadHook(function() {
		addPortletLink('p-cactions', "javascript:void(filter_main())", "filter", 'ca-filter', 'Filter all pages on here to only be for mainspace');
	});
}

//