49

How can I have multiple rows with tabs on Firefox 57+, after the add-on Tab Mix Plus no-longer works (all legacy extensions are dropped with Firefox 57). Perhaps I should just wait?

This is perhaps the only functionality which I couldn't find in Opera or Chrome (and Chrome has some privacy issues), the last time I tested them. So it seems I have a few options, not just a single one.

  1. As suggested in this thread, I can downgrade to FF 52 ESR (with possible issues...) or use a nightly build...

  2. Another possible option is to use a [FF Current Profile Folder]/chrome/userChrome.css file (folder may need to be created), where I can place some code. Here is what I tested under FF 57, using 500+ tabs:

(EDIT 1: Added few css rules to hide some spaces/buttons, similar to the R4zen's answer, as mine contain one more rule and is perhaps more complete... but the result could be the same for most people! I had this code tested when I posted the question, but decided to post less code for easier understanding of what is happening. Now I am posting my full code, so others can benefit from it.)

#tabbrowser-tabs .scrollbutton-up,
#tabbrowser-tabs .scrollbutton-down,
#tabbrowser-tabs .arrowscrollbox-overflow-start-indicator,
#tabbrowser-tabs .arrowscrollbox-overflow-end-indicator,
#tabbrowser-tabs #alltabs-button {
    display: none;
}
#tabbrowser-tabs .tabbrowser-arrowscrollbox,
#tabbrowser-tabs .arrowscrollbox-scrollbox {
    display: block;
}
#tabbrowser-tabs .arrowscrollbox-scrollbox .scrollbox-innerbox {
    display: flex;
    flex-wrap: wrap;
    /*
    display: block;
    */
    overflow-y: auto !important;
    min-height: var(--tab-min-height); /* default */
    max-height: calc(5*var(--tab-min-height)) !important;
}
    #tabbrowser-tabs .tabbrowser-tab {
        flex-grow: 1;
        flex-wrap:wrap;
        min-width: 150px;
        vertical-align: bottom !important;
    }
    #tabbrowser-tabs .tabbrowser-tab,
    #tabbrowser-tabs .tabbrowser-tab .tab-stack .tab-background {
        height: var(--tab-min-height);
    }
        #tabbrowser-tabs .tabbrowser-tab .tab-stack {
            width: 100%;
        }
    #tabbrowser-tabs .tabbrowser-tab[pinned] {
        min-width: 0px;
        max-width: 40px;
    }
        #tabbrowser-tabs .tabbrowser-tab[pinned] .tab-icon-image:not([src]) {
            visibility: hidden !important;
        }
        #tabbrowser-tabs .tabbrowser-tab[pinned] .tab-text {
            display: none !important;
        }
    /* Active tab's style - visuallyselected="true" === ACTIVE TAB */
    #tabbrowser-tabs .tabbrowser-tab[visuallyselected="true"] {
        font-weight: bold;
    }
    #tabbrowser-tabs .tabbrowser-tab[visuallyselected="true"] .tab-background {
        background-color: lime !important; /* green, lime, LawnGreen-7CFC00, LimeGreen-32CD32, SpringGreen-00FF7F */
    }
  • Where 5 in max-height: calc(5*var(--tab-min-height)) !important; are 5 rows, dynamically calculated height.

The above code shows tabs, but their behavior is quite bad:

  • the worst thing - when you scroll between the tabs using Ctrl+Tab (in the last recent order), and the tab switched to is on a different row (5+ rows away), the row with the tab doesn't scroll to the active tab. The slider must be used to manually scroll the rows and visually find the selected one... (To clarify: I have set 5 visible rows out of 15 rows total)
  • tabs can't be dragged as FF core calculates it incorrectly and moves the tab to a random position

    1. To use a fork of the legacy code, someone mentioned WaterFox (or another fork).

Are there any other (better) solutions as of today?

I'm pretty sure we'll have more options in the future, so the correct answer today may not be the best after a week or month(s)...

EDIT April 2019 (Firefox 66.x): After updating to Firefox 66, I had too many rows covering entire screen (that's 1000+ tabs). I needed to edit the original code above and added a few extra rules:

#tabbrowser-tabs .arrowscrollbox-scrollbox {
    max-height: calc(5*var(--tab-min-height)) !important;
    overflow: auto;
    margin-bottom: calc(1.25 * var(--tab-min-height)) !important;
}

