Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save renielsalvador/b87af7e43bd03529edf4 to your computer and use it in GitHub Desktop.

Select an option

Save renielsalvador/b87af7e43bd03529edf4 to your computer and use it in GitHub Desktop.
// 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();
}
@smsuresh

Copy link
Copy Markdown

how to test this!

@raysichic

Copy link
Copy Markdown

hello bro Plz how to test this script!

@renielsalvador

renielsalvador commented Jun 13, 2018

Copy link
Copy Markdown
Author

You can try to copy and paste it in your console.

@Kresys

Kresys commented Oct 2, 2018

Copy link
Copy Markdown

Hi ! On which Facebook page do you run the script ?

@KhushalGupta

Copy link
Copy Markdown

please tell the steps to run the script.

@SwapnilSoni1999

Copy link
Copy Markdown

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

@GMYXDS

GMYXDS commented Jul 21, 2020

Copy link
Copy Markdown

It does not work

@Danie11111

Copy link
Copy Markdown

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