Mozilla XUL Element and Script Reference

Contents  Quick Reference

Browser

An iframe which is expected to contain a read-only view of a Web document.

Most of the properties and methods of the browser would rarely be used and can only be called from chrome URLs. Other URLs will need to use the document and history objects to change the displayed document.

Attributes:

Attributes inherited from XUL Element

Properties and Methods:

Properties and Methods inherited from XUL Element

addProgessListener

canGoBack

This read-only property is true if there is a page to go back to in the session history and the Back button should be enabled.

canGoForward

This read-only property is true if there is a page to go forward to in the session history and the Forward button should be enabled.

contentDocument

This read-only property contains the document object in the browser.

contentViewerEdit

This read-only property contains the nsIContentViewerEdit which handles clipboard operations on the document.

contentViewerFile
contentWindow

This read-only property contains the window object for the document.

currentURI

This read-only property contains the currently loaded URL. To change the URL, use the loadURI method.

docShell

This read-only property contains the nsIDocShell object for the document.

documentCharsetInfo

This read-only property contains the nsIDocumentCharsetInfo object for the document which is used to handle which character set should be used to display the document.

goBack ( )

Go back one page in the history.

goForward ( )

Go forward one page in the history.

goHome ( )

Load the user's home page into the browser.

gotoIndex ( index )

Navigate to the page in the history with the given index. Use a positive number to go forward and a negative number to go back.

homePage

This property holds the value of the user's home page setting.

loadURIWithFlags ( uri , flags , referrer )

Load a URL into the document, with the specified load flags and the given referrer. In addition to the flags allowed for the reloadWithFlags methods, the following flags are also valid:

loadURL

markupDocumentViewer

This read-only property contains the nsIMarkupDocumentViewer which is responsible for drawing the document.

preferences

This read-only property contains an nsIPref object for getting and setting user preferences.

preferences

This read-only property contains an nsIPref object for getting and setting user preferences.

reload ( )

Reloads the document in the browser.

reloadWithFlags ( flags )

Reloads the document in the browser with the given load flags. The flags listed below may be used, which are all constants of the webNavigation property (or the nsIWebNavigation interface). You may combine flags using a or symbol ( | )

removeProgressListener ( listener )

Remove a progress listener from the browser.

sessionHistory

This read-only property contains the nsISHistory object which holds the session history.

stop ( )

Equivalent to pressing the Stop button, this method stops the currently loading document.

webBrowserFind

This read-only property contains an nsIWebBrowserFind object which can be used to search for text in the document.

webNavigation

This read-only property contains the nsIWebNavigation object for the document. Most of its methods are callable directly on the browser itself, such as goBack and goForward. It also contains the load constants used by reloadWithFlags and loadURIWithFlags.

webProgress

This read-only property contains an nsIWebProgress object which is used to monitor the progress of a document loading.