User:AoV2/importScript links.js

function importScript_links{ pre = getElementsByClassName(document, "pre", "source-javascript"); for(i = 0; i < pre.length; i++) { par = getElementsByClassName(pre[i], "span", "br0"); for(j = 0; j < par.length; j++) { if(par[j].innerHTML != "(") continue;			o = par[j].previousSibling;			if(o.nodeType != 3) continue;			if(!o.data.match(/\bimportScript\s*$/)) continue;			s = par[j].nextSibling;			if(s.className != "st0") continue;			else if(s.innerHTML.match(/^"[^"]+"$/)) q = "\"";			else if(s.innerHTML.match(/^'[^']+'$/)) q = "\'";			else continue;			p = encodeURIComponent(s.childNodes[0].data.replace(q, "", "g").replace(/[_\s]+/g, "_")).replace(/%2F/g, "/");			s.innerHTML = q + '' + s.innerHTML.replace(q, "", "g") + '' + q;			}		}	}

addOnloadHook(importScript_links);