User:Silverstrike/monobook.js

var restrictPage = "Mass Effect 2"; var message = "Restricted page reached";

var getCategories = document.getElementById("mw-normal-catlinks").getElementsByTagName("span"); for(var i=0; i<getCategories.length; i++){ if (getCategories[i].getElementsByTagName("a")[0].innerHTML == restrictPage){ alert(message); if(history.length < 2) location.href="http://masseffect.wikia.com"; else history.back; } }