Skip to content

Instantly share code, notes, and snippets.

@Prithvirajbilla
Last active August 29, 2015 14:19
Show Gist options
  • Save Prithvirajbilla/aa1f80ab08f4c4cf991c to your computer and use it in GitHub Desktop.
Save Prithvirajbilla/aa1f80ab08f4c4cf991c to your computer and use it in GitHub Desktop.
// With little creativity and some coding skills you can do a lot of things using this code to annoy some one.
// works on the first chat box opened. only works in google chrome!
function dispatch(target) {
var evt = document.createEvent("Event");
evt.initEvent("keydown",true,true);
evt.keyCode = 13;
evt.which = 13;
target.dispatchEvent(evt);
}
// "#PeaceYo" is the message
// 1000 is the milli seconds interval. right now it is 1sec.
window.setInterval(function(){
document.getElementsByClassName("uiTextareaAutogrow _552m")[0].value = "#PeaceYo"
dispatch(document.getElementsByClassName("uiTextareaAutogrow _552m")[0]);
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment