javascript - Google Chrome Extensions: How to include jQuery in programmatically injected content script? -


i'm injecting content script background page when user clicks browser action button, so:

chrome.browseraction.onclicked.addlistener(function (tab) {     chrome.tabs.executescript(null, { file: "content.js" }); }); 

so how can access jquery inside content.js? don't see way inject simultaneously.

what about:

chrome.tabs.executescript(null, { file: "jquery.js" }, function() {     chrome.tabs.executescript(null, { file: "content.js" }); }); 

you can download "jquery.js" here: http://jquery.com/download/


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -