title: Google Chrome extension and Twilio Client API
body: <p>I'm a newb trying to make a Chrome Extension that utilizes the <a href="https://www.twilio.com/blog/2013/04/introduction-to-twilio-client-with-node-js.html" rel="noreferrer">Twilio Client API</a> and a Node.js back end to make outgoing calls from the browser. </p>
  
  <p>I'm having some trouble to run Twilio from my Extension, I get <code>"Twilio is not defined"</code>.</p>
  
  <p>Here is my manifest file:</p>
  
  <pre><code>{
    "name": "&lt;NAME&gt;",
    "version": "0.0.1",
    "manifest_version": 2,
    "permissions": [
      "contextMenus",
      "http://localhost:3000/",
      "http://*.twilio.com/*",
      "https://*.twilio.com/*"
    ],
    "background": {
      "scripts": ["lib/jquery-1.7.2.min.js","lib/twilio.js","background.js"]
    }, 
    "content_scripts": [
      {
        "matches": ["http://*/*", "https://*/*", "file:///*/*"],
        "css": ["css/styles.css"],
        "js": ["lib/jquery-1.7.2.min.js"]
      }
    ],
    "icons":{
      "128":"icon_128.png"
    }
  }
  </code></pre>
  
  <p>and here is my background.js:</p>
  
  <pre><code>console.log('Init background.js...'); 
  
  function callNumber(info, tab) {
      alert(info.selectionText);
  }
  
  chrome.contextMenus.create ({
      "title":"%s", 
      "contexts": ["all"], 
      "onclick": callNumber
  });
  
  // get capability token
  $(function() {
      $.get('http://localhost:3000/token', function(resp){
          initTwilio(resp);
      }); 
  });
  
  function initTwilio(token) {
      // init twilio
      Twilio.Device.setup(token);
  }
  </code></pre>
  
  <p>Any suggestions on how I can utilize the Twilio Client API?</p>
  
  <p>Thanks!</p>