I've been trying to develop a way into clicking an Instagram stories textarea, so it can open the "quick reactions" box using the DevTools.
I have been practicing this approach at many websites using just querySelector to get the element and a "click()" after, but it does not work in this case.
I've tried to select all parents of the textarea I want to click, hoping that one of them has an on-click function or something like that.
also tried to create a simulate click function using dispatchEvent at the element, something like this:
element.dispatchEvent(new MouseEvent(eventName, {
view: window,
bubbles: true,
cancelable: true
}));
Where in some cases, "eventName" could be "mouseup", "mousedown", "click".
Tried to get the coordinates of the element using getBoundingClientRect, and used it in a dispatchEvent to simulate another click, and while doing it, tried to calculate the center of the box using the position info.
None of these approaches worked, at this point, I'm just curious about what's happening here, I've been trying to automate many websites just for fun, and my goal here was to automate a click to open the quick reactions box and click a reaction.
Thanks for any response in advance, I would really like to have a better understanding of this.