nsISupports
Last changed in Gecko 21.0 (Firefox 21.0 / Thunderbird 21.0 / SeaMonkey 2.18)void onBeforeDeleteURI(in nsIURI aURI, in ACString aGUID); Obsolete since Gecko 21.0 |
void onBeginUpdateBatch(); |
void onClearHistory(); |
void onDeleteURI(in nsIURI aURI, in ACString aGUID); |
void onDeleteVisits(in nsIURI aURI, in PRTime aVisitTime, in ACString aGUID); |
void onEndUpdateBatch(); |
void onPageChanged(in nsIURI aURI, in unsigned long aWhat, in AString aValue); |
void onPageExpired(in nsIURI aURI, in PRTime aVisitTime, in boolean aWholeEntry); Obsolete since Gecko 2.0 |
void onTitleChanged(in nsIURI aURI, in AString aPageTitle); |
void onVisit(in nsIURI aURI, in long long aVisitID, in PRTime aTime, in long long aSessionID, in long long aReferringID, in unsigned long aTransitionType, in ACString aGUID, out unsigned long aAdded); |
| Constant | Value | Description |
ATTRIBUTE_FAVICON |
3 |
The page's favicon changed. |
Note: This method was removed in Gecko 21.0 as part of Bug 826409.
The specified page and all its visits are about to be deleted.
Delete notifications aren't quite 100% accurate. Batch delete operations take place in two steps; the notifications come first, followed by a bulk delete. If an error occurs in between these two steps (for example, an out of memory error), then you may get a notification even though the page doesn't wind up getting deleted.
void onBeforeDeleteURI( in nsIURI aURI, in ACString aGUID );
aURIaGUID Notifies you that a batch of things are about to change. You should avoid doing any heavy-duty processing until onEndUpdateBatch() is called.
void onBeginUpdateBatch();
None.
Called just prior to all of history being cleared.
void onClearHistory();
None.
The specified page and all its visits has been deleted.
Delete notifications are not quite 100% accurate. Batch delete operations take place in two steps; the notifications come first, followed by a bulk delete. If an error occurs in between these two steps (for example, an out of memory error), then you may get a notification even though the page doesn't wind up getting deleted.
The removePagesByHost() and removePagesByTimeFrame() functions call beginUpdateBatch() and endUpdateBatch() rather than onClearHistory() or onDeleteURI().
void onDeleteURI( in nsIURI aURI, in ACString aGUID );
aURIaGUID Called when some visits of an history entry are expired.
void onDeleteVisits( in nsIURI aURI, in PRTime aVisitTime, in ACString aGUID );
aURIaVisitTimeaGUID Called once a batch of updates is completed. Once this has been called, you can perform processing, user interface updates, and so forth. This is called sometime after onBeginUpdateBatch().
void onEndUpdateBatch();
None.
Some attribute on the specified page has changed.
Note that for TYPED and HIDDEN pages, the page might not actually have been added yet. This needs to be clarified; what are TYPED and HIDDEN?
void onPageChanged( in nsIURI aURI, in unsigned long aWhat, in AString aValue );
aURIaWhataValueonDeleteVisits() instead.Called when a history entry expires. This notification is sent to indicate that a specific visit has expired, and includes the time of that visit. When the last visit for a history entry expires, the history entry itself is deleted and the aWholeEntry parameter is true.
If your code only cares about whole entries being deleted instead of individual visits, you can simply act only when aWholeEntry is true.
It's possible for a history entry to be deleted even though it has no visits if something is out of sync after a bookmark with no visits is deleted; this results in the entire history entry being freed). In such cases, aVisitTime is 0.
void onPageExpired( in nsIURI aURI, in PRTime aVisitTime, in boolean aWholeEntry );
aURIaVisitTimeaWholeEntrytrue if this expiration will result in the entire history entry being deleted from the history store; if false, only the specified visit is being deleted.Called whenever either the real title or the custom title of the page changes. Both titles are always included in this notification, even though only one is changed each time it is called, since often consumers will want to display the user title if available, falling back to the title specified by the page's <title> element if there is no user title.
It's important to note that there is a difference between an empty title and a null title. An empty string means the title was specifically set to be nothing. null means the title was not set at all. From C++ code, use the IsVoid() and SetIsvoid() methods to see whether an empty string is "null" or not; in either case it will always be an empty string.
void onTitleChanged( in nsIURI aURI, in AString aPageTitle );
aURIaPageTitleCalled when a resource is visited. This is called the first time a resource (page, image, and so on.) is seen as well as every subsequent time.
Normally, transition types of TRANSITION_EMBED (corresponding to images in a page, for example) are not displayed in history results (unless includeHidden is set). Many observers can ignore _EMBED notifications (which will comprise the majority of visit notifications) to save work.
void onVisit( in nsIURI aURI, in long long aVisitID, in PRTime aTime, in long long aSessionID, in long long aReferringID, in unsigned long aTransitionType, in ACString aGUID, out unsigned long aAdded );
aURIaVisitIDaTimeaSessionIDaReferringIDaTransitionTypensINavBookmarksService.Constants defined in the nsINavBookmarksService interface.aGUID aAddedIf you wish to support onBeforeDeleteURI() in applications based on Gecko 1.9.1, you must implement your observer's QueryInterface() method to match on both nsINavHistoryObserver and nsINavHistoryObserver_MOZILLA_1_9_1_ADDITIONS, as shown below.
QueryInterface: function(iid) {
if (iid.equals(Ci.nsINavHistoryObserver) ||
iid.equals(Ci.nsINavHistoryObserver_MOZILLA_1_9_1_ADDITIONS) ||
iid.equals(Ci.nsISupports)) {
return this;
}
throw Cr.NS_ERROR_NO_INTERFACE;
}