I am working on a chrome extension when a user and select a button on a webpage (I do this by adding and event.listener and then storing event.target). Then after an action from the user I want to click that button they saved.
I grab the button in the content script and then send a message to the background with the recorded button (event.target).
How that I click the recorded button? Is there a way to do that in the background or do I have to get it to the client?
<button class="ytp-play-button ytp-button" title="Play (k)" aria-label="Play (k)" style=""><svg height="100%" version="1.1" viewBox="0 0 36 36" width="100%"><use class="ytp-svg-shadow" xlink:href="#ytp-id-56"></use><path class="ytp-svg-fill" d="M 12,26 18.5,22 18.5,14 12,10 z M 18.5,22 25,18 25,18 18.5,14 z" id="ytp-id-56"></path></svg></button>