Interface nsISHistoryType

An interface 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 from nsIWebNavigation. In a non-embedded situation, the owner of the session history component must create a instance of it and set it in the nsIWebNavigation object. This interface is accessible from javascript.

Hierarchy

Properties

count: number

A readonly property of the interface that returns the number of toplevel documents currently available in session history.

index: number

The index of the current document in session history. Not infallible because setting can fail if the assigned value is out of range.

requestedIndex: number

A readonly property of the interface that returns the index of the last document that started to load and didn't finished yet. When document finishes the loading value -1 is returned.

Methods

  • Parameters

    • aCloneRef: nsISHEntry
    • aNewEntry: nsISHEntry
    • aRootBC: BrowsingContext
    • aCloneChildren: bool

    Returns void

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aCloneChildren: bool
    • aOSHE: nsISHEntry
    • aRootBC: BrowsingContext
    • aEntry: nsISHEntry
    • aLoadType: number
    • aShouldPersist: bool
    • aPreviousEntryIndex: MaybeInt32
    • aLoadedEntryIndex: MaybeInt32

    Returns void

  • Parameters

    • aEntry: nsISHEntry

    Returns void

  • Parameters

    • aNewSHEntry: nsISHEntry
    • aReplace: bool

    Returns void

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aReloadFlags: number

    Returns void

  • Remove dynamic entries found at given index.

    Parameters

    • aIndex: number

      Index to remove dynamic entries from. It will be passed to RemoveEntries as aStartIndex.

    • aEntry: nsISHEntry

      (optional) The entry to start looking in for dynamic entries. Only the dynamic descendants of the entry will be removed. If not given, all dynamic entries at the index will be removed.

    Returns void

  • Similar to RemoveDynEntries, but instead of specifying an index, use the given BFCacheEntry to find the index and remove dynamic entries from the index.

    The method takes no effect if the bfcache entry is not or no longer hold by the SHistory instance.

    Parameters

    • aEntry: nsIBFCacheEntry

      The bfcache entry to look up for index to remove dynamic entries from.

    Returns void

  • Removes entries from the history if their docshellID is in aIDs array.

    Parameters

    • aIDs: nsDocshellIDArray
    • aStartIndex: number

    Returns void

  • Collect docshellIDs from aEntry's children and remove those entries from history.

    Parameters

    • aEntry: nsISHEntry

      Children docshellID's will be collected from this entry and passed to RemoveEntries as aIDs.

    Returns void

  • Add a new Entry to the History List.

    Parameters

    • aEntry: nsISHEntry

      The entry to add.

    • aPersist: boolean

      If true this specifies that the entry should persist in the list. If false, this means that when new entries are added this element will not appear in the session history list.

    Returns void

  • Called to register a listener for the session history component. Listeners are notified when pages are loaded or purged from history.

    Note

    A listener object must implement nsISHistoryListener and nsSupportsWeakReference

    See

    • nsISHistoryListener
    • nsSupportsWeakReference

    Parameters

    • aListener: nsISHistoryListener

      Listener object to be notified for all page loads that initiate in session history.

    Returns void

  • Add a BFCache entry to expiration tracker so it gets evicted on expiration.

    Parameters

    • aEntry: SHEntrySharedParentStatePtr

    Returns void

  • Returns nsISHEntry

  • Evict all the content viewers in this session history

    Returns void

  • Evict the content viewer associated with a bfcache entry that has timed out.

    Parameters

    • aEntry: SHEntrySharedParentStatePtr

    Returns void

  • Evict content viewers which don't lie in the "safe" range around aIndex. In practice, this should leave us with no more than gHistoryMaxViewers viewers associated with this SHistory object.

    Also make sure that the total number of content viewers in all windows is not greater than our global max; if it is, evict viewers as appropriate.

    Parameters

    • aIndex: number

      The index around which the "safe" range is centered. In general, if you just navigated the history, aIndex should be the index history was navigated to.

    Returns void

  • Get the history entry at a given index. Returns non-null on success.

    Returns

    The found entry; never null.

    Parameters

    • aIndex: number

    Returns nsISHEntry

  • Called to obtain the index to a given history entry.

    Returns

    NS_OK index for the history entry is obtained successfully. NS_ERROR_FAILURE Error in obtaining index for the given history entry.

    Parameters

    • aEntry: nsISHEntry

      The entry to obtain the index of.

    Returns number

  • Load the entry at the particular index.

    Parameters

    • aIndex: number
    • aUserActivation: boolean

    Returns void

  • If an element exists at the particular index and whether it has user interaction.

    Parameters

    • aIndex: number

    Returns boolean

  • Artifically set the |requestedIndex| for this nsISHEntry to the given index. This is used when resuming a cross-process load from a different process.

    Parameters

    • aRequestedIndex: number

    Returns void

  • Returns boolean

  • Notifies all registered session history listeners about an impending reload.

    Returns

    Whether the operation can proceed.

    Returns boolean

  • Called to purge 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...

    Throws

    NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA Purge was vetod.

    Throws

    NS_ERROR_FAILURE numEntries is invalid or out of bounds with the size of history.

    Parameters

    • aNumEntries: number

    Returns void

  • Returns void

  • Remove a BFCache entry from expiration tracker.

    Parameters

    • aEntry: SHEntrySharedParentStatePtr

    Returns void

  • Called to remove a listener for the session history component. Listeners are notified when pages are loaded from history.

    Note

    A listener object must implement nsISHistoryListener and nsSupportsWeakReference

    See

    • nsISHistoryListener
    • nsSupportsWeakReference

    Parameters

    • aListener: nsISHistoryListener

      Listener object to be removed from session history.

    Returns void

  • Replace the nsISHEntry at a particular index

    Parameters

    • aIndex: number

      The index at which the entry should be replaced.

    • aReplaceEntry: nsISHEntry

      The replacement entry for the index.

    Returns void

  • Update the index maintained by sessionHistory

    Returns void

Generated using TypeDoc