You may need to adjust them for you, in case you have different rows number (I have 5 rows with tabs). Good luck!

Traveler
  • 213
  • 3
  • 10
Minister
  • 1,198
  • 2
  • 10
  • 18
  • 1
    If you manage to build something please post at https://softwarerecs.stackexchange.com/questions/47196/multiple-tab-rows-for-firefox-57 thanks :-) – Nicolas Raoul Nov 22 '17 at 03:40
  • 1
    @NicolasRaoul, A solution is perhaps under way... at least in the thoughts of some developer... that means, we may need to wait weeks or months... **Personally, I'm chess player..., but I'm not patient on this one!!!** I use Opera under Linux and works very fast, just no multiple rows - same as all other browsers... – Minister Nov 22 '17 at 08:43
  • 1
    I guess I'm not alone in missing TMP's multiple tab rows. I ended up going with Tab Center Redux which can be customized in different ways (none of which is multiple columns). – jrw32982 Nov 28 '17 at 18:47
  • Thanks. Is there a way to support pinned tabs? – AndyTheEntity Dec 06 '17 at 10:59
  • Yes, I had such code, but haven't tested it as I don't use pinned tabs. Could you explain what these are and do you know a way to set them now, when TMP is disabled? If not, then I'll find the code and will update the code above - within 1-2 days max. Then you'll test it and share with us if it works well or not... – Minister Dec 06 '17 at 14:25
  • I updated the code and posted the pinned-tabs code as well as active/selected tab style, which I really need (very useful to distinguish the tabs, especially when the tabs-slider for 5+ rows, doesn't slide to the active tab/row)! Let me know if the pinned tab code works, I haven't tested it, but this code was proposed/improved and combined from multiple places and should work well! – Minister Dec 06 '17 at 16:06
  • Personally, I'm just going to drop FireFox until this is fixed. I'm surprised that this is an issue; I would've expected Mozilla to give developers ample notice of the changes, and for the developers of something as popular as Tab Mix Plus to have gotten it updated in time. – Michael Scheper Jan 16 '18 at 04:34
  • Is there a way to fix tab dragging in FF69? 69 does not support external .js anymore, so the next solution is not valid - at least I do not know how to force 69 to use .js... – RobeN Sep 05 '19 at 17:39

5 Answers5

23

Multirow tab bar with working tab dragging (tested on FF 61):

  1. Download and extract https://luke-baker.github.io/Firefox_chrome.zip
  2. Copy userChrome.xml to your chrome folder.
  3. Add content from userChrome.css to your userChrome.css.
  4. Download MultiRowTabLiteforFx.uc.js to your chrome folder.

Your chrome folder is a folder named chrome located under your user profile, e.g. ~/.mozilla/firefox/g7fa61h3.default/chrome. It does not exist by default, so create it if needed.

UPDATE

userChrome.xml file could now be obtained from Izheil's Quantum-Nox-Firefox-Dark-Full-Theme repo. There are also two versions of MultiRowTab script, for limited and unlimited number of tab rows.

xuhcc
  • 2,400
  • 24
  • 23
  • 2
    Thank you!!! Finally, it's getting closer to "resolved"! I'll make few more tests (and post the working code if necessary) before marking your answer as accepted! – Minister Jul 15 '18 at 04:57
  • After some more tests, I can confirm this solution is working! I have integrated it with some of my custom CSS code to have some personalized settings for me... That fixes the most annoying behavior for dragging the tabs, so finally the FF multirow tabs are usable! Thank you again! – Minister Jul 16 '18 at 05:24
  • @Minister Could you share your changes, sounds like they could be really useful for others too. – Sharken Jul 18 '18 at 08:21
  • Please, give me some time to review and clean up the code and make it ready to publish it! It could be very similar to the code in the answer, but I'm not sure... It took "ages" (months) to have a working solution for these TABS... :-) Remind me again in 7-10 days if not posted yet. Thanks! – Minister Jul 18 '18 at 14:44
  • AArgh, had to refresh FF and didn't have a backup of userChrome :( Great to see this very recent solution to this pressing UI problem! However... cant't get it to work yet. Am I right that `userChrome.xml`, `userChrome.css` and `MultiRowTabLiteforFx.uc.js` should end up in the chrome folder? It's not enough for me... I did restart FF 61.0.1 (32-bit). And what is `userContent.css` for? What am I missing? – Marten Koetsier Jul 18 '18 at 20:02
  • @MartenKoetsier Yes, these files should be in `chrome` folder. You can find more info at https://luke-baker.github.io/ `userContent.css` is not required for multirow tabbar – xuhcc Jul 18 '18 at 21:49
  • Now I see. Your step 4 suggests to download what's behind that link, but that is just some other page. Didn't check... Now I have downloaded the real js and it works. Looks promising! – Marten Koetsier Jul 19 '18 at 06:03
  • MultiRowTabLiteforFx.uc.js link is 404 again. – mmindenhall Feb 01 '19 at 18:06
  • Found new link: https://github.com/Izheil/Quantum-Nox-Firefox-Dark-Full-Theme/raw/master/Tooltips%2C%20Scrollbars%20%26%20Multirow%20tabs/Multirow%20tabs/MultiRowTabLiteforFx.uc.js – mmindenhall Feb 01 '19 at 18:16
  • Thanks. Link updated again (now it includes commit hash). – xuhcc Feb 01 '19 at 18:39
13

I did few modifications, now should be without bugs (even if you pin tabs, move/drag window, scroll between tabs e.t.c.):

#tabbrowser-tabs .tabbrowser-arrowscrollbox,
#tabbrowser-tabs .arrowscrollbox-scrollbox {
    display: block;
}

