<browser> element represents a frame which is expected to contain a view of a Web document. It is similar to an
iframe except that it holds a page history and contains additional methods to manipulate the currently displayed page.
Are you here looking for information about the Firefox web browser, or because you'd like to download the latest version of Firefox?
Most of the properties and methods of the browser will 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.
<!-- shows Mozilla homepage inside a groupbox --> <groupbox flex="1"> <caption label="Mozilla homepage"/> <browser type="content" src="http://www.mozilla.org" flex="1"/> </groupbox>
trueto enable autocomplete of fields.
falseto disable autoscroll for this browser. If this attribute is set to
trueor omitted, autoscroll will be enabled or depending on the user preference
trueto disable the security UI for this browser. Omit this attribute off to enable it.
This function is called when links are dropped to the browser element, with the following arguments.
droppedLinkHandler(event, uri, name) -- Firefox 51 or older droppedLinkHandler(event, links) -- Firefox 52 or newer
event-- drop event, or
nullif no event is available
uri-- uri string of the dropped link
name-- name string of the dropped link
links-- array of the dropped items with nsIDroppedLinkItem interface
. More precisely: The document loaded into a chrome window is always of chrome type. Subdocuments of chrome documents are of chrome type, unless the container element (one of iframe, browser or editor) has one of the special type attribute values (the common ones are content, content-targetable and content-primary) indicating that the subdocument is of content type. This boundary has a number of special effects, such as making window.top == window (unless the
is added to a chrome document), and preventing documents from inheriting the principal of the parent document. The type attribute on all frames in content documents is ignored; subdocuments of content documents are always content documents.
element in an application, which will use multiple browsers of equal privileges, and is unselected at the moment.
trueif there is a page to go back to in the session history and the Back button should be enabled.
trueif there is a page to go forward to in the session history and the Forward button should be enabled.
documentCharsetInfoObsolete since Gecko 12.0
nsIDocumentCharsetInfoobject for the document which is used to handle which character set should be used to display the document. The properties of the
nsIDocumentCharsetInfoobject were merged into the docshell in Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9).
addProgressListener( listener )
gotoIndex( index )
NOTE: This is the XUL method on <browser> / <tabbrowser>, not the global function in chrome://browser/content/browser.js. Please check which one you're documenting! (This one has no post data parameter, see loadURIWithFlags for a version that does)
loadURI( uri, referrer, charset )
nsIURIobject. To get a string from an
loadURIWithFlags( uri, flags, referrer, charset, postData )
reloadWithFlagsmethod, the following flags are also valid:
LOAD_FLAGS_IS_REFRESH: This flag is used when the URL is loaded because of a meta tag refresh or redirect.
LOAD_FLAGS_IS_LINK: This flag is used when the URL is loaded because a user clicked on a link. The HTTP Referer header is set accordingly.
LOAD_FLAGS_BYPASS_HISTORY: Do not add the URL to the session history.
LOAD_FLAGS_REPLACE_HISTORY: Replace the current URL in the session history with a new one. This flag might be used for a redirect.
nsIWebNavigation.loadURI() for details on the
browserelement on which you call this method.
reloadWithFlags( flags )
webNavigationproperty (or the
nsIWebNavigationinterface). You may combine flags using a or symbol (
LOAD_FLAGS_NONE: No special flags. The document is loaded normally.
LOAD_FLAGS_BYPASS_CACHE: Reload the page, ignoring if it is already in the cache. This is the flag used when the reload button is pressed while the Shift key is held down.
LOAD_FLAGS_BYPASS_PROXY: Reload the page, ignoring the proxy server.
LOAD_FLAGS_CHARSET_CHANGE: This flag is used if the document needs to be reloaded because the character set changed.
removeProgressListener( listener )
nsIWebProgressListenerfrom the browser.
swapDocShells( otherBrowser )
browserwith another browser. During the swap, pagehide and pageshow events are fired on both browsers. This method can be used to move browser between windows or tear off a browser into a new window.
Note: Both browsers must be either standalone browsers or embedded in a
tabbrowser. You can't mix them.