title: chrome access browser history
body: <p>I'm trying to access my browser history in chrome, using a browser action with a popup page. </p>
  
  <pre><code>var histories = [];
  var visits = [];
  
  chrome.history.search({'text':'', 'maxResults':0}, function(historyItems){
      for(var h in historyItems){
          histories.push({'id': h.id, 'url':h.url});
      }
  });
  
  for(var h in histories){
      chrome.history.getVisits({'url': h.url, function(visitItems){
          for(var v in visitItems){
              var id = v.id;
              var visitId = v.visitId;
              var visitTime = v.visitTime;
              var referringVisitId = v.referringVisitId;
              var transition = v.transition;
              visits.push({'id': v.id, 'visitId': v.visitId, 'visitTime': v.visitTime, 'referringVisitId': v.referringVisitId, 'transition':v.transition});
          }
      });
  }
  
  console.log(histories.length + ' histories');
  console.log(visits.length + ' visits');
  </code></pre>
  
  <p>I get 234 histories and 0 visits as a result. How can I have a bunch of pages with no visits?
  What am I doing wrong?</p>