Last active
August 29, 2015 13:57
-
-
Save NeoTech/9761740 to your computer and use it in GitHub Desktop.
JS Website debugger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var scriptURI = prompt('Enter your script','https://gist.githubusercontent.com/NeoTech/6778e791e297151dd4a5/raw/b4604119b690d797ae350e0f6ef6eaa5775b07f1/screenshot.js'); | |
var callback = prompt('Enter a Callback', "(function() { console.log('Script loaded'); })"); | |
var getScript = (function getScript(url,success) { | |
var head=document.getElementsByTagName('body')[0],done=false; | |
var script=document.createElement('script'); | |
script.src=url; | |
script.onload=script.onreadystatechange=function(){ | |
if(!done && (!this.readyState || this.readyState=='loaded' || this.readyState=='complete')) { | |
done=true; | |
if(typeof(success) === 'function') { success(); } | |
} | |
}; | |
head.appendChild(script); | |
}); | |
callback = eval(callback); | |
getScript(scriptURI,callback); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment