User:MZMcBride/stripredirects.js

$(function { mw.util.addPortletLink('p-tb','javascript:stripredirects','Remove redirects','t-unredirect','Remove all redirects from lists'); }) function stripredirects { var lis = document.getElementById('bodyContent').getElementsByTagName('li'); for(var i=lis.length-1;i>-1;i--) { var as = lis[i].getElementsByTagName('a'); for(var j=as.length-1;j>-1;j--) { if(as[j].className.indexOf('mw-redirect')!=-1) lis[i].parentNode.removeChild(lis[i]) } } }