FF 58 - Auothide last tab

User Help for Mozilla Firefox
ejm_dc
Posts: 70
Joined: December 20th, 2003, 4:12 pm

Re: FF 58 - Auothide last tab

Post by ejm_dc »

Hi,

Thanks so much for asking. FF looks like this (with tabs and then without, but with the gray bar that shows up):

Image

The gray bar is the height of the tab bar.

I've been using https://github.com/Aris-t2/CustomCSSforFx to move the tab bar below, with the following my_userChrome.css to call your code. I haven't changed anything other than the version of FF and the version of CustomCSSforFX that works with FF65.

Code: Select all

#editBMPanel_rows > #editBMPanel_locationRow[collapsed="true"] {
  visibility: visible !important;
}

menupopup > menu, popup > menu, menuitem { 
	color: #000 !important; 
	background-color: #e3e3e3 !important;
	min-height: 2em !important;
}

#personal-bookmarks {
	border-bottom: 1px solid #dedede !important;
}

toolbarbutton#alltabs-button {
  -moz-binding: url(userChrome.xml#execute_javascript_code);
}

#PersonalToolbar .bookmark-item {
  padding-right: 7px !important;
}
Thanks for any help!!!
Last edited by ejm_dc on March 8th, 2019, 8:37 pm, edited 1 time in total.
wright76878
Posts: 716
Joined: July 9th, 2004, 8:05 am

Re: FF 58 - Auothide last tab

Post by wright76878 »

tab bar below address Bar:

/* Modify to change window drag space width */
:root[tabsintitlebar="true"] #nav-bar{ --window-drag-space-width: 24px }

.titlebar-buttonbox-container{
position: fixed;top:0;right:0;height: 40px;}

#toolbar-menubar[inactive] > .titlebar-buttonbox-container{ opacity: 0 }

:root[sizemode="maximized"] > #navigator-toolbox{ padding-top: 8px !important; }
:root[sizemode="maximized"] .titlebar-buttonbox-container{ top: 8px }

:root[uidensity="compact"] .titlebar-buttonbox-container{ height: 32px }
.titlebar-buttonbox-container > .titlebar-buttonbox{ height: 100%; }

#titlebar{-moz-box-ordinal-group: 2;-moz-appearance: none !important;}

:root[tabsintitlebar="true"] #nav-bar{
padding-right: calc(138px + var(--window-drag-space-width,0px));
padding-left: var(--window-drag-space-width,0px)}

.titlebar-placeholder,#TabsToolbar .titlebar-spacer{ display: none; }

/* Also hide the toolbox bottom border which isn't at bottom with this setup */
#navigator-toolbox::after{ display: none !important; }
ejm_dc
Posts: 70
Joined: December 20th, 2003, 4:12 pm

Re: FF 58 - Auothide last tab

Post by ejm_dc »

wright76878 wrote:tab bar below address Bar:

/* Modify to change window drag space width */
:root[tabsintitlebar="true"] #nav-bar{ --window-drag-space-width: 24px }

.titlebar-buttonbox-container{
position: fixed;top:0;right:0;height: 40px;}

#toolbar-menubar[inactive] > .titlebar-buttonbox-container{ opacity: 0 }

:root[sizemode="maximized"] > #navigator-toolbox{ padding-top: 8px !important; }
:root[sizemode="maximized"] .titlebar-buttonbox-container{ top: 8px }

:root[uidensity="compact"] .titlebar-buttonbox-container{ height: 32px }
.titlebar-buttonbox-container > .titlebar-buttonbox{ height: 100%; }

#titlebar{-moz-box-ordinal-group: 2;-moz-appearance: none !important;}

:root[tabsintitlebar="true"] #nav-bar{
padding-right: calc(138px + var(--window-drag-space-width,0px));
padding-left: var(--window-drag-space-width,0px)}

.titlebar-placeholder,#TabsToolbar .titlebar-spacer{ display: none; }

/* Also hide the toolbox bottom border which isn't at bottom with this setup */
#navigator-toolbox::after{ display: none !important; }
Sorry to be dense, but are you saying I should do the tabs below the addressbar with the code above instead of CustomCSSfroFX or that this will fix the gray bar? If so, do you just put this in your userChrome.css? Sorry for not understanding.
aborix
Posts: 29
Joined: October 23rd, 2017, 1:23 pm

Re: FF 58 - Auothide last tab

Post by aborix »

Make this test:

Put the code from wright76878 into the userChrome.css and don't use CustomCSSforFX to get the tabbar below. Also replace the userChrome.xml by this one:

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 navToolbox = document.getElementById("navigator-toolbox");
            let menubar = document.getElementById("toolbar-menubar");
            let tabbar = document.getElementById("TabsToolbar");  
            navToolbox.insertBefore(menubar, navToolbox.firstChild);            
            function showHideTabbar() {
              tabbar.style.visibility = (gBrowser.visibleTabs.length == 1) ? 'collapse' : '';
            };
            showHideTabbar();
            let observer = new MutationObserver(showHideTabbar);
            observer.observe(gBrowser.tabContainer, {childList: true});
          })();

        ]]>
      </constructor>
    </implementation>
  </binding>
</bindings>
ejm_dc
Posts: 70
Joined: December 20th, 2003, 4:12 pm

