B2G/gecko/browser/base/content/pageinfo/security.js
/**
 * Return the number of previous visits recorded for host before today.
 *
 * @param host - the domain name to look for in history
 */
Return the number of previous visits recorded for host before today.
@param host - the domain name to look for in history
Return the number of previous visits recorded for host before today . @param host - the domain name to look for in history
function previousVisitCount(host, endTimeReference) {
  if (!host)
    return false;
  var historyService = Components.classes["@mozilla.org/browser/nav-history-service;1"]
                                 .getService(Components.interfaces.nsINavHistoryService);
  var options = historyService.getNewQueryOptions();
  options.resultType = options.RESULTS_AS_VISIT;
  var query = historyService.getNewQuery();
  query.endTimeReference = query.TIME_RELATIVE_TODAY;
  query.endTime = 0;
  query.domain = host;
  var result = historyService.executeQuery(query, options);
  result.root.containerOpen = true;
  var cc = result.root.childCount;
  result.root.containerOpen = false;
  return cc;
}
function previousVisitCount ( host , endTimeReference ) { if ( ! host ) return false ; var historyService = Components . classes [ "@mozilla.org/browser/nav-history-service;1" ] . getService ( Components . interfaces . nsINavHistoryService ) ; var options = historyService . getNewQueryOptions ( ) ; options . resultType = options . RESULTS_AS_VISIT ; var query = historyService . getNewQuery ( ) ; query . endTimeReference = query . TIME_RELATIVE_TODAY ; query . endTime = 0 ; query . domain = host ; var result = historyService . executeQuery ( query , options ) ; result . root . containerOpen = true ; var cc = result . root . childCount ; result . root . containerOpen = false ; return cc ; }
Return the number of previous visits recorded for host before today.
Return the number of previous visits recorded for host before today .
// Search for visits to this host before today