I am trying to develop a test chrome extension to see how jQuery works with chrome extensions. From the code presented, I think that it should change the background of the popup to yellow.
I tried loading jquery.js using the contents of the script and using the background. When I load it using the background scripts command, it shows that jquery.js is loaded.
Here are my files:
manifest.json
{ "name": "Hello World!", "version": "1.0", "manifest_version": 2, "description": "My first Chrome extension.", "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html" }, "content_scripts": [ { "matches": ["http://www.google.com/*"], "js": ["jquery.js", "content.js"] } ] }
popup.html
<html> <head> <script src='jquery.js'></script> <script src='content.js'></script> </head> </html>
content.js
$('a').css({'background-color': 'yellow'});
I have jquery.js in my extension folder. If someone either gives me something else to try to get this to work, or to show me a really good working example of the chrome extension that binds jquery to, that would be great!
javascript jquery html google-chrome google-chrome-extension
user2200175
source share