Re: FF 58 - Auothide last tab

Post by ejm_dc »

I just wanted to say thank you to aborix, who has managed to solve this problem every time, and wright76878 for helping out as well. This solution works really well. I can't thank you both enough. You two are awesome!
ejm_dc
Posts: 70
Joined: December 20th, 2003, 4:12 pm

Re: FF 58 - Auothide last tab

Post by ejm_dc »

So, once again, a FF update has messed this up. Any chance of a fix for Firefox 68.0?

With the two code options supplied above, the menubar is now also below the bookmarks bar and it no longer removes the tabs if there is a single tab opened.

Many thanks in advance.

Eddie
ejm_dc
Posts: 70
Joined: December 20th, 2003, 4:12 pm

Re: FF 58 - Auothide last tab

Post by ejm_dc »

Just bumping this up to see if anyone might have an idea about how to fix the code removing the last tab and moving the tabs under the bookmark bar (without also moving the menu under as well). FF68 breaks both of these things.
kerft
Posts: 585
Joined: January 30th, 2019, 9:38 am

Re: FF 58 - Auothide last tab

Post by kerft »

Some talk about CSS is here - https://www.reddit.com/r/FirefoxCSS/ you'll have to start from the beginning and post the code that isn't working, tell everything it is meant to do and where you got it from. A screenshot of how you want it to look, from your old browser if you have such available might also help.
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: FF 58 - Auothide last tab

Post by morat »

I noticed a problem with the userChrome.xml code by aborix in Firefox 68.

Code: Select all

- <binding id="execute_javascript_code" extends="chrome://global/content/bindings/toolbarbutton.xml#menu">
+ <binding id="execute_javascript_code" extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-badged">
Firefox Quantum compatible userChrome.js
http://github.com/Sporif/firefox-quantum-userchromejs

Fix for Firefox 68
http://github.com/Sporif/firefox-quantu ... 135e3c284a

Fix for Firefox 69
https://github.com/Sporif/firefox-quant ... 135e3c284a
ejm_dc
Posts: 70
Joined: December 20th, 2003, 4:12 pm

Re: FF 58 - Auothide last tab

Post by ejm_dc »

morat wrote:I noticed a problem with the userChrome.xml code by aborix in Firefox 68.

Code: Select all

- <binding id="execute_javascript_code" extends="chrome://global/content/bindings/toolbarbutton.xml#menu">
+ <binding id="execute_javascript_code" extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-badged">
Oh, Perfect! That worked perfectly! Thank you so much. I can't tell you how much I appreciate the help and goodwill of this community. It makes FF so much more a pleasure to use.

Thanks again.
ejm_dc
Posts: 70
Joined: December 20th, 2003, 4:12 pm

Re: FF 58 - Auothide last tab

Post by ejm_dc »

Argh! So, it's broken again in FF69. Same code, but now it's back to the behavior in FF68 before the fix from Morat. Any ideas?

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#toolbarbutton-badged">
    <implementation>
      <constructor>
        <![CDATA[

          (function() {
            if (window.ucjsExecuted)
              return;
            ucjsExecuted = true;           
            let navToolbox = document.getElementById("navigator-toolbox");
            let menubar = document.getElementById("toolbar-menubar");
            let tabbar = document.getElementById("TabsToolbar"); 
            navToolbox.insertBefore(menubar, navToolbox.firstChild);           
            function showHideTabbar() {
              tabbar.style.visibility = (gBrowser.visibleTabs.length == 1) ? 'collapse' : '';
            };
            showHideTabbar();
            let observer = new MutationObserver(showHideTabbar);
            observer.observe(gBrowser.tabContainer, {childList: true});
          })();

        ]]>
      </constructor>
    </implementation>
  </binding>
</bindings>
wright76878
Posts: 716
Joined: July 9th, 2004, 8:05 am

Re: FF 58 - Auothide last tab

Post by wright76878 »

Think I'll stay with Palemoon a while until someone figures things out. Also can't auto-open bookmarks sidebar in FF either.
morat
Posts: 6404
Joined: February 3rd, 2009, 6:29 pm

Re: FF 58 - Auothide last tab

Post by morat »

@ejm_dc

You need to set the toolkit.legacyUserProfileCustomizations.stylesheets pref to true to use the userChrome.css file.

You need to change the following line in the userChrome.xml file.

Code: Select all

- <binding id="execute_javascript_code" extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-badged">
+ <binding id="execute_javascript_code">
The observer is not working in the userChrome.xml file. I don't know why.

MutationObserver
http://developer.mozilla.org/docs/Web/A ... onObserver
http://developer.mozilla.org/docs/Web/A ... er/observe
ejm_dc
Posts: 70
Joined: December 20th, 2003, 4:12 pm

Re: FF 58 - Auothide last tab

Post by ejm_dc »

Wow! Brilliant! I can't tell you again how much I appreciate the help and support. Absolutely brilliant! Thank you!!!
ejm_dc
Posts: 70
Joined: December 20th, 2003, 4:12 pm

Re: FF 58 - Auothide last tab

Post by ejm_dc »

So, I thought that worked but it looks like no tabs show now. They're all hidden. Any thoughts on how that might be fixed?
Locked