Interface nsISHEntryType

Hierarchy

Properties

ID: number

An ID to help identify this entry from others during subframe navigation

URI: nsIURI

The URI of the current entry.

URIWasModified: boolean

If we created this SHEntry via history.pushState or modified it via history.replaceState, and if we changed the SHEntry's URI via the push/replaceState call, and if the SHEntry's new URI differs from its old URI by more than just the hash, then we set this field to true.

Additionally, if this SHEntry was created by calling pushState from a SHEntry whose URI was modified, this SHEntry's URIWasModified field is true.

baseURI: nsIURI

When isSrcdocEntry is true, this contains the baseURI of the srcdoc document for use in situations where it cannot otherwise be determined, for example with view-source.

bfcacheID: number
cacheKey: number

The cache key for the entry

childCount: number

The current number of nsISHEntries which are immediate children of this SHEntry.

contentType: string

attribute to indicate the content-type of the document that this is a session history entry for

contentViewer: nsIContentViewer

Content viewer, for fast restoration of presentation

csp: nsIContentSecurityPolicy

Get the csp, if any, that was used for this document load. That is not the CSP that was applied to subresource loads within the document, but the CSP that was applied to this document load.

docshellID: object

The history ID of the docshell.

hasPostData: boolean
hasUserActivation: boolean

Whether the load that created this entry was triggered by user activation. (e.g.: The user clicked a link) Remembering this flag enables replaying the sec-fetch-* headers.

hasUserInteraction: boolean

Whether the user interacted with the page while this entry was active. This includes interactions with subframe documents associated with child entries that are rooted at this entry. This field will only be set on top-level entries.

isInBFCache: boolean
isSrcdocEntry: boolean

True if this SHEntry corresponds to a document created by a srcdoc iframe. Set when a value is assigned to srcdocData.

isSubFrame: boolean

Was the entry created as a result of a subframe navigation?

  • Will be 'false' when a frameset page is visited for the first time.
  • Will be 'true' for all history entries created as a result of a subframe navigation.
lastTouched: number

A number that is assigned by the sHistory when the entry is activated

layoutHistoryState: nsILayoutHistoryState

LayoutHistoryState for scroll position and form values

loadReplace: boolean

This flag remembers whether channel has LOAD_REPLACE set.

loadType: number

The loadType for this entry. This is typically loadHistory except when reload is pressed, it has the appropriate reload flag

loadedInThisProcess: boolean

Flag to indicate that the history entry was originally loaded in the current process. This flag does not survive a browser process switch.

name: string

The name of the browsing context.

originalURI: nsIURI

The original URI of the current entry. If an entry is the result of a redirect this attribute holds the original URI.

parent: nsISHEntry

parent of this entry

partitionedPrincipalToInherit: nsIPrincipal

Get the storage principal, if any, that is used when the inherit flag is set.

persist: boolean

When an entry is serving is within nsISHistory's array of entries, this property specifies if it should persist. If not it will be replaced by new additions to the list.

postData: nsIInputStream

Post Data for the document

principalToInherit: nsIPrincipal

Get the principal, if any, that is used when the inherit flag is set.

referrerInfo: nsIReferrerInfo

Referrer Info

refreshURIList: nsIMutableArray

Saved refresh URI list for the content viewer

resultPrincipalURI: nsIURI

URL as stored from nsILoadInfo.resultPrincipalURI. See nsILoadInfo for more details.

saveLayoutStateFlag: boolean

Should the layoutHistoryState be saved?

scrollRestorationIsManual: boolean

Sets/gets the current scroll restoration state, if true == "manual", false == "auto".

shistory: nsISHistory

The session history it belongs to. This is set only on the root entries.

srcdocData: string

Contents of the srcdoc attribute in a srcdoc iframe to be loaded instead of the URI. Similar to a Data URI, this information is needed to recreate the document at a later stage. Setting this sets isSrcdocEntry to true

stateData: nsIStructuredCloneContainer

Get/set data associated with this history state via a pushState() call, serialized using structured clone.

sticky: boolean

Whether the content viewer is marked "sticky"

title: string

The title of the current entry.

triggeringPrincipal: nsIPrincipal

Get the principal, if any, that was associated with the channel that the document that was loaded to create this history entry came from.

unstrippedURI: nsIURI

If non-null, the URI as it was before query stripping was performed.

windowState: nsISupports

Saved state of the global window object

wireframe: any

If browser.history.collectWireframes is true, this will get populated with a Wireframe upon document navigation / pushState. This will only be set for nsISHEntry's accessed in the parent process with sessionHistoryInParent enabled. See Document.webidl for more details on what a Wireframe is.

