User:GeorgeMoney/UserScripts/newmessages

// //Check User:GeorgeMoney/UserScripts to see what helper functions this needs addOnloadHook(function{ var theuser = wgUserName.replace(' ', '_'); var divs = document.getElementsByTagName('div'); for (i=0; i&emsp;New Messages. last change &rarr; talk page';          document.title = wgPageName.replace(/\_/g, ' ')+' - NEW MESSAGES - wikipedia';          alert('NEW MESSAGES');          createCookie('nmsalerted', 'yes', 365);     } else {        divs[i].innerHTML = "";        divs[i].style.display = "none";        addTab('/wiki/User_talk:'+theuser+'?diff=cur', 'view new message', 'ca-nms', 'view msg', 'n'); } } else if((divs[i].className == 'usermessage' && divs[i].innerHTML.indexOf(theuser) == -1)) { divs[i].style.display = "none"; } }

if(document.getElementById('bodyContent').innerHTML.indexOf('class=\"usermessage\"') == -1 && readCookie('nmsalerted') == 'yes') { createCookie('nmsalerted', 'no', 365); }

});

//END //