In the content script, I'm dynamically adding a button. And I want to execute a function that already exists in the page when a button is clicked. I tried to do:
<button onClick="test();">Test</button>
But when I click on it, I'm getting error test() is not defined
.
How can I execute this function?