How about this userChrome.xml:
Code: Select all
<?xml version="1.0"?>
<bindings id="generalBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="execute_javascript_code" extends="chrome://global/content/bindings/toolbarbutton.xml#menu">
<implementation>
<constructor>
<![CDATA[
(function() {
if (window.ucjsExecuted)
return;
ucjsExecuted = true;
let tabbar = document.getElementById('TabsToolbar');
let placeholder = tabbar.lastChild.cloneNode(true);
document.getElementById('nav-bar').appendChild(placeholder);
function showHideTabbar() {
if (gBrowser.visibleTabs.length == 1) {
tabbar.style.visibility = 'collapse';
placeholder.style.display = '';
} else {
tabbar.style.visibility = '';
placeholder.style.display = 'none;
};
};
showHideTabbar();
let observer = new MutationObserver(showHideTabbar);
observer.observe(document.getElementById('tabbrowser-tabs'), {childList: true});
})();
]]>
</constructor>
</implementation>
</binding>
</bindings>