nsIBrowserHistory

IID:c43079c3-3d8d-4b7c-af14-0e30ab46865f
Inherits From:nsIGlobalHistory2

This interface is implemented by the following components:


Properties

readonly PRUint32 count

Count The number of entries in global history

readonly AUTF8String lastPageVisited

LastPageVisited The last page that was visited in a top-level window.


Methods

void addPageWithDetails ( nsIURI URI , PRUnichar* title , PRInt64 lastVisited ) void hidePage ( nsIURI URI ) void markPageAsTyped ( nsIURI URI ) void removeAllPages ( ) void removePage ( nsIURI URI ) void removePagesFromHost ( AUTF8String host , PRBool entireDomain )

void addPageWithDetails ( nsIURI URI , PRUnichar* title , PRInt64 lastVisited )

Adds a page to history with specific time stamp information. This is used in the History migrator.

Arguments:
URI
title
lastVisited

void hidePage ( nsIURI URI )

Hide the specified URL from being enumerated (and thus displayed in the UI)

If the page hasn't been visited yet, then it will be added as if it was visited, and then marked as hidden

Arguments:
URI

void markPageAsTyped ( nsIURI URI )

Designate the url as having been explicitly typed in by the user, so it's okay to be an autocomplete result.

Arguments:
URI

void removeAllPages ( )

Remove all pages from global history


void removePage ( nsIURI URI )

Remove a page from history

Arguments:
URI

void removePagesFromHost ( AUTF8String host , PRBool entireDomain )

Remove all pages from the given host. If entireDomain is true, will assume host is a domain, and remove all pages from the entire domain.

Arguments:
host
entireDomain

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
March 14, 2005, 8:25 pm nikitas25 at hotmail dot com
removePage() takes a nsIURI as an argument! If you have the URL as a string, you can construct a nsIURI as follows:

var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
var uriToDelete = ioService.newURI(URL, null, null);

and then,

var browserHistory = Components.classes["@mozilla.org/browser/global-history;2"].getService(Components.interfaces.nsIBrowserHistory);
browserHistory.removePage(uriToDelete);

Copyright © 1999 - 2005 XULPlanet.com