I was trying to make facebook autoreply msg script, here is my code
$(window).load(function(){
var a=setInterval(function(){
var e = $('.titlebarText').html();
if(!e)
{
}
else
{
$('textarea.uiTextareaAutogrow.input').focus().val('Test!');
var c = jQuery.Event("keydown");
c.which = 13;
$('textarea.uiTextareaAutogrow.input').trigger(c);
}
}
,5000);
});
$(window).load(function(){
var q=setInterval(function(){
$('.close').click()}
,6000);
});
Everything is working perfectly but simulating enter after focusing on textarea and inserting value..