Skip to content

Instantly share code, notes, and snippets.

@rc5hack
Created February 8, 2013 08:59
Show Gist options
  • Save rc5hack/4737552 to your computer and use it in GitHub Desktop.
Save rc5hack/4737552 to your computer and use it in GitHub Desktop.
/*
* This code is to insert into userspace .js file on rodovid.org project
* (e.g. http://en.rodovid.org/wk/User:YourUsername/monobook.js)
*/
(function (window) {
window.loadedUserScripts={};
window.importUserScriptURI=function(url){
if(loadedUserScripts[url]){return null;}
loadedUserScripts[url]=true;
var s=document.createElement('script');
s.setAttribute('src',url);
s.setAttribute('type','text/javascript');
document.getElementsByTagName('head')[0].appendChild(s);
return s;
};
window.importUserScript=function(src){
return importUserScriptURI('/wk?title=' + src + '&action=raw&ctype=text/javascript');
};
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment