I am making an extension for one website and on specific pages there is a button that executes logic that I need to trigger from extension. Lets say page has button <button onclick="page_action('1')">Click me</button>
. page_action
function is located in separate file that is hosted in CDN, for example https://website.cdn.com/my_script.js
and this my_script.js
is defined on websites page (head tag
).
So my question is how and if its even possible to manually execute page_action
from within chrome extension ?
Finding and clicking button element isn't an option cause in some cases this button is hidden.
Tried different variations and one error that I stumbled was related to CSP. This code is even throwing error:
"content_security_policy": {
"extension_pages": "script-src 'self' https://website.cdn.com; object-src 'self'"
}