title: chrome extension tabs working/not working
body: <p>I'm working on an extension that requires the current tab url. I am able to access the correct url and alert it to the screen, but it isn't being recognized or able to be used elsewhere. </p>
  
  <pre><code>  var currentUrl;
    chrome.tabs.query({'currentWindow': true, 'active': true, 'lastFocusedWindow': true}, function (tabs) {
      alert(tabs[0].url);
         //this alerts correctly, but is the line 121 error in the error message
      var currentUrl = tabs[0].url;
         //this is undefined and can't be used
      });
  </code></pre>
  
  <p>This is the error message from the popup inspector:
     Error in response to tabs.query: TypeError: Cannot read property 'url' 
     of undefined
      at Object.callback (chrome- 
     extension://pokiconaaogmgmencihnokkdk/popup.js:121:23)
      at HTMLButtonElement. (chrome-extension://pokiconaaogmgmencihnokkdk/popup.js:120:19)</p>
  
  <p>My permissions:</p>
  
  <p>"permissions": [
           "tabs",
           "storage"
         ],</p>
  
  <p>Any ideas would be helpful, thank you.</p>