title: chrome content script onclick event
body: <p>I'm trying to write a chrome extension and cannot seem to understand how to implement the following scenario:</p>
  
  <ul>
  <li>user is on page X</li>
  <li>user clicks on the extension's button
  <ul>
  <li>something happens (specifically, user is redirected to some url)</li>
  </ul></li>
  </ul>
  
  <p>here's the manifest.json:</p>
  
  <pre><code>{
    "name": "My First Extension",
    "version": "1.0",
    "description": "The first extension that I made.",
    "browser_action": {
      "default_icon": "icon.png",
      "default_title": "my title"
      },
  
    "content_scripts": [
        {
          "matches": ["http://*/*", "https://*/*"],
          "js": ["myscript.js"]
        }
    ],
  
  
    "permissions": [
      "tabs", "https://*/*"
    ]
  
  }
  </code></pre>
  
  <p>and here's myscript.js:</p>
  
  <pre><code>alert('entered myscript.js..');
  
  function doMagic()
  {
      alert('extension button clicked!!');
  }
  
  chrome.extension.onClicked.addListener(doMagic);
  </code></pre>
  
  <p>i know im missing something really obvious, but cant seem to figure it out from the docs, other sites, etc.!!</p>