User:PedroM/global.js

function work(href) { var anchor = ""; if (href.indexOf("#") != -1) {     href = href.split("#"); anchor = "#" + href[1]; href = href[0]; }   if (href.indexOf("?") != -1) return href + "&useskin=monobook&handheld=yes" + anchor; else return href + "?useskin=monobook&handheld=yes" + anchor; }

function noscript(event) { // if (event.url.indexOf("http://community.wikia.com") == -1) //   event.preventDefault; alert("Moep!"); alert(event.target); } function run { if(navigator.userAgent.indexOf("3DS") != -1){ window.addEventListener("beforeload", noscript, true); alert("Meep!"); if(window.location.href.indexOf("useskin=monobook&handheld=yes") == -1) window.location = work(window.location.href); $("a[href^='/'],a[href*='.wikia.com/']").each(function{     $(this).attr("href", work($(this).attr("href")));    }); } } addOnloadHook(run);