User:ReyBrujo/Tools/pw.js

function getElementsByClass(node,searchClass,tag) { var classElements = new Array; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp("\b"+searchClass+"\b"); for (i = 0, j = 0; i < elsLen; i++) { if ( pattern.test(els[i].className) ) { classElements[j] = els[i]; j++; }       }        return classElements; };   function AddPW { var nodeList = getElementsByClass(document, 'new', 'a'); alert(nodeList.Length); };   if (window.location.href.indexOf("Special:Watchlist/edit") != -1) { addOnloadHook(AddPW); }