User:Sannse/monobook.js

function checklink { if(document.getElementsByTagName("h1")[0].innerHTML != "User contributions") return;

if(document.getElementById("contentSub").getElementsByTagName("a")[0].innerHTML == "Talk") { var link = document.getElementById("contentSub").getElementsByTagName("a")[3]; checkhref = "subip=OK&ip=" + document.getElementById("contentSub").innerHTML.substring(4,document.getElementById("contentSub").innerHTML.indexOf("(")-1);   } else {        var link = document.getElementById("contentSub").getElementsByTagName("a")[4];        checkhref = "subuser=OK&user=" + document.getElementById("contentSub").getElementsByTagName("a")[0].innerHTML;    }    var chLink = document.createElement("a");    chLink.href = "\/wiki\/Special:CheckUser?" + checkhref;    chLink.textContent = "Checkuser";    chLink.title = "Checkuser this user";    var space = insertAfter(link.parentNode, document.createTextNode(" | "), link);    insertAfter(link.parentNode, chLink, space); } addOnloadHook(checklink);

// insertAfter by Volte function insertAfter(parent, node, referenceNode) { if(referenceNode.nextSibling) { return parent.insertBefore(node, referenceNode.nextSibling); } else { return parent.appendChild(node); } }