User:Chris G/fake toolserver apps.js

function getParameter(p) { var re = new RegExp('&'+p+'=([^&]*)','i'); var c = window.location.search; return unescape((c=c.replace(/^\?/,'&').match(re)) ?c=c[1] :c=""); } function fakeSpecialPages { if (wgPageName == "Special:EditCount") { document.getElementsByTagName("h1")[0].innerHTML = document.title = "Edit Count: Chris G"; document.getElementsByTagName("p")[1].innerHTML = ""; document.getElementsByTagName("p")[0].innerHTML = " "; } else if (wgPageName == "Special:AppealBlock") { document.getElementsByTagName("h1")[0].innerHTML = document.title = "Appeal Your Block"; document.getElementsByTagName("p")[1].innerHTML = ""; document.getElementsByTagName("p")[0].innerHTML = " "; } else if (wgPageName == "Special:RequestAccount") { document.getElementsByTagName("h1")[0].innerHTML = document.title = "Request Account"; document.getElementsByTagName("p")[1].innerHTML = ""; document.getElementsByTagName("p")[0].innerHTML = " "; } else if (wgPageName == "Special:GAStats") { document.getElementsByTagName("h1")[0].innerHTML = document.title = "Good Article Reviews by User"; document.getElementsByTagName("p")[1].innerHTML = ""; document.getElementsByTagName("p")[0].innerHTML = " "; } setIframeHeight(document.getElementById('iframe')); }

function setIframeHeight(iframe) { var other_domain = 'https://toolserver.org'; window.addEventListener('message', function(event) {     if (event.origin !== other_domain) return; // only accept messages from the specified domain      if (isNaN(event.data)) return; // only accept something which can be parsed as a number      var height = parseInt(event.data); //+ 32; // add some extra height to avoid scrollbar      iframe.height = height + "px";    }, false); }

addOnloadHook(fakeSpecialPages);