Visit Mozilla.org

nsIGlobalHistory2

From MDC


The nsIGlobalHistory2 provides information about global history to Gecko. It was split off from nsIGlobalHistory during the transition to toolkit interfaces.

Contents

nsIGlobalHistory2 is defined in docshell/base/nsIGlobalHistory2.idl. It is scriptable and unfrozen (hasn't changed since Mozilla 1.7).

Inherits from: nsISupports

[edit] Method overview

void addURI(in nsIURI aURI, in boolean aRedirect, in boolean aToplevel, in nsIURI aReferrer);
boolean isVisited(in nsIURI aURI);
void setPageTitle(in nsIURI aURI, in AString aTitle);

[edit] Methods

[edit] addURI()

Add a URI to global history.

Note: Docshell will not filter out URI schemes like chrome:, data:, about: and view-source:. Embedders should consider filtering out these schemes and others, e.g. mailbox:, for the main nsIURI and the referrer.
 void addURI(nsIURI aURI,
             boolean aRedirect,
             boolean aToplevel,
             nsIURI aReferrer);
[edit] Parameters
aURI
The nsIURI of the page being added.
aRedirect
Whether the URI was redirected to another location; this is true for the original URI which is redirected.
aToplevel
Whether the URI is loaded in a top-level window.
aReferrer
The URI of the referring page.

[edit] isVisited()

Checks to see whether the given URI is in history.

 boolean isVisited(nsIURI aURI);
[edit] Parameters
aURI
The nsIURI of the page.
[edit] Return value

true if a URI has been visited.

[edit] setPageTitle()

Set the page title for the given uri. URIs that are not already in global history will not be added.

 void setPageTitle(nsIURI aURI, AString aTitle);
[edit] Parameters
aURI
The nsIURI for which to set to the title.
aTitle
The page title.

[edit] See also