Skip to content

Instantly share code, notes, and snippets.

// hold chat list
var chatlist = document.getElementsByClassName('_55za');
for(var x=0; x<chatlist.length; x++) { // loop
// open chatbox by triggering click
chatlist[x].click();
// get message textarea
var messages = document.getElementsByClassName('_552m');
// set its value
messages[0].value = 'Happy new year! I hope this new year will bring good luck to you and your family and to all your friends. -CHEERS :D';
// declare new event
var e = new Event("keydown");
// keycode for Enter/Return key
e.keyCode = 13;
// trigger
messages[0].dispatchEvent(e);
var closeBtn = document.getElementsByClassName('_3olu');
// finally close the chat box
closeBtn[0].click();
}
@SwapnilSoni1999
Copy link

class layouts are deprecated now.. no use of this script now

@GMYXDS
Copy link

GMYXDS commented Jul 21, 2020

It does not work

@Danie11111
Copy link

Everything can be done much easier. I use a software called cucomm. It automatically sends messages to users on Facebook. It saves time and is much more convenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment