mozIAsyncHistory 编辑
toolkit/components/places/mozIAsyncHistory.idl
Scriptable This interface allows you to add multiple visits to a single URL in a batch. 1.0 66 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); |
void isURIVisited(in nsIURI aURI, in mozIVisitedStatusCallback aCallback); |
void updatePlaces(in |
Methods
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).
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
- Passing in
NULL
foraPlaceInfo
. - Not providing at least one valid GUID or URI for all
mozIPlaceInfo
object[s]. - Not providing an array or nothing for the visits property of
mozIPlaceInfo
. - Not providing a
visitDate
andtransitionType
for eachmozIVisitInfo
. - Providing an invalid
transitionType
(seensINavBookmarksService.Constants
) for amozIVisitInfo
.
- Passing in
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论