title: How can I trigger a content script to run when I click the popup icon of a Google Chrome extension?
body: <p>Building my first Chrome app and was wondering how to run <code>myscript.js</code> only when icon.png is clicked. Now it just runs whenever a page loads.</p>
  
  <p>Here is my manifest.json file:</p>
  
  <pre><code>{
      "name": "My extension",
      "version": "1.0",
      "background_page": "background.html",
      "permissions": [
          "tabs", "http://*/*"
      ],
      "content_scripts": [
          {
              "matches": ["http://*/*"],
              "js": ["myscript.js"],
              "run_at": "document_end"
          }
      ],
      "browser_action": {
          "default_icon": "icon.png"
      }
  }
  </code></pre>