User:Splarka/stripredlinks.js

addOnloadHook(function { mw.util.addPortletLink('p-tb','javascript:stripredlinks','Remove red links','t-unred','Remove all red  links on this page'); }) function stripredlinks { 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('new')!=-1) lis[i].parentNode.removeChild(lis[i]) } } }