User:CaptainBarracuda/common.js

/** * Sets the chat menu button to open a popup window with the chat in it. */ function setOpenChatInPopup { var menu = document.getElementsByClassName("subnav-2a"); var i = 0; while (i < menu.length && menu[i].getAttribute("href") != "/wiki/Special:Chat") { i++; }    if (i < menu.length) { menu[i].setAttribute("onClick", "window.open(\"/wiki/Special:Chat\")"); menu[i].removeAttribute("href"); alert("The chat button was found."); } else { alert("The chat button was not found."); } }

document.onload = setOpenChatInPopup;