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
Post a Comment