nsIGlobalHistory2
Last changed in Gecko 22.0 (Firefox 22.0 / Thunderbird 22.0 / SeaMonkey 2.19)Implemented by: @mozilla.org/browser/nav-history-service;1. To use this service, use:
var browserHistory = Components.classes["@mozilla.org/browser/nav-history-service;1"]
.getService(Components.interfaces.nsIBrowserHistory);
void addPageWithDetails(in nsIURI aURI, in wstring aTitle, in long long aLastVisited); Obsolete since Gecko 15.0 |
void markPageAsFollowedLink(in nsIURI aURI); Obsolete since Gecko 22.0 |
void markPageAsTyped(in nsIURI aURI); Obsolete since Gecko 22.0 |
void registerOpenPage(in nsIURI aURI); Obsolete since Gecko 9.0 |
void removeAllPages(); |
void removePage(in nsIURI aURI); |
void removePages([array, size_is(aLength)] in nsIURI aURIs, in unsigned long aLength, in boolean aDoBatchNotify); |
void removePagesByTimeframe(in long long aBeginTime, in long long aEndTime); |
void removePagesFromHost(in AUTF8String aHost, in boolean aEntireDomain); |
void removeVisitsByTimeframe(in long long aBeginTime, in long long aEndTime); |
void unregisterOpenPage(in nsIURI aURI); Obsolete since Gecko 9.0 |
markPageAsFollowedLink and markPageAsTyped methods were moved to nsINavHistoryService in Gecko 22.0 so that all markPageAs* methods can be found in one interface.| Attribute | Type | Description |
count Obsolete since Gecko 15.0 |
PRUint32 |
Indicates if there are entries in global history. For performance reasons this does not return the real number of entries. Read only. |
lastPageVisited Obsolete since Gecko 10.0 |
AUTF8String |
The last page that was visited in a top-level window. Read only. |
count attribute was removed in Gecko 15.0 because it was only used to determine if there were any entries at all anyway, so the nsINavHistoryService.hasHistoryEntries attribute is better for this.Note: This method was removed in Gecko 15.0. You should use mozIAsyncHistory.updatePlaces() instead.
This method adds a page to the history with specific time stamp information. It is called by history importing code and is used in the History migration tool.
void addPageWithDetails( in nsIURI aURI, in wstring aTitle, in long long aLastVisited );
aURIaTitleaLastVisitedNote: This method was moved to another interface in Gecko 22.0. You should use nsINavHistoryService.markPageAsFollowedLink() instead. This function was originally added in Gecko 2.0 (Firefox 4/Thunderbird 3.3/SeaMonkey 2.1).
Designates the specified URL as coming from a link explicitly followed by the user (for example by clicking on it).
void markPageAsFollowedLink( in nsIURI aURI );
aURINote: This method was moved to another interface in Gecko 22.0. You should use nsINavHistoryService.markPageAsTyped() instead.
This method designates the URL as having been explicitly typed in by the user, so it can be used as an autocomplete result. It is called by the URL bar when the user types in a URL. This can be and is called before the page is actually added to history, since the page isn't added until it actually starts loading. The typed flag affects the URL bar autocomplete. This will cause the transition type of the next visit of the URL to be marked as "typed."
void markPageAsTyped( in nsIURI aURI );
aURIMark a page as being currently open.
mozIPlacesAutoComplete.registerOpenPage(), which still exists and can be used instead.void registerOpenPage( in nsIURI aURI );
aURIThis method removes all the pages from the global history.
void removeAllPages();
None.
Visits are removed synchronously, but pages are expired asynchronously, off the main thread.
nsINavHistoryObserver.onClearHistory() is called on the history observer.This method removes all visits for a page from the history. The page itself is only deleted when it is not bookmarked and when it is not a place: URI. This method is called by the UI when the user deletes a history entry.
removePages(), since that's about the point at which the overhead of setting up a batch operation doesn't make sense anymore.void removePage( in nsIURI aURI );
aURIRemoves multiple pages from history using a batch.
removePage() repeatedly is preferable over calling this, since that's about the point at which the overhead of setting up a batch operation doesn't make sense anymore.void removePages( [array, size_is(aLength)] in nsIURI aURIs, in unsigned long aLength, in boolean aDoBatchNotify /* parameter removed in Gecko 9.0 */ );
aURIsaLengthaURIs array.aDoBatchNotify Obsolete since Gecko 9.0true, the BeginUpdateBatch and EndUpdateBatch events are sent; otherwise, no notification of changes to the history is provided. This parameter was removed in Gecko 9.0.Removes all pages within the given timeframe, using a batch.
void removePagesByTimeframe( in long long aBeginTime, in long long aEndTime );
aBeginTimeaEndTimeThis method removes all the pages from the given host. It is called from the UI when the user deletes a group associated with a host or domain. This method lets you delete pages from a specific host, or pages from all hosts in a given domain.
If aEntireDomain is true, it will assume aHost is a domain, and remove all pages from the entire domain.
void removePagesFromHost( in AUTF8String aHost, in boolean aEntireDomain );
aHostaEntireDomaintrue, it will assume aHost is a domain, and remove all pages from the entire domain, including subdomains. Set to false otherwise.Removes all visits within the given timeframe, using a batch. Any pages that become unvisited as a result are also deleted.
void removeVisitsByTimeframe( in long long aBeginTime, in long long aEndTime );
aBeginTimeaEndTimeMark a page as no longer being open (either by closing the window or tab, or by navigating away from that page).
mozIPlacesAutoComplete.unregisterOpenPage(), which still exists and can be used instead.void unregisterOpenPage( in nsIURI aURI );
aURI