Methods

  • Add a new child SHEntry. If offset is -1 adds to the end of the list.

    Parameters

    • aChild: nsISHEntry
    • aOffset: number
    • aUseRemoteSubframes: 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

  • Remove all children of this entry and call abandonBFCacheEntry.

    Returns void

  • Create nsDocShellLoadState and fill it with information. Don't set nsSHEntry here to avoid serializing it.

    Returns nsDocShellLoadStatePtr

  • Get child at an index.

    Parameters

    • aIndex: number

    Returns nsISHEntry

  • If this entry has no dynamically added child, get the child SHEntry at the given offset. The loadtype of the returned entry is set to its parent's loadtype.

    Parameters

    • aChildOffset: number
    • aChild: nsISHEntry

    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

  • Remove a child SHEntry.

    Parameters

    • aChild: nsISHEntry

    Returns void

  • Replaces a child which is for the same docshell as aNewChild with aNewChild.

    Throw

    if nothing was replaced.

    Parameters

    • aNewChild: nsISHEntry

    Returns void

  • Sync up the docshell and session history trees for subframe navigation.

    Parameters

    • aEntry: nsISHEntry

      new entry

    • aTopBC: BrowsingContext

      top BC corresponding to the root ancestor of the docshell that called this method

    • aIgnoreBC: BrowsingContext

      current BC

    Returns void

  • Create a new BFCache entry and drop our reference to our old one. This call unlinks this SHEntry from any other SHEntries for its document.

    Returns void

  • Saved child docshells corresponding to contentViewer. The child shells are restored as children of the parent docshell, in this order, when the parent docshell restores a saved presentation.

    Append a child shell to the end of our list.

    Parameters

    • shell: nsIDocShellTreeItem

    Returns void

  • Adopt aEntry's BFCacheEntry, so now both this and aEntry point to aEntry's BFCacheEntry.

    Parameters

    • aEntry: nsISHEntry

    Returns void

  • Get the child shell at |index|; returns null if |index| is out of bounds.

    Parameters

    • index: number

    Returns nsIDocShellTreeItem

  • Clear the child shell list.

    Returns void

  • Returns nsISHEntry

  • Additional ways to create an entry

    Parameters

    • URI: nsIURI
    • title: string
    • inputStream: nsIInputStream
    • cacheKey: number
    • contentType: string
    • triggeringPrincipal: nsIPrincipal
    • principalToInherit: nsIPrincipal
    • partitionedPrincipalToInherit: nsIPrincipal
    • aCsp: nsIContentSecurityPolicy
    • docshellID: object
    • dynamicCreation: boolean
    • originalURI: nsIURI
    • resultPrincipalURI: nsIURI
    • unstrippedURI: nsIURI
    • loadReplace: bool
    • referrerInfo: nsIReferrerInfo
    • srcdoc: string
    • srcdocEntry: bool
    • baseURI: nsIURI
    • saveLayoutState: bool
    • expired: bool
    • userActivation: bool

    Returns void

  • Gets the owning pointer to the editor data assosicated with this shistory entry. This forgets its pointer, so free it when you're done.

    Returns nsDocShellEditorDataPtr

  • Parameters

    • x: number
    • y: number

    Returns void

  • Saved position and dimensions of the content viewer; we must adjust the root view's widget accordingly if this has changed when the presentation is restored.

    Parameters

    • bounds: nsIntRect

    Returns void

  • Does this SHEntry point to the given BFCache entry? If so, evicting the BFCache entry will evict the SHEntry, since the two entries correspond to the same document.

    Parameters

    • aEntry: SHEntrySharedParentStatePtr

    Returns boolean

  • Returns true if this shistory entry is storing a detached editor.

    Returns boolean

  • Returns true if any of the child entries returns true when isDynamicallyAdded is called on it.

    Returns boolean

  • Initialises layoutHistoryState if it doesn't already exist and returns a reference to it.

    Returns nsILayoutHistoryState

  • Returns true if the related docshell was added because of dynamic addition of an iframe/frame.

    Returns boolean

  • Sets the owning pointer to the editor data assosicated with this shistory entry. Unless forgetEditorData() is called, this shentry will destroy the editor data when it's destroyed.

    Parameters

    • aData: nsDocShellEditorDataPtr

    Returns void

  • Sets an SHEntry to reflect that it is a history type load. This is the equivalent to doing

    shEntry.loadType = 4;

    in js, but is easier to maintain and less opaque.

    Returns void

  • Set/Get the visual viewport scroll position if session history is changed through anchor navigation or pushState.

    Parameters

    • x: number
    • y: number

    Returns void

  • Parameters

    • bounds: nsIntRect

    Returns void

  • Does this SHEntry correspond to the same document as aEntry? This is true iff the two SHEntries have the same BFCacheEntry. So in particular, sharesDocumentWith(aEntry) is guaranteed to return true if it's preceded by a call to adoptBFCacheEntry(aEntry).

    Parameters

    • aEntry: nsISHEntry

    Returns boolean

  • Ensure that the cached presentation members are self-consistent. If either |contentViewer| or |windowState| are null, then all of the following members are cleared/reset: contentViewer, sticky, windowState, viewerBounds, childShells, refreshURIList.

    Returns void

Generated using TypeDoc