I tried to look for this in the chrome documentation but I didn't see anything, especially in the "Security" section in the chrome.tabs documentation. The typical approach in examples I've seen is to send a message to the background page. The background page then calls chrome.tabs.executeScript(). If I can do it from the content script that would be a little easier.
Content scripts cannot call any Chrome API methods except couple from chrome.extension.*
package.
Unless you are doing this to save content script filesize, why not just have that code you are planning to execute in a content script from the beginning?
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