This element is used for holding a set of read-only views of Web documents. It is similar to the browser
element, except that multiple documents can be displayed, each in a separate tab.
Note: Starting in Firefox 3 (XULRunner/Gecko 1.9), this is only used in the main Firefox window and cannot be used in other XUL windows by third-party applications or extensions.
autocompleteenabled
true
to enable autocomplete of fields.autocompletepopup
id
of a popup
element used to hold autocomplete results for the element.autoscroll
false
to disable autoscroll for this browser. If this attribute is set to true
or omitted, autoscroll will be enabled or depending on the user preference general.autoScroll
.contenttooltip
id
of a tooltip
element to be used for the content area in the tabbrowser
.onbookmarkgroup
onnewtab
tabmodalPromptShowing
browsers
browser
elementsbrowser
elements inside the tabbrowser
.canGoBack
true
if there is a page to go back to in the session history and the Back button should be enabled.canGoForward
true
if there is a page to go forward to in the session history and the Forward button should be enabled.contentDocument
contentTitle
contentViewerEdit
nsIContentViewerEdit
nsIContentViewerEdit
which handles clipboard operations on the document.contentViewerFile
nsIContentViewerFile
nsIContentViewerFile
interface for the document.contentWindow
currentURI
nsIURI
loadURI
method.docShell
nsIDocShell
nsIDocShell
object for the document.documentCharsetInfo
Obsolete since Gecko 12.0nsIDocumentCharsetInfo
nsIDocumentCharsetInfo
object for the document which is used to handle which character set should be used to display the document. The properties of the nsIDocumentCharsetInfo
object were merged into the docshell in Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9).homePage
markupDocumentViewer
nsIMarkupDocumentViewer
nsIMarkupDocumentViewer
which is responsible for drawing the document.securityUI
nsISecureBrowserUI
selectedBrowser
browser
elementbrowser
element.selectedTab
tab
elements in the tabs
element. Assign a value to this property to modify the currently selected tab.sessionHistory
nsISHistory
nsISHistory
object which holds the session history.tabContainer
tabs
elementtabs
element that contains the tabs. This is useful for add-ons that need to use events related to tabs in the browser window.tabs
tab
objects for each tab in the tabbrowser
. This is a shortcut for looking at the tabs in the tabContainer
.visibleTabs
tab
objects for each visible tab in the tabbrowser
. This lets you determine which tabs are visible in the current tab set.webBrowserFind
nsIWebBrowserFind
nsIWebBrowserFind
object which can be used to search for text in the document.webProgress
nsIWebProgress
nsIWebProgress
object which is used to monitor the progress of a document loading.addProgressListener( listener )
nsIWebProgressListener
interface.addTab( URL, referrerURI, charset, postData, owner, allowThirdPartyFixup )
addTab( URL, {referrerURI: ..., charset: ..., postData: ..., owner: ..., allowThirdPartyFixup: ..., relatedToCurrent: ... })
tab
elementThe second form of this method was added in Firefox 3.6; it allows you to specify the parameters by name, in any order. It also adds the relatedToCurrent parameter; Firefox uses this to decide whether the new tab should be inserted next to the current tab.
addTabsProgressListener( listener )
nsIWebProgressListener
interface with an additional "browser" argument as the first argument of every method, which is the browser
(not <tabbrowser> = gBrowser) where the event occurred. See Listening to events on all tabs for details.appendGroup( group )
URI
property for the URL of the page to load. A referrerURI
property may also be optionally used to set the referrer page.getBrowserAtIndex( index )
browser
elementbrowser
at the specified tab index.getBrowserIndexForDocument( document )
browser
for the specified document in the tabbrowser
the method was invoked on. The returned index is dependent on the tab
s in the tabbrowser
and is invalidated when the tab ordering changes. It should not be used to track per-tab data during a session; the use of linkedpanel
on the corresponding tab is preferred instead.getBrowserForDocument( document )
browser
elementbrowser
for the specified document.
getBrowserForTab( tab )
browser
elementbrowser
for the specified tab
element.getIcon( aTab )
aTab
is null, the current tab's icon is returned. See setIcon
to set the icon.getNotificationBox( browser )
notificationbox
elementnotificationbox
for the specified browser
element.getTabForBrowser( browser )
tab
tab
which contains the specified browser
.getTabModalPromptBox( browser )
promptBox
object representing the new prompt.goBack()
goBackGroup()
goForward()
goForwardGroup()
goHome()
gotoIndex( index )
loadGroup( group )
browser.tabs.loadGroup
. The argument should be an array of objects, one for each document to load. The objects may be defined in script and contain a URI
property for the URL of the page to load. A referrerURI
property may also be optionally used to set the referrer page. This function returns a reference to the first tab loaded.loadOneTab( URL, referrerURI, charset, postData, loadInBackground, allowThirdPartyFixup )
loadOneTab( URL, { referrerURI: ..., charset: ..., postData: ..., inBackground: ..., allowThirdPartyFixup: ..., relatedToCurrent: ... })
tab
elementURL
. The rest of the parameters are optional. This method works the same as addTab
except for the loadInBackground
parameter which allows you to choose whether to open the new tab in foreground or background. There's also no owner
parameter as the owner tab is specified automatically.inBackground
browser.tabs.loadInBackground
preference.The second form of this method was added in Firefox 3.6; it adds the relatedToCurrent parameter, and allows the parameters to be specified by name, in any order.
loadTabs( uris, loadInBackground, replace )
loadTabs( uris, params )
uris
, into tabs. If loadInBackground
is true
, the tabs are loaded in the background, and if replace
is true
, the currently displayed tabs are replaced with the specified URIs instead of adding new tabs. The properties of params
are following:
boolean inBackground
boolean replace
boolean allowThirdPartyFixup
tab targetTab
number newIndex
object postDatas
number userContextId
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 )
nsIURI
object. To get a string from an nsIURI
, use nsIURI.spec
or nsIURI.asciiSpec
loadURIWithFlags( uri, flags, referrer, charset, postData )
reloadWithFlags
method, 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.(See nsIWebNavigation.loadURI()
for details on the referrer
and postData
parameters.)
moveTabTo(tab, index)
tab
elementpinTab( tabElement )
tab
element as an app tab.reload()
browser
element on which you call this method.reloadAllTabs()
reloadTab( tab )
reloadWithFlags( flags )
webNavigation
property (or the nsIWebNavigation
interface). 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.removeAllTabsBut( tabElement )
removeCurrentTab()
tab
elementremoveProgressListener( listener )
nsIWebProgressListener
from the browser.removeTab( tabElement )
tab
element. If only one tab is displayed, this method does nothing (unless the preference browser.tabs.closeWindowWithLastTab
is true
, in which case the window containing the tab is closed). If browser.tabs.autoHide
is true
, the row of tabs will collapse if only one tab remains.removeTabsProgressListener( listener )
nsIWebProgressListener
interface.replaceGroup( group )
removeTab
method to remove the existing tabs first if that is desired. The argument should be an array of objects, one for each document to load. The objects may be defined in script and contain a URI
property for the URL of the page to load. A referrerURI
property may also be optionally used to set the referrer page. This method returns an array of the session history objects for the tabs that were removed.selectTabAtIndex( index, event )
setIcon( aTab, aURI )
getIcon
to get the current icon.showOnlyTheseTabs( aTabs )
aTabs
array visible, and all other tabs hidden.stop()
unpinTab( tabElement )
tab
element, making it no longer an app tab.