Try this:
* userChrome.xml
Code: Select all
<?xml version="1.0"?>
<!-- autohide last tab -->
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="execute_javascript_code">
<implementation>
<constructor><![CDATA[
(function () {
if (window.ucjsExecuted) return;
window.ucjsExecuted = true;
var navToolbox = document.getElementById("navigator-toolbox");
var menubar = document.getElementById("toolbar-menubar");
var tabbar = document.getElementById("TabsToolbar");
navToolbox.insertBefore(menubar, navToolbox.firstChild);
function showHideTabbar() {
tabbar.style.visibility = (gBrowser.visibleTabs.length == 1) ? "collapse" : "";
}
showHideTabbar();
function tabOpened() { showHideTabbar(); }
function tabMoved() { showHideTabbar(); }
function tabClosed() { showHideTabbar(); }
gBrowser.tabContainer.addEventListener("TabOpen", tabOpened, false);
gBrowser.tabContainer.addEventListener("TabMove", tabMoved, false);
gBrowser.tabContainer.addEventListener("TabClose", tabClosed, false);
})();
]]></constructor>
</implementation>
</binding>
</bindings>
I don't understand the reason for the following line.
Code: Select all
navToolbox.insertBefore(menubar, navToolbox.firstChild);
Maybe it works with a CustomCSSforFX tweak?
Notification when a tab is added or removed
http://developer.mozilla.org/docs/Archi ... or_removed