User:Blaxthos/hidehugglecontribs.js

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// borrowed from User:X!

function hideawbcontrib()
{
  var i,li,a;
  li=document.getElementById("bodyContent");
  li=li.getElementsByTagName("li");
  i=-1;
  a=new Array();
  while(++i<li.length)
  {
    var s,t;
    t=li[i].innerHTML.match(/"\/wiki\/([^"]*)"/)[1];
    if(li[i].innerHTML.match(/\(\<a href=\"\/wiki\/Wikipedia:AWB\" class=\"mw\-redirect\"/))
      s="none";
    else
      s="";
    if(a[t]!=undefined) s=a[t]; else a[t]=s;
    if(s!="") li[i].style.display=(li[i].style.display=="none"?"list-item":"none");
  }
}
 
$(function () {
  if((location.href.indexOf("Special:Contributions")!=-1||
      location.href.indexOf("Special%3AContributions")!=-1)
     &&location.href.indexOf("&ais523")==-1&&location.href.indexOf("?ais523")==-1)
    mw.util.addPortletLink('p-cactions', 'javascript:hideawbcontrib()', 'show/hide awb edits', 'ca-hideawb',
                   "Show/hide pages made using AWB", '');
});
//</nowiki></pre>
//[[Category:Wikipedia scripts]]