W
W
webman20042020-12-08 21:48:59
JavaScript
webman2004, 2020-12-08 21:48:59

Chrome extension for web telegram doesn't work click(), what am I doing wrong?

Hello! I am writing a chrome extension for the web version of the cart. I just can’t overcome the automatic clicking on the Send button, I tried 100500 options on javascript without using libraries, I suspect that angular processes events, I haven’t come across Angular. How to overcome this monster? Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nadim Zakirov, 2020-12-09
@webman2004

In order for the message to be sent to work, you need to call the MOUSEDOWN event on the SEND button:

document.querySelector('span[data-content="Send"]').dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question