User:Nx/Scripts/HideFakeNotice.js
Jump to navigation
Jump to search
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
if (typeof nx_hfn_strict == 'undefined') nx_hfn_strict = false;
function hidefakenotice()
{
var bodyContent = document.getElementById("bodyContent");
if (!bodyContent) return;
var notices = getElementsByClassName(bodyContent,"*","usermessage");
var i;
for (i=0;i<notices.length;++i)
{
if (notices[i].id == 'intercommessage') break;
var as = notices[i].getElementsByTagName("a");
var j;
for (j=0;j<as.length;++j)
{
if (nx_hfn_strict)
{
if (as[j].title != "User talk:"+wgUserName)
{
notices[i].style.display = "none";
break;
}
} else {
if ((as[j].innerHTML == "new messages" || as[j].innerHTML == "last change") && as[j].title != "User talk:"+wgUserName)
{
notices[i].style.display = "none";
break;
}
}
}
}
}
addOnloadHook(hidefakenotice);