Skip to content

Commit a725768

Browse files
committed
Add fixes for tab groups
1 parent 8e53ecc commit a725768

File tree

7 files changed

+392
-1004
lines changed

7 files changed

+392
-1004
lines changed

Installers/Multirow & other functions/functions/MultiRowTab-scrollable-autohide.uc.js

Lines changed: 79 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -3,69 +3,14 @@
33
// @namespace https://github.com/Izheil/Quantum-Nox-Firefox-Customizations
44
// @description Multi-row tabs draggability fix with autohiding scrollbar
55
// @include main
6-
// @compatibility Firefox 70 to Firefox 145.0a1 (2025-09-26)
6+
// @compatibility Firefox 147 to Firefox 149.0a1 (2026-02-12)
77
// @author Alice0775, Endor8, TroudhuK, Izheil, Merci-chao
8+
// @version 12/02/2026 18:40 Fix dragging tabs from a tab group
89
// @version 30/11/2025 05:24 Fix the all tabs button displacing the new tab button on new row
910
// @version 03/10/2025 02:59 Fix tab group label showing on move
1011
// @version 01/10/2025 06:15 Fix issues with tab group moving
1112
// @version 27/09/2025 06:40 Fix issues with tab groups
1213
// @version 12/07/2025 00:28 Fix spacing with tab groups and new tab button
13-
// @version 01/07/2025 17:12 Fixed pinned tabs with Firefox 142.0a1 (2025-06-29)+
14-
// @version 30/04/2025 05:30 Fixed arrowscrollbox selector on FF137+
15-
// @version 04/04/2025 06:56 Fixed issue with Firefox 139.0a1 (2025-04-02)+
16-
// @version 11/01/2025 01:59 Fixed gBrowser issue with Firefox 134+
17-
// @version 13/11/2024 23:13 Fixed issue with Firefox 133+
18-
// @version 07/09/2024 13:25 Compatibility fix for FF131a (Nightly)
19-
// @version 10/05/2023 18:42 Fix tab-growth variable from not applying
20-
// @version 14/01/2023 22:36 Fixed new tab button getting overlapped with last tab
21-
// @version 15/12/2022 22:17 Fixed min/max/close button duplication when having menu bar always visible
22-
// @version 14/12/2022 19:11 Fixed issue with Firefox 108 (Stable)
23-
// @version 21/11/2022 18:38 Fixed issue with Firefox 108a (Nightly)
24-
// @version 15/04/2022 17:58 Fix for duplicated buttons when having titlebar enabled
25-
// @version 12/04/2022 05:40 Min/Max/Close buttons resizing fix
26-
// @version 22/01/2022 16:50 Tab sizing fixes
27-
// @version 02/11/2021 03:15 Made pinned tabs to not have forced Proton sizing
28-
// @version 15/09/2021 11:39 Added experimental support for tab sizing below 20px
29-
// @version 10/09/2021 09:49 Fixed regression of pinned tabs icon showing unaligned
30-
// @version 19/08/2021 03:15 Compatibility fix for FF91
31-
// @version 07/08/2021 07:36 Fix for some linux issue when going out of fullscreen
32-
// @version 08/07/2021 07:31 Fixed some issue when having only pinned tabs
33-
// @version 05/06/2021 12:12 Support for changing scrollbar size and color, fixing tab size jumping
34-
// @version 05/06/2021 03:11 Lightweight themes fix
35-
// @version 04/06/2021 04:39 Tab height fix for Proton
36-
// @version 07/03/2021 23:24 Compatibility fix with Simple Tab Groups addon
37-
// @version 12/02/2021 06:23 Added the option to make the scrollbar thin and change its color
38-
// @version 12/02/2021 02:18 The new tab button now wont start a new row by itself, and multiple tab selection fixed
39-
// @version 04/01/2021 22:45 Added an optional tab rows resizer that you can toggle with "useResizer" var
40-
// @version 07/12/2020 01:21 Stopped hidding tab right borders since it's not related to multirow
41-
// @version 25/09/2020 23:26 Fixed glitch on opening tabs in the background while on fullscreen
42-
// @version 06/09/2020 18:29 Compatibility fix for Australis and fix for pinned tabs glitch
43-
// @version 28/07/2020 23:28 Compatibility fix for FF81
44-
// @version 03/07/2020 00:34 Fixed an issue with the new tab button overflowing the scrollbar
45-
// @version 12/05/2020 13:09 Removed unnecesary selector
46-
// @version 09/04/2020 08:14 Minor fixes for tab line when window is resized
47-
// @version 08/04/2020 04:30 Compatibility fix for FF77
48-
// @version 16/03/2020 05:15 Fixed some issue with tab transitions
49-
// @version 06/03/2020 21:56 Fixed an issue with tab lines and duplicated buttons
50-
// @version 12/02/2020 03:30 Fixed some issue with the min/resize/close buttons
51-
// @version 18/01/2020 02:39 Added a fix for people who always spoof their useragent
52-
// @version 13/01/2020 05:01 Fixed the tab drop indicator on FF72+
53-
// @version 15/11/2019 15:45 Unified FF67+ and FF72 versions
54-
// @version 11/10/2019 18:32 Compatibility fix for FF71
55-
// @version 06/09/2019 23:37 Fixed issue with tabs when moving to another window
56-
// @version 05/09/2019 03:24 Fixed tab draggability to work with FF69
57-
// @version 22/07/2019 19:21 Compatibility fix with Windows 7
58-
// @version 23/03/2019 22:25 Comments on tab width
59-
// @version 09/03/2019 15:38 Fixed compatibility issue with Tab Session Manager addon
60-
// @version 18/02/2019 20:46 Tab line not being fully shown on maximized or fullscreen
61-
// @version 03/02/2019 15:15 Firefox 67
62-
// @version 03/02/2019 04:22 Fixed issue with scrolling when selecting non-visible tab
63-
// @version 02/02/2019 00:17 Fixed transparent line under tabs and touch density tabs issue
64-
// @version 01/02/2019 10:32 Fixed issue window dragging while keeping scrollbar dragging
65-
// @version 31/01/2019 10:32 Fixed issue with fullscreen
66-
// @version 30/01/2019 02:05 Fixed issue with a pixel being above the tab bar
67-
// @version 30/11/2018 06:12 Now only the necesary rows appear, not static number of rows
68-
// @version 23/11/2018 00:41 Firefox 65
6914
// ==/UserScript==
7015
function zzzz_MultiRowTabLite() {
7116
// EDITABLE JAVASCRIPT VARIABLES
@@ -278,10 +223,6 @@ function zzzz_MultiRowTabLite() {
278223
margin-inline-start: 0 !important;
279224
}
280225
281-
tab-group[hideonmove] {
282-
visibility: hidden !important;
283-
}
284-
285226
`;
286227

287228
// We check if using australis here
@@ -317,144 +258,95 @@ function zzzz_MultiRowTabLite() {
317258
gBrowser.tabContainer.addEventListener("TabUnpinned", fixUnpinnedTabsPosition, false);
318259
}
319260

320-
if (arrowScrollbox.shadowRoot) {
321-
css +=
322-
`scrollbar, #tab-scrollbox-resizer {-moz-window-dragging: no-drag !important}
261+
css +=
262+
`scrollbar, #tab-scrollbox-resizer {-moz-window-dragging: no-drag !important}
323263
324-
#tabbrowser-tabs > arrowscrollbox {
325-
overflow: visible;
326-
display: block;
327-
`
264+
#tabbrowser-tabs > arrowscrollbox {
265+
overflow: visible;
266+
display: block;
267+
`
328268

329-
// This is a fix for the shadow elements:
330-
style.innerHTML = `
331-
.scrollbox-clip {
332-
overflow: visible;
333-
display: block;
334-
}
335-
336-
scrollbox {
337-
display: flex;
338-
flex-wrap: wrap;
339-
overflow-x: hidden;
340-
overflow-y: hidden;
341-
min-height: var(--tab-min-height);
342-
max-height: calc(var(--tab-min-height) * var(--max-tab-rows));
343-
}
344-
345-
scrollbox:hover {
346-
margin-right: 0;
347-
overflow-y: scroll}
348-
349-
/* Firefox 131+ fix */
350-
scrollbox > slot {
351-
flex-wrap: wrap;
352-
}
269+
// This is a fix for the shadow elements:
270+
style.innerHTML = `
271+
.scrollbox-clip {
272+
overflow: visible;
273+
display: block;
274+
}
275+
276+
scrollbox {
277+
display: flex;
278+
flex-wrap: wrap;
279+
overflow-x: hidden;
280+
overflow-y: hidden;
281+
min-height: var(--tab-min-height);
282+
max-height: calc(var(--tab-min-height) * var(--max-tab-rows));
283+
}
353284
354-
.arrowscrollbox-overflow-start-indicator,
355-
.arrowscrollbox-overflow-end-indicator {position: fixed !important}
285+
scrollbox:hover {
286+
margin-right: 0;
287+
overflow-y: scroll}
356288
357-
.scrollbutton-up, .scrollbutton-down, spacer,
358-
#scrollbutton-up, #scrollbutton-down {display: none !important}
359-
`;
289+
/* Firefox 131+ fix */
290+
scrollbox > slot {
291+
flex-wrap: wrap;
292+
}
360293
361-
// This is a fix for FF89+ (Proton)
362-
if (document.documentElement.hasAttribute("proton") || tabsHavePadding) {
363-
style.innerHTML += `
364-
scrollbox {
365-
max-height: calc((var(--tab-min-height) + 8px) * var(--max-tab-rows));
366-
}
367-
`;
368-
}
294+
.arrowscrollbox-overflow-start-indicator,
295+
.arrowscrollbox-overflow-end-indicator {position: fixed !important}
369296
370-
// Possible sizes of the scrollbar to avoid tab size jumping
371-
if (scrollbarSize == "thin") {
372-
style.innerHTML += `
373-
scrollbox {
374-
scrollbar-color: var(--tabs-scrollbar-color) transparent;
375-
scrollbar-width: thin;
376-
margin-right: 8px;
377-
}
378-
`
379-
} else if (scrollbarSize == "none") {
380-
style.innerHTML += `
381-
scrollbox {
382-
scrollbar-width: none;
383-
}
384-
`
385-
} else {
386-
style.innerHTML += `
387-
scrollbox {
388-
scrollbar-color: var(--tabs-scrollbar-color) transparent;
389-
scrollbar-width: auto;
390-
margin-right: 17px;
391-
}
392-
`
393-
}
297+
.scrollbutton-up, .scrollbutton-down, spacer,
298+
#scrollbutton-up, #scrollbutton-down {display: none !important}
299+
`;
394300

395-
if (australisElement) {
396-
css += `
397-
.tabbrowser-tab[first-visible-tab="true"] {
398-
padding-left: 0 !important;
399-
}
400-
`;
401-
402-
style.innerHTML += `
403-
scrollbox {
404-
padding: 0 30px;
405-
}
406-
`;
301+
// This is a fix for FF89+ (Proton)
302+
if (document.documentElement.hasAttribute("proton") || tabsHavePadding) {
303+
style.innerHTML += `
304+
scrollbox {
305+
max-height: calc((var(--tab-min-height) + 8px) * var(--max-tab-rows));
407306
}
307+
`;
308+
}
408309

409-
arrowScrollbox.shadowRoot.appendChild(style);
410-
} else {
411-
// Here the FF69-FF70 changes
412-
css +=`
413-
#tabbrowser-tabs .scrollbutton-up, #tabbrowser-tabs .scrollbutton-down {
414-
display: none !important}
415-
416-
#tabbrowser-tabs .arrowscrollbox-scrollbox {
417-
display: flex;
418-
flex-wrap: wrap;
419-
overflow-x: hidden;
420-
overflow-y: hidden;
421-
min-height: var(--tab-min-height);
422-
max-height: calc(var(--tab-min-height)*var(--max-tab-rows))}
423-
424-
#tabbrowser-tabs:hover .arrowscrollbox-scrollbox {overflow-y: auto}
425-
426-
#tabbrowser-tabs .tabbrowser-arrowscrollbox {
427-
overflow: visible;
428-
display: block}
429-
430-
.arrowscrollbox-overflow-start-indicator,
431-
.arrowscrollbox-overflow-end-indicator {position: fixed !important}
432-
433-
#main-window[tabsintitlebar] #tabbrowser-tabs scrollbar, #tab-scrollbox-resizer {
434-
-moz-window-dragging: no-drag}
435-
`;
436-
437-
if (scrollbarSize == "thin") {
438-
css.innerHTML += `
439-
#tabbrowser-tabs .arrowscrollbox-scrollbox {
440-
scrollbar-color: var(--tabs-scrollbar-color) transparent;
441-
scrollbar-width: thin;
442-
}
443-
`
310+
// Possible sizes of the scrollbar to avoid tab size jumping
311+
if (scrollbarSize == "thin") {
312+
style.innerHTML += `
313+
scrollbox {
314+
scrollbar-color: var(--tabs-scrollbar-color) transparent;
315+
scrollbar-width: thin;
316+
margin-right: 8px;
317+
}
318+
`
319+
} else if (scrollbarSize == "none") {
320+
style.innerHTML += `
321+
scrollbox {
322+
scrollbar-width: none;
323+
}
324+
`
325+
} else {
326+
style.innerHTML += `
327+
scrollbox {
328+
scrollbar-color: var(--tabs-scrollbar-color) transparent;
329+
scrollbar-width: auto;
330+
margin-right: 17px;
444331
}
332+
`
333+
}
445334

446-
if (australisElement) {
447-
css += `
448-
.tabbrowser-tab[first-visible-tab="true"] {
449-
padding-left: 0 !important;
450-
}
335+
if (australisElement) {
336+
css += `
337+
.tabbrowser-tab[first-visible-tab="true"] {
338+
padding-left: 0 !important;
339+
}
340+
`;
451341

452-
#tabbrowser-tabs .arrowscrollbox-scrollbox {
453-
padding: 0 30px;
454-
}
455-
`;
342+
style.innerHTML += `
343+
scrollbox {
344+
padding: 0 30px;
456345
}
457-
}
346+
`;
347+
}
348+
349+
arrowScrollbox.shadowRoot.appendChild(style);
458350

459351
let sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
460352
let uri = makeURI('data:text/css;charset=UTF=8,' + encodeURIComponent(css));
@@ -637,9 +529,6 @@ function performTabDragOver(event) {
637529
let draggedTab = getDraggedTab(event);
638530
let draggedGroup = findParentOfType(draggedTab, TAB_GROUP_SELECTOR, 3);
639531

640-
if (draggedTab.nodeName === "label" && draggedGroup)
641-
draggedGroup.setAttribute("hideonmove", "");
642-
643532
if (!tab)
644533
tab = getTabFromEventTarget(event, false);
645534

@@ -767,7 +656,6 @@ function performTabDropEvent(event) {
767656
// Handle moving tab groups
768657
let tabGroup = findParentOfType(draggedTab, TAB_GROUP_SELECTOR, 3);
769658
if (draggedTab.nodeName === "label" && tabGroup) {
770-
tabGroup.removeAttribute("hideonmove");
771659
let tabToMoveTo = allTabs[lastKnownIndex];
772660
let draggedIndex = Array.prototype.indexOf.call(allTabs, tabGroup.querySelector("tab:first-of-type"));
773661
if (draggedIndex === lastKnownIndex)
@@ -976,7 +864,7 @@ function moveTabsToGroup(selectedTabs) {
976864
if (t.hasAttribute("newPin")) {
977865
t.removeAttribute("newPin");
978866
}
979-
gBrowser.moveTabToGroup(t, groupToInsertTo);
867+
gBrowser.moveTabToExistingGroup(t, groupToInsertTo);
980868

981869
if (tabInGroupToMoveTo)
982870
gBrowser.moveTabBefore(t, tabInGroupToMoveTo);

0 commit comments

Comments
 (0)