Answer the question
In order to leave comments, you need to log in
How to simulate a click in the react WhatsApp web application from the browser console?
The WhatsApp web client is implemented, it seems, in React.
How can I simulate a click on a contact on the left from the browser console to open a dialog with him?
The component is rendered as multiple nested divs. The clicks seem to be catching above, on the first child component under div#app
Tried it in different ways, for example:
var el = document.querySelectorAll('div._2wP_Y')[3];
// попытка
el.dispatchEvent(
new Event("mousedown", {bubbles: true})
); // в т.ч. с указанием других свойств: target, currentTarget
// попытка не пытка
el.click();
Answer the question
In order to leave comments, you need to log in
It looks like it's not about React, but about the fact that WhatsApp web began to check the isTrusted property of events.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question