javascript - How do run a command through Google Chrome's console with a hotkey through Tampermonkey -
i have been working on program "slither.io" , in order function correctly every time change servers need run bit of code through google chromes console. (you can open shift+ctrl+j) know possible way send line of code google chromes console , run hotkey. in other words, when on main page of "slither.io", should able press "e" , without having open google chromes console automatically type in , run command in console. if possible, i'd have tampermonkey script this. have not tried on own due fact bad @ programming tampermonkey. if else me appreciate it. :)
here picture of command run once "e" pressed:
all want set global variable on page when press "e" key. can achieved in javascript in event handler.
for example:
document.addeventlistener("keypress", function(e) { if (e.which == 101) { window.xhttp = .........; // .... code in screenshot } });
you need inject page via tampermonkey or chrome extension.
Comments
Post a Comment