.scrollbutton-up,
.arrowscrollbox-overflow-start-indicator,
.scrollbutton-down,
.arrowscrollbox-overflow-end-indicator {
    display: none !important;
}

#tabbrowser-tabs .arrowscrollbox-scrollbox .scrollbox-innerbox {
    display: flex;
    flex-wrap: wrap;
    /*
    display: block;
    */
    overflow-y: auto !important;
    min-height: var(--tab-min-height); /* default */
    max-height: calc(5*var(--tab-min-height)) !important;
}
#tabbrowser-tabs .tabbrowser-tab:not([pinned]) {
    flex-grow: 1;
    flex-wrap:wrap;
    min-width: 150px;
    vertical-align: bottom !important;
}
#tabbrowser-tabs .tabbrowser-tab,
#tabbrowser-tabs .tabbrowser-tab .tab-stack .tab-background {
    height: var(--tab-min-height);
}

#tabbrowser-tabs .tabbrowser-tab .tab-stack {
    width: 100%;
}

#titlebar-buttonbox {
    display: block !important;
    vertical-align: top !important;
}

#main-window[tabsintitlebar] #tabbrowser-tabs {
    -moz-window-dragging: no-drag;   
}

If you find the first row of tabs is invisible, open about:config and change the value of browser.tabs.drawInTitlebar from the default value of true to false.

browser.tabs.drawInTitlebar     false

if you want to drag firefox window by clicking on free space of titlebar more than using 5 or more rows just delete code:

#main-window[tabsintitlebar] #tabbrowser-tabs {
    -moz-window-dragging: no-drag;   
}

