Chrome extension making mouse click with extension

时光怂恿深爱的人放手 提交于 2019-12-25 04:15:39

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/39958812/chrome-extension-making-mouse-click-with-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!