Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can chrome.tabs.executeScript() be called from within a content script? [duplicate]

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.

like image 835
void.pointer Avatar asked Jun 01 '11 17:06

void.pointer


1 Answers

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?

like image 183
serg Avatar answered Nov 17 '22 21:11

serg