User:Animum/avoidpage.js

//////////////////////// //HOW-TO: //If I wanted to avoid viewing Norway, Sweden, Denmark, and European Union, I would add the following two lines of text to my skin's JavaScript file (monobook.js, cologneblue.js, etc.) without the two forward-slashes at the beginning: //importScript("User:Animum/avoidpage.js"); //avoidpage("Norway"); avoidpage("Sweden"); avoidpage("Denmark"); avoidpage("European Union"); ////////////////////////

function avoidpage(title) { if(location.href == wgServer + "/wiki/" + encodeURIComponent(title.replace(/ /g, "_")) || location.href.search(mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + encodeURIComponent(title.replace(/ /g, "_"))) != -1) history.go(-1); }