I'm attempting to inject the following gremlins.js code into my webpage with the command line (node):
javascript:(function(){function callback(){gremlins.createHorde().unleash()} var s=document.createElement("script");s.src="https://rawgithub.com/marmelab/gremlins.js/master/gremlins.min.js";if(s.addEventListener){s.addEventListener("load",callback,false)}else if(s.readyState){s.onreadystatechange=callback}document.body.appendChild(s);})()
but I keep getting the ReferenceError: document is not defined
error, and I haven't been able to find anything yet that fixes it.
I am relatively new to javascript. Can anyone help me out?