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:

picture of command

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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -