%tabBrowserDTD; ]> Components.classes['@mozilla.org/preferences-service;1'] .getService(Components.interfaces.nsIPrefService) .getBranch(null); Components.classes["@mozilla.org/docshell/urifixup;1"] .getService(Components.interfaces.nsIURIFixup); document.getAnonymousNodes(this)[1] this.mTabBox.firstChild this.mStrip.childNodes[2] this.mTabBox.childNodes[1] document.getAnonymousNodes(this)[0] null null null new Array() new Array() false false null null 0) this.mTab.setAttribute("progress", Math.floor(aCurTotalProgress * 9.9 / aMaxTotalProgress)); if (!this.mBlank && this.mTabBrowser.mCurrentTab == this.mTab) { for (var i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) { var p = this.mTabBrowser.mProgressListeners[i]; if (p) p.onProgressChange(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress); } } }, onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus) { if (!aRequest) return; var oldBlank = this.mBlank; const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; const nsIChannel = Components.interfaces.nsIChannel; if (aStateFlags & nsIWebProgressListener.STATE_START && aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { // It's okay to clear what the user typed when we start // loading a document. If the user types, this flag gets // set to false, if the document load ends without an // onLocationChange, this flag also gets set to false // (so we keep it while switching tabs after failed load if (aWebProgress.DOMWindow == this.mBrowser.contentWindow) this.mBrowser.userTypedClear++; if (!this.mBlank) { this.mTab.removeAttribute("progress"); this.mTab.setAttribute("busy", "true"); this.mTab.label = this.mTabBrowser.mStringBundle.getString("tabs.loading"); this.mTab.removeAttribute("image"); this.mIcon = ""; if (this.mTabBrowser.mCurrentTab == this.mTab) this.mTabBrowser.mIsBusy = true; } } else if (aStateFlags & nsIWebProgressListener.STATE_STOP && aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) { // The document is done loading, it's okay to clear // the value again. if (aWebProgress.DOMWindow == this.mBrowser.contentWindow) if (this.mBrowser.userTypedClear > 0) this.mBrowser.userTypedClear--; if (this.mBlank) this.mBlank = false; this.mTab.removeAttribute("busy"); var location = aRequest.QueryInterface(nsIChannel).URI; if (this.mIcon) { this.mTab.setAttribute("image", this.mIcon); this.mIcon = ""; } else if (this.mTabBrowser.shouldLoadFavIcon(location)) this.mTabBrowser.loadFavIcon(location, "image", this.mTab); if (this.mTab.label == this.mTabBrowser.mStringBundle.getString("tabs.loading")) this.mTabBrowser.setTabTitle(this.mTab); if (this.mTabBrowser.mCurrentTab == this.mTab) this.mTabBrowser.mIsBusy = false; } if (!oldBlank && this.mTabBrowser.mCurrentTab == this.mTab) { for (var i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) { var p = this.mTabBrowser.mProgressListeners[i]; if (p) p.onStateChange(aWebProgress, aRequest, aStateFlags, aStatus); } } }, // The first location change is gotoIndex called from mInstallSH, // the second one is considered a user action. mLocationChangeCount : 0, onLocationChange : function(aWebProgress, aRequest, aLocation) { if (this.mLocationChangeCount > 0 || aLocation.spec != "about:blank") ++this.mLocationChangeCount; if (this.mLocationChangeCount == 2) { this.mTabBrowser.backBrowserGroup = []; this.mTabBrowser.forwardBrowserGroup = []; } // The document loaded correctly, clear the value if we should if (this.mBrowser.userTypedClear > 0) this.mBrowser.userTypedValue = null; if (!this.mBlank && this.mTabBrowser.mCurrentTab == this.mTab) { for (var i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) { var p = this.mTabBrowser.mProgressListeners[i]; if (p) p.onLocationChange(aWebProgress, aRequest, aLocation); } } }, onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage) { if (this.mBlank) return; if (this.mTabBrowser.mCurrentTab == this.mTab) { for (var i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) { var p = this.mTabBrowser.mProgressListeners[i]; if (p) p.onStatusChange(aWebProgress, aRequest, aStatus, aMessage); } } }, onSecurityChange : function(aWebProgress, aRequest, aState) { if (this.mTabBrowser.mCurrentTab == this.mTab) { for (var i = 0; i < this.mTabBrowser.mProgressListeners.length; i++) { var p = this.mTabBrowser.mProgressListeners[i]; if (p) p.onSecurityChange(aWebProgress, aRequest, aState); } } }, QueryInterface : function(aIID) { if (aIID.equals(Components.interfaces.nsIWebProgressListener) || aIID.equals(Components.interfaces.nsISupportsWeakReference) || aIID.equals(Components.interfaces.nsISupports)) return this; throw Components.results.NS_NOINTERFACE; } }); ]]> return !this.mStrip.collapsed; 0) { // Use the filter hooked up in our addProgressListener filter = this.mTabFilters[0]; } else { // create a filter and hook it up to our first browser filter = Components.classes["@mozilla.org/appshell/component/browser-status-filter;1"] .createInstance(Components.interfaces.nsIWebProgress); this.mTabFilters[0] = filter; this.mCurrentBrowser.webProgress.addProgressListener(filter, Components.interfaces.nsIWebProgress.NOTIFY_ALL); } // Remove all our progress listeners from the active browser's filter. if (this.mProgressListeners) { for (var i = 0; i < this.mProgressListeners.length; i++) { var p = this.mProgressListeners[i]; if (p) filter.removeProgressListener(p); } } // Wire up a progress listener to our filter. const listener = this.mTabProgressListener(this.mCurrentTab, this.mCurrentBrowser, false); filter.addProgressListener(listener, Components.interfaces.nsIWebProgress.NOTIFY_ALL); this.mTabListeners[0] = listener; ]]> 1) { const closeOtherTabsPref = "browser.tabs.warnOnCloseOther"; var shouldPrompt = this.mPrefs.getBoolPref(closeOtherTabsPref); var reallyClose = true; if (shouldPrompt) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); //default to true: if it were false, we wouldn't get this far var warnOnClose = { value:true }; var bundle = this.mStringBundle; var tabsToClose = numTabs - 1; //number of tabs to be removed var buttonPressed = promptService.confirmEx(window, bundle.getString('tabs.closeWarningTitle'), bundle.getFormattedString("tabs.closeWarning", [tabsToClose]), (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1), bundle.getString('tabs.closeButton'), null, null, bundle.getString('tabs.closeWarningPromptMe'), warnOnClose); reallyClose = (buttonPressed == 0); //don't set the pref unless they press OK and it's false if (reallyClose && !warnOnClose.value) this.mPrefs.setBoolPref(closeOtherTabsPref, false); } if (reallyClose) { if (aTab.localName != "tab") aTab = this.mCurrentTab; else this.mTabContainer.selectedItem = aTab; var childNodes = this.mTabContainer.childNodes; for (var i = childNodes.length - 1; i >= 0; --i) { if (childNodes[i] != aTab) this.removeTab(childNodes[i]); } } } ]]> index) newIndex = currentIndex-1; else if (currentIndex < index) newIndex = currentIndex; else if (index == l - 1) newIndex = index-1; else newIndex = index; var oldTab = aTab; // clean up the before/afterselected attributes before removing the tab oldTab.selected = false; this.mTabContainer.removeChild(oldTab); this.mPanelContainer.removeChild(oldBrowser); // When the current tab is removed select a new tab // and fire select events on tabpanels and tabs this.mTabContainer.selectedIndex = newIndex; // When removing a tab to the left of the current tab // fix up the panel index without firing any events this.mPanelContainer.selectedIndex = newIndex; ]]> return this.mTabContainer; return this.mTabBox.selectedTab; [] []