It's enable to scroll between rows by holding scrollbar when it's more then 5 rows, but on the other hand is disable posibility to drag ff windows by titlebar.(If you don't use more then 5 rows then you can delete it)

Laurent.B
  • 213
  • 2
  • 14
R4zen
  • 131
  • 4
  • 1
    Could you explain what modifications you've made to make this answer useful for other future readers too? – LW001 Nov 19 '17 at 11:35
  • 1
    I've just tested it. (1) Drag-and-drop doesn't work again (the tab was placed randomly - wrong logic, perhaps based on a single-row calculations and offset). (2) Ctrl+Tab also doesn't switch the rows, when I switch from a tab on last row to a tab 6 rows earlier. The only working thing is the visual presentation "multiple rows of tabs", almost the same as mine code (though your code seems a bit better than mine). Thanks for taking your time to try to help! – Minister Nov 19 '17 at 15:18
  • Yea, drag-and-drop is still broken. I just found fix for clicable scroll: `code`#tabbrowser-tabs .tabbrowser-tab .tab-stack { width: 100%; } `code` And I don't see any problems with Ctrl+tab at 6 row, only that you have to scroll down rows to see it. – R4zen Nov 19 '17 at 15:51
  • "only that you have to scroll down rows to see it" - Exactly! That's not good when I have 15 rows and only 5 visible... I understand why it's not working - because haven't set appropriate logic... This is the reason I gave up on this one for few days, then perhaps I'll try the DEV/Nightly build... And about the code you cited - it's in my original code, which means: already tested and not fixing anything on my end... Let's wait more answers... Thank you again! – Minister Nov 19 '17 at 16:02
  • I've just installed this, and I get multiple rows of tabs (great, thanks!), but now if I click on a tab, it doesn't select it (nothing happens at all). I can drag tabs (and dragging a tab selects it), but I'd rather be able to just click on a tab to select it. Any ideas? – psmears Nov 29 '17 at 23:19
  • Actually, cancel that - I've just restarted FF again and it's working fine now... – psmears Nov 29 '17 at 23:33
  • I happened to find this [1] which visually looks great and works with titlebar tabs, however it seems to have issues with dragging tabs to reorder them :( Personally I really like titlebar tabs; maybe this can help. [1] https://github.com/andreicristianpetcu/UserChrome-Tweaks/blob/multi_row_tmp_v57/tabs/multi_row_tabs_firefox_v57.css – thom_nic Dec 07 '17 at 15:15
  • @thom_nic this multi_row_tabs_firefox_v57.css looks good becouse It's not have milisecound window/screen jumping issue when open few first tabs in first row. But i don't understand why he use magrin code: `#main-window[sizemode="maximized"] #TabsToolbar{ margin-left:var(--tab-min-height);`in lew tabs corner when basic FF dosen't have margins. I just deleted it and works well moreover problem with draging is still not possible between rows and it's dosen't have rows limit but for me is not a problem. Thx for tip. – R4zen Dec 11 '17 at 09:15
  • 2
    FireFox 58 breaks - extra scroll bar on right even with two tabs; extra horizontal scroll bar at times (3rd row onwards ?) – Tom Chiverton Jan 24 '18 at 21:37
  • 1
    @Tom Chiverton you mean in multi_row_tabs_firefox_v57.css? – R4zen Jan 29 '18 at 12:19
  • 2
    if yes then just change "." to "#" in two positions at: `.tabbrowser-tabs .scrollbox-innerbox` in to `#tabbrowser-tabs .scrollbox-innerbox` and `.tabbrowser-tabs .arrowscrollbox-scrollbox` in to `#tabbrowser-tabs .arrowscrollbox-scrollbox` and it should work in FF 58. – R4zen Jan 29 '18 at 12:27
  • This is nice, but for me (FF 58) the tab bar is twice the vertical height it should be for only one row, even though the vertical scrollbar and all the tabs are the right size and in the right place. [Screenshot](https://imgur.com/a/EvLIu). – jjc385 Mar 12 '18 at 05:03
2

For those interested in how this CSS UI change works, there is a helpful article on ghacks.net that describes what's being done: https://www.ghacks.net/2017/11/13/customize-firefox-57-with-css/

The article refers to the git hub project "Custom CSS tweaks for Firefox 57+" https://github.com/Aris-t2/CustomCSSforFx That project contains many different UI tweaks that can be mixed and matched. The README file there gives good insight into how to pick and choose among the options.

With regards to whether or not the chrome directory needs to be created:

On the Fedora system I used, that directory did need to be created. On the Mac system, it was already present and contained example files, userChrome-example.css and userContent-example.css.

In the userChrome-example.css file was the following:

/*
 * Do not remove the @namespace line -- it's required for correct functioning
 */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */

Although I needed to set browser.tabs.drawInTitlebar to false, once I did that, R4zen's code worked fine for me both with and without the @namespace line present.

poetnerd
  • 23
  • 3
  • Thank you for taking your time to post your experience! I know the project with many CSS rules, but the answer wasn't there when I tested it (2 weeks ago). I didn't include it in the question as it's unrelated. Perhaps you got negative votes because it's unrelated and don't answer the question, but "it wasn't me" who voted... About the R4zen's code: basically it's what I posted. In fact I intentionally omitted few rules (that was later present in the R4zen's code), so it's shorter and easier to get started with it... ;-) – Minister Nov 25 '17 at 16:52
  • 1
    I would have added my experience as a comment, but I have not built up enough reputation to do so. I have submitted an edit to R4zen's answer explicitly saying that browser.tabs.drawnInTitlebar needs to be changed to false. That one bit of lore is kind of critical, and I've had a tough time getting it associated with this answer. – poetnerd Nov 25 '17 at 17:49
  • I've just checked again... I have `browser.tabs.drawInTitlebar` (not 'drawN...') and it's `false` by default. Started the tabs again with the R4zen's code and 5 rows with tabs has been rendered (5 visible, ~15 total rows). The Ctrl+Tab doesn't switch to the row containing the active tab (when I switch tabs from 5-6 rows difference between them). Which means - I can't see the active tab and surrounding tabs (which are related to the active tab) and I need to manually scroll using the slider. So it still work the same way as mine code - just renders the tabs on multiple rows + annoying behavior. – Minister Nov 26 '17 at 12:13
  • I don't believe CSS-only solution would work for FF57, but may work in next releases! – Minister Nov 26 '17 at 12:23
  • I just got FireFox 58.01, and minister's revised code of 11 December mostly works for me. Issues I have: 1. With 58.01, a fresh start of Firefox with a single tab draws the scroll bar and enough room for two rows of tabs. Neither the scrollbar nor the extra space are necessary. 2. Dragging the scrollbar just moves the window. 3 Dragging tabs to change their positions relative to each other does not produce consistent results. It is as if logic to determine the destination location is using size information that does not match the actual screen size taken up by the tab. Any suggestions? – poetnerd Feb 05 '18 at 20:14
0

Just thought I'd add how to do this. (though it's provided on other linked websites, it's better to have all the info in one place.)

  • Start firefox
  • enter "about:support" in the address bar
  • In the table, there is a row "Profile folder". Click the button "Open folder".
  • under "chrome" there should be files "userChrome-example.css" which you can rename to "userChrome.css" and edit.

This saved me a lot of time because in my case, the %appdata% pointed to the wrong drive. Moreover I had to install notepad++ because the line endings were not seen by notepad.

Sanjay Manohar
  • 6,920
  • 3
  • 35
  • 58
  • I guess this is on a Mac or something? In my FF 59 under Linux Mint, it says 'Profile directory' (since we're grown-up users), but there are no files or subdirectories with 'css' in their name anywhere under the profile directory. – Michael Scheper Mar 27 '18 at 19:56
0

Izheil's github repo has been referred to in the comment stacks above though the URL shared above did not work for me (hence re-sharing). The steps called out there helped me recover my Firefox look and feel to an acceptable level after upgrading to FF66 betas (non-dark and scrollable tab bar with 3 rows). I've been stuck on the FF Quantum beta channel so these may or may not help you.

The following steps have worked for me on OSX starting with FF 66 b4.

The highlighted 4 files needed at a minimum.

  1. The selected 4 files shown above are needed at a minimum in your profile's chrome folder.
  2. Further if I wanted to add my own customizations (unloaded, pinned tab colors, etc) I made changes to the respective files (the js files) and went through steps 3 and 4 to make them effective.
  3. cleared all files in ‎⁨Macintosh HD⁩ -> ⁨Users⁩ -> [ACCOUNT] -> ⁨Library⁩ -> ⁨Caches⁩ -> ⁨Firefox⁩ -> ⁨Profiles⁩ -> [PROFILE_NAME] -> ⁨startupCache⁩. Note the [PROFILE_NAME] folder is hidden by default.
  4. and then I restarted my Firefox instance.
  5. Make sure your chrome folder only has the css, js, and xml files you want to use. Backup/move everything else to some other [safe] location.
shuhradk
  • 31
  • 3