Answer the question
In order to leave comments, you need to log in
What to do if actions on the page are not performed after a program click, when if you click manually everything works?
Hello! I am writing an extension for the Browser, which should interact with the site vk.com . The extension should click on the element with the class "top_audio_player_title" (after clicking on it, a menu pops up with your current music playlist). The problem is that when you click manually - everything works, but if you click through .click() , the menu will not pop up. With other elements on the page, everything works fine and is clickable.
Thanks in advance!!!
Answer the question
In order to leave comments, you need to log in
document.querySelector("#top_audio_player").dispatchEvent(new MouseEvent("mousedown"));
Most likely, that site has protection against such "software" clicks. Since this is how you can make a
PS bot: just made a click (.click()) in the console, everything works, it means something is wrong with your extension, or VK is blocking clicks
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question