title: Unable to set chrome extension content.js to only work when the icon is clicked?
body: <p>Right now, I have an app that always runs the content.js script and replaces all images in the browser that it can find with a different image. I want to make it so that this only happens when you actually click the icon for the extension. </p>
  
  <p>Here is my manifest.json:</p>
  
  <pre><code>{
  "manifest_version": 2,
      "name": "Unicorn",
      "description": "changes images and words to unicorn related ones",
      "version": "1.0",
      "content_scripts": [
          {
              "matches": [
                  "*://*/*"
              ],
              "js": [
                  "content.js"
              ],
              "run_at": "document_end"
          }
      ],
      "browser_action": {
        "default_title": "Unicorn"
      }
  
  }
  </code></pre>
  
  <p>Here is content.js:</p>
  
  <pre><code>chrome.browserAction.onClicked.addListener(function (tab) { //should be fired when User Clicks ICON
  
  var elements = document.getElementsByTagName('*');
  for (var i = 0; i &lt; elements.length; i++) {
      var element = elements[i];
        if(isImage(element)){
  
          element.src="http://67.media.tumblr.com/30b1b0d0a42bca3759610242a1ff0348/tumblr_nnjxy1GQAA1tpo3v2o1_540.jpg";
       }
      for (var j = 0; j &lt; element.childNodes.length; j++) {
          var node = element.childNodes[j];
  
          if (node.nodeType === 3) {
              var text = node.nodeValue;
  
              var replacedText = text.replace(/wild/gi, 'rainbow bright');
  
              if (replacedText !== text) {
                  element.replaceChild(document.createTextNode(replacedText), node);
              }
          }
      }
  }
  });
  
  
  function isImage(i) {
      return i instanceof HTMLImageElement;
  }
  </code></pre>
  
  <p>This works fine without the line <code>chrome.browserAction.onClicked.addListener(function (tab) {</code> and the closing brackets for it. What am I missing here? </p>