We are developing an Chrome extension, where in we faced the following issue.
We try to access submit button.onclick() through content scripts.js for Chrome extensions.
But onclick() event is not getting triggered while we invoke from content scripts.js.
How to resolve this issue?
Content scripts have access to the DOM but not directly to the code execution environment - however you should be able to get the DOM element and call the "click()" method which should then issue the command.
If, that doesn't work, it is perfectly possible for you to inject a new <script> tag via the content script which will instead call the submit button using something like <script>$("button")[0].click()</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With