The error message I am receiving is "$ is not defined"
Part of my manifest file:
"content_scripts": [
{
"matches": ["http://www.google.com/calendar/render*",
"https://www.google.com/calendar/render/*"],
"js": ["jquery.min.js", "jquery-ui.js", "script.js"],
"css": ["jquery.datepick.css", "jquery-ui.css"],
"run_at": "document_start"
}],
"background": {"scripts": ["background.js"]},
"web_accessible_resources": ["jquery.min.js", "script.js", "jquery-ui.js", "jquery.datepick.css", "jquery-ui.css"]
In my background.js file I am trying to execute the needed scripts:
chrome.tabs.executeScript(tabId, {file: "jquery.min.js"}, function(){
chrome.tabs.executeScript(tabId, {file: "jquery-ui.js"}, function() {
chrome.tabs.executeScript(tabId, { file: 'script.js' });
});
});
Still, in script.js I can't use any Jquery function (error: $ is not defined).
Can anyone please explain me why it's failing, or how it should be done?
Thanks in advance.