mozIAsyncHistory

This interface allows you to add multiple visits to a single URL in a batch.
1.0
28
Introduced
Gecko 24.0
Inherits from: nsISupports Last changed in Gecko 24.0 (Firefox 24.0 / Thunderbird 24.0 / SeaMonkey 2.21)

Implemented by: @mozilla.org/browser/history;1 as a service:

var asyncHistory = Components.classes["@mozilla.org/browser/history;1"]
                   .getService(Components.interfaces.mozIAsyncHistory);

Method overview

void getPlacesInfo(in jsval aPlaceIdentifiers, in mozIVisitInfoCallback aCallback); Requires Gecko 24.0
void isURIVisited(in nsIURI aURI, in mozIVisitedStatusCallback aCallback);
void updatePlaces(in mozIPlaceInfo, [optional] in mozIVisitInfoCallback aCallback);

Methods

Requires Gecko 24.0 (Firefox 24.0 / Thunderbird 24.0 / SeaMonkey 2.21)

getPlacesInfo()

Starts an asynchronous request to determine whether or not a given URI has been visited; you must implement a callback to receive the result of the request.

void getPlacesInfo(
  in jsval aPlaceIdentifiers,
  in mozIVisitInfoCallback aCallback
);
Parameters
aPlaceIdentifiers
The URI for which to determine the visited status.
aCallback
An object implementing the mozIVisitedStatusCallback.isVisited() method. If there's no information available for a given place, aCallback is called with a stub place info object, containing just the provided data (GUID or URI).

Requires Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8)

isURIVisited()

Starts an asynchronous request to determine whether or not a given URI has been visited; you must implement a callback to receive the result of the request.

void isURIVisited(
  in nsIURI aURI,
  in mozIVisitedStatusCallback aCallback
);
Parameters
aURI
The places for which to retrieve information, identified by either a single place GUID, a single URI, or a JS array of URIs and/or GUIDs.
aCallback
An object implementing the mozIVisitedStatusCallback.isVisited() method; this method will be called with the results once the request has been completed.

updatePlaces()

Adds a set of visits for one or more mozIPlaceInfo objects, and updates each mozIPlaceInfo's title or GUID.  Note that this lets you add to history even in Private Browsing mode; if that's not desired you can first check whether the window is in Private Browsing mode.

void updatePlaces(
  in mozIPlaceInfo aPlaceInfo,
  in mozIVisitInfoCallback aCallback Optional
);
Parameters
aPlaceInfo
The mozIPlaceInfo object[s] containing the information to store or update. This can be a single object, or an array of objects.
aCallback Optional
A mozIVisitInfoCallback object to be notified for each visit addition, title change, GUID change, or error. If more than one operation is performed for a given visit, only one callback will be given (i.e. title change and add visit).
Exceptions thrown
NS_ERROR_INVALID_ARG

See also

Document Tags and Contributors

 Last updated by: Sheppy,