Reputation: 764
Is it possible to make particular elements act as it was clicked on them by calling another function? For example I am trying to make an extension which will automatically clicks a button once I click on the extension. Is it possible to achieve this and if so can somebody point me to the direction of how to do it?
Upvotes: 0
Views: 1466
Reputation: 105517
I think this can be done by the content script. I would add a listener to the extension icon click in the background page. After the callback is triggered, I would inject a content script into the page with UI element. And in this content script I would find a button and trigger click on it.
Upvotes: 1