%tabBrowserDTD; %globalDTD; ]> 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.getAnonymousElementByAttribute(this, "anonid", "tabbox"); this.mTabBox.childNodes[0] document.getAnonymousElementByAttribute(this, "anonid", "strip"); document.getAnonymousElementByAttribute(this, "anonid", "tabcontainer"); document.getAnonymousElementByAttribute(this, "anonid", "panelcontainer"); this.mTabContainer.childNodes document.getAnonymousElementByAttribute(this, "anonid", "tbstringbundle"); null null [] new Array() new Array() false false null null false #ifdef XP_MACOSX true #else false #endif false 0) this.mBrowser.userTypedClear--; if (!this.mBrowser.mIconURL) this.mTabBrowser.useDefaultIcon(this.mTab); } if (this.mBlank) this.mBlank = false; this.mTab.removeAttribute("busy"); this.mTabBrowser.updateIcon(this.mTab); var location = aRequest.QueryInterface(nsIChannel).URI; // For keyword URIs clear the user typed value since they will be changed into real URIs if (location.scheme == "keyword") this.mBrowser.userTypedValue = null; 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); } } if (aStateFlags & (nsIWebProgressListener.STATE_START | nsIWebProgressListener.STATE_STOP)) { // reset cached temporary values at beginning and end this.mMessage = ""; this.mTotalProgress = 0; } this.mStateFlags = aStateFlags; this.mStatus = aStatus; }, onLocationChange : function(aWebProgress, aRequest, aLocation) { // The document loaded correctly, clear the value if we should if (this.mBrowser.userTypedClear > 0 && aRequest) this.mBrowser.userTypedValue = null; if (aWebProgress.DOMWindow == this.mBrowser.contentWindow && aWebProgress.isLoadingDocument) this.mTabBrowser.setIcon(this.mTab, 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); } } this.mMessage = 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; } }); ]]> sz || req.image.height > sz) return; this.setIcon(aTab, browser.currentURI.spec); } catch (e) { } } } else if (this.shouldLoadFavIcon(browser.currentURI)) { var url = browser.currentURI.prePath + "/favicon.ico"; if (!this.isIconKnownMissing(url)) this.setIcon(aTab, url); } ]]> 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. 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 false/true NO var owner = (aURIs.length > 1) || aLoadInBackground ? null : gBrowser.selectedTab; var firstTabAdded = null; if (aReplace) this.loadURI(aURIs[0], null, null); else firstTabAdded = gBrowser.addTab(aURIs[0], null, null, null, owner); for (var i = 1; i < aURIs.length; ++i) gBrowser.addTab(aURIs[i]); if (!aLoadInBackground) { if (firstTabAdded) { // .selectedTab setter focuses the content area this.selectedTab = firstTabAdded; } else window.content.focus(); } ]]> = 0; --i) { if (childNodes[i] != aTab) this.removeTab(childNodes[i]); } } } ]]> index) newIndex = currentIndex-1; else if (currentIndex < index) newIndex = currentIndex; else { if ("owner" in oldTab && oldTab.owner && this.mPrefs.getBoolPref("browser.tabs.selectOwnerOnClose")) { for (i = 0; i < this.mTabContainer.childNodes.length; ++i) { tab = this.mTabContainer.childNodes[i]; if (tab == oldTab.owner) { newIndex = i; break; } } } if (newIndex == -1) newIndex = (index == l - 1) ? index - 1 : index; } // Select the new tab this.selectedTab = this.mTabContainer.childNodes[newIndex]; for (i = oldTab._tPos; i < this.mTabContainer.childNodes.length; i++) { this.mTabContainer.childNodes[i]._tPos = i; } this.mTabBox.selectedPanel = this.getBrowserForTab(this.mCurrentTab).parentNode; this.mCurrentTab.selected = true; this.updateCurrentBrowser(); // see comment above destroy above oldBrowser.focusedWindow = null; oldBrowser.focusedElement = null; } ]]> aEvent.originalTarget.localName == "spacer") { var e = document.createEvent("Events"); e.initEvent("NewTab", true, true); this.dispatchEvent(e); } ]]> return this.mTabContainer; return this.mTabBox.selectedTab; ' + aEvent.target.label + ''); } else { aXferData.data.addDataForFlavour("text/unicode", "about:blank"); } } ]]> oldIndex) newIndex--; if (newIndex != oldIndex) this.moveTabTo(this.mTabs[oldIndex], newIndex); } else { var url = transferUtils.retrieveURLFromData(aXferData.data, aXferData.flavour.contentType); // valid urls don't contain spaces ' '; if we have a space it isn't a valid url. // Also disallow dropping javascript: or data: urls--bail out if (!url || !url.length || url.indexOf(" ", 0) != -1 || /^\s*(javascript|data):/.test(url)) return; this.dragDropSecurityCheck(aEvent, aDragSession, url); var bgLoad = true; try { bgLoad = this.mPrefs.getBoolPref("browser.tabs.loadInBackground"); } catch (e) { } if (aEvent.shiftKey) bgLoad = !bgLoad; if (document.getBindingParent(aEvent.originalTarget).localName != "tab") { // We're adding a new tab. this.loadOneTab(getShortcutOrURI(url), null, null, null, bgLoad); } else { // Load in an existing tab. var tab = aEvent.target; this.getBrowserForTab(tab).loadURI(getShortcutOrURI(url)); if (this.mCurrentTab != tab && !bgLoad) this.selectedTab = tab; } } ]]> this.mTabs[i].boxObject.x + this.mTabs[i].boxObject.width / 2) return i; } return this.mTabs.length; ]]> 0) { this.moveTabTo(this.mCurrentTab, tabPos - 1); this.mCurrentTab.focus(); } else if (this.arrowKeysShouldWrap) this.moveTabToEnd(); ]]> 0) { this.moveTabTo(this.mCurrentTab, 0); this.mCurrentTab.focus(); } ]]> null var pb2 = Components.classes['@mozilla.org/preferences-service;1']. getService(Components.interfaces.nsIPrefBranch2); try { this.mTabClipWidth = pb2.getIntPref("browser.tabs.tabClipWidth"); } catch (e) { } this._updateDisableBackgroundClose(); pb2.addObserver("browser.tabs.disableBackgroundClose", this, false); var self = this; function onResize() { self.adjustCloseButtons(1); } window.addEventListener("resize", onResize, false); var pb2 = Components.classes["@mozilla.org/preferences-service;1"]. getService(Components.interfaces.nsIPrefBranch2); pb2.removeObserver("browser.tabs.disableBackgroundClose", this); 140 this.mTabClipWidth || width == 0) this.removeAttribute("tiny"); else this.setAttribute("tiny", "true"); } catch (e) { } ]]> false var anonid = event.originalTarget.getAttribute("anonid"); if (anonid == "close-button") this.mOverCloseButton = true; var anonid = event.originalTarget.getAttribute("anonid"); if (anonid == "close-button") this.mOverCloseButton = false;