You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.
nsISHistory
This interface provides access to the primary properties of the Session History component. In an embedded browser environment, the
nsIWebBrowser
object creates an instance of session history for each open window. A handle to the session history object can be obtained fromnsIWebNavigation
. In a non-embedded situation, the owner of the session history component must create a instance of it and set it in thensIWebNavigation
object. This interface is scriptable.Obtains a handle to the history entry at a given index.
Syntax:
nsIHistoryEntry nsISHistory::getEntryAtIndex( in long index,in boolean modifyIndex)Parameters:
modifyIndex:
A boolean flag that indicates if the current index of session history should be modified to the parameter index.
nsresult:
Purges older documents from history. Documents can be removed from session history for various reasons. For example to control memory usage of the browser, to prevent users from loading documents from history, to erase evidence of prior page loads etc.
Syntax:
void nsISHistory::PurgeHistory(in long numEntries)Paramters:
numEntries:
The number of toplevel documents to be purged from history. During purge operation, the latest documents are maintained and oldernumEntries
documents are removed from history.
nsresult:
Registers a listener for the session history component. Listeners are notified when pages are loaded or purged from history.
Syntax:
void nsISHistory::addSHistoryListener( in nsISHistoryListener aListener)Note: A listener object must implement
nsISHistoryListener
andnsISupportsWeakReference
.See also
nsISHistoryListener
and
nsISupportsWeakReference
.
nsresult:
Removes a listener for the session history component. Listeners are notified when pages are loaded or purged from history.
Syntax:
void nsISHistory::removeSHistoryListener( in nsISHistoryListener aListener)Note:A listener object must implement
nsISHistoryListener
andnsISupportsWeakReference
.See also
nsISHistoryListener
and
nsISupportsWeakReference
.
nsresult:
Gets an enumerator for all the documents stored in session history. The enumerator object thus returned by this method can be traversed using
nsISimpleEnumerator
.Note: To access individual history entries of the enumerator, perform the following steps:
2) UsensISimpleEnumerator->GetNext
on the object returned by step #1 to obtain handle to the next object in the list. The object returned by this step is of typensISupports.
See also:
nsISimpleEnumerator
,
nsIHistoryEntry
,
QueryInterface
, anddo_QueryInterface.
Gets the number of toplevel documents currently available in session history.
Gets the index of the current document in session history.
Gets and sets the maximum number of toplevel documents session history can hold for each instance.
Written by:Ellen Evans | Comments, questions, complaints?
Bug 143387 |