PhoenixCreation / whatsapp-spammer

If you are finding script to spam whatsapp messages, you have come to right place. This is script for whatsapp message spamming on web interface.
MIT License
40 stars 14 forks source link

Issue with the loop #1

Closed amalsebastian7 closed 1 year ago

amalsebastian7 commented 2 years ago
var count = prompt("Enter number of messages");
var message = prompt("MESSAGE YOU WANT TO SPAM : ", "Hello ");
console.clear();
for (let i = 0; i < count; i++) {
    console.log(`"${message}" sent -> ${i + 1} times`);

      // Get the input box
      var box = document.querySelectorAll("[role=textbox]")[1];

      // create event of type 'input' so that the whatsapp UI will update to sending text message instead of voice message
      InputEvent = Event || InputEvent;
      var evt = new InputEvent("input", {
        bubbles: true,
        composer: true,
      });
      box.innerHTML = message; // set the message as input box value
      box.dispatchEvent(evt); // trigger the event

      // This is bit of stratch to select the send button and click it
      // You need to climb up the DOM tree three levels and then to second child and then the first child is the send button
      box.parentElement.parentElement.parentElement.children[1].children[0].click();
    }

Screenshot 2022-08-25 104911

This runs well and selects the send button and clicks it( typed a random input while executing and it sends) but it doesnt send the text we enter or the number of times to the chat. Thanks

amalsebastian7 commented 2 years ago

I think it could be the issue with the loop

PhoenixCreation commented 2 years ago

Hi @amalsebastian7, Thanks for pointing this out. Although I was not able to reproduce this so I will need some more info from your side. Can you provide the following information?

Thank you

Mr-Zanzibar commented 2 years ago

i have the same problem, i'm using Chrome (version 105.0.5195.102) with a personal chat whass version (0.4.930)

PhoenixCreation commented 1 year ago

Hi, I am sorry for late response but I have been busy in other projects.

I checked with the latest version of whatsapp web and I found that they have changed the implementation from their end. So this script will not work in there.

Technical details:

Workarounds:

I am leaving this issue open for other coming to this repo.

PhoenixCreation commented 1 year ago

Hi @amalsebastian7, Sorry for late response. I have updated the script to be working again on Edge and Chrome. Although firefox is still having issues. Closing this issue as it is fixed. Feel free to reopen it if issue persists or create a new issue.