User:AndyZ/monobook.js/personalredirect.js
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
//<pre> var p_redirects = new Array( ["WHAT YOU TYPE IN", "WHERE YOU WANT TO GO"], //update this ["WHAT YOU TYPE IN", "WHERE YOU WANT TO GO"], //array ["WHAT YOU TYPE IN", "WHERE YOU WANT TO GO"], ["WHAT YOU TYPE IN", "WHERE YOU WANT TO GO"] ); if(wgPageName == "Special:Search"){ for(i = 0; i < p_redirects.length; i++){ if(document.getElementById("contentSub").getElementsByTagName("a")[0].innerHTML == p_redirects[i][0]) document.location.href = "http://en.wikipedia.org/wiki/" + p_redirects[i][1]; } } //</pre>