title: How to load jQuery in Google Chrome Extensions
body: <p>I can't get my jQuery in my simple google chrome extension to be picked up when I click on the extension icon. I've searched quite a bit for how to do this, but I can't figure out why its not working for me.</p>
  
  <p>I think the jQuery is sound because it works without the onClicked function, but I would prefer for it to only work once the icon has been clicked.</p>
  
  <p>EDIT: I have jquery included in my project as a file called "jquery.js"</p>
  
  <p>My manifest.json looks like this:</p>
  
  <pre><code>{
  "name": "test",
  "description": "test",
  "version": "1.0",
  "permissions": [
      "activeTab", 
      "http://*/*", 
      "https://*/*",
      "https://ajax.googleapis.com/"
  ],
  
  
  "content_scripts": [
      {
        "matches": ["*://*/"],
        "js": ["scripts/jquery.js", "scripts/script.js", "scripts/background.js"]
      }
    ],
  
  
  
  "background": { 
          "scripts": ["scripts/jquery.js","scripts/script.js", "scripts/background.js"]
      },
  
  
  "browser_action": {
      "default_title": "test",
      "default_icon": "image.png"
  },
  
  "manifest_version": 2
  </code></pre>
  
  <p>}</p>
  
  <p>Background.js like this:</p>
  
  <p>chrome.browserAction.onClicked.addListener(function(tab) {</p>
  
  <pre><code>    chrome.tabs.executeScript(tab.id, {
          file: "scripts/jquery.js",
          allFrames: true,
          runAt: "document_idle"
      });
  
      chrome.tabs.executeScript(tab.id, {
          file: "scripts/script.js",
          allFrames: true,
          runAt: "document_idle"
      });
  });
  </code></pre>
  
  <p>And script.js like this:</p>
  
  <pre><code>chrome.browserAction.onClicked.addListener(function(tab) {
  
  
   alert("hey!");
  
  
  $('html *:not(script, style, noscript)').each(function() {
  $(this).css("background", "pink");
  
      });
  
  });
  </code></pre>
  
  <p>I know the function is being called by the browser because the alert gets picked up when the icon is clicked, but none of the jQuery. Any suggestions as to how to fix this/what may be wrong with my code?</p>
  
  <p>Thanks</p>