title: Google OAuth2 verification hangs
body: <p>I am trying to write a Google Chrome extension that will replace the new tab page and can connect to a users Google Calendar to show upcoming events. I am having trouble getting the extension to properly authorize access with OAuth.</p>
  
  <p>I am testing the following code to authorize the user:</p>
  
  <p>func.js</p>
  
  <pre><code>// initialize google api
  gapi.client.setApiKey('MY API KEY');
  gapi.client.load('calendar', 'v3', function() {
      console.log('calendar api loaded')
  });
  
  // OAuth2 verification
  function auth() {
    var config = {
      'client_id': 'MY CLIENT ID',
      'scope': 'https://www.googleapis.com/auth/calendar'
    };
    gapi.auth.authorize(config, function() {
      console.log('login complete');
      console.log(gapi.auth.getToken());
    });
  }
  </code></pre>
  
  <p>manifest.json</p>
  
  <pre><code>{
      // ...
      "oauth2": {
          "client_id": "MY CLIENT_ID",
          "scopes": [
              "https://www.googleapis.com/auth/calendar"
          ]
      },
      // ...
  }
  </code></pre>
  
  <p>The Google API is initialized properly and the callback function is called. Before I added the <code>"oauth2"</code> parameter to <code>manifest.json</code>, I received an error from Google, but now when <code>auth()</code> is called the authentication popup window appears, but it just stays blank and says 'connecting' and nothing ever shows. Am I doing OAuth verification correctly? What is causing this hang?</p>