Skip to content

Commit 4cbe706

Browse files
committed
update multirow code for FF133
1 parent baffa53 commit 4cbe706

File tree

7 files changed

+175
-135
lines changed

7 files changed

+175
-135
lines changed

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

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
// @namespace https://github.com/Izheil/Quantum-Nox-Firefox-Dark-Full-Theme
44
// @description Multi-row tabs draggability fix with autohiding scrollbar
55
// @include main
6-
// @compatibility Firefox 70 to Firefox 115.0a1 (2023-05-09)
6+
// @compatibility Firefox 70 to Firefox 131.0a1 (2024-09-07)
77
// @author Alice0775, Endor8, TroudhuK, Izheil, Merci-chao
8+
// @version 13/11/2024 23:13 Fixed issue with Firefox 133+
9+
// @version 07/09/2024 13:25 Compatibility fix for FF131a (Nightly)
810
// @version 10/05/2023 18:42 Fix tab-growth variable from not applying
911
// @version 14/01/2023 22:36 Fixed new tab button getting overlapped with last tab
1012
// @version 15/12/2022 22:17 Fixed min/max/close button duplication when having menu bar always visible
@@ -61,11 +63,11 @@ function zzzz_MultiRowTabLite() {
6163
// EDITABLE JAVASCRIPT VARIABLES
6264

6365
// Enables the use of the rows resizer
64-
let useResizer = false;
66+
const useResizer = false;
6567

6668
// Size of the scrollbar
6769
// auto = default OS size (will show arrow handlers even when it's not needed) | thin = half the width | none = always hidden scrollbar
68-
let scrollbarSize = "thin";
70+
const scrollbarSize = "thin";
6971

7072
// CSS section
7173
let css =`
@@ -138,7 +140,6 @@ function zzzz_MultiRowTabLite() {
138140
The second rule (.titlebar-buttonbox) has paddings control the padding of the min/max/close buttons.
139141
Changing these are required if you want the tab bar to be smaller when having 1 row. */
140142
141-
/*
142143
#TabsToolbar {
143144
--toolbarbutton-inner-padding: inherit !important;
144145
}
@@ -148,11 +149,6 @@ function zzzz_MultiRowTabLite() {
148149
height: var(--tab-min-height) !important;
149150
}
150151
151-
.titlebar-buttonbox-container {
152-
display: block;
153-
}
154-
*/
155-
156152
/*-------- Don't edit past here unless you know what you are doing --------*/
157153
158154
#tab-scrollbox-resizer {
@@ -246,6 +242,15 @@ function zzzz_MultiRowTabLite() {
246242
padding-inline-start: 0 !important;
247243
}
248244
245+
/* Remove duplicated min/max/close buttons */
246+
#nav-bar > .titlebar-buttonbox-container {
247+
display: none !important;
248+
}
249+
250+
#TabsToolbar .titlebar-buttonbox-container {
251+
display: block !important;
252+
}
253+
249254
`;
250255

251256
// We check if using australis here
@@ -295,6 +300,11 @@ function zzzz_MultiRowTabLite() {
295300
margin-right: 0;
296301
overflow-y: scroll}
297302
303+
/* Firefox 131+ fix */
304+
scrollbox > slot {
305+
flex-wrap: wrap;
306+
}
307+
298308
.arrowscrollbox-overflow-start-indicator,
299309
.arrowscrollbox-overflow-end-indicator {position: fixed !important}
300310
@@ -378,7 +388,7 @@ function zzzz_MultiRowTabLite() {
378388
-moz-window-dragging: no-drag}
379389
`;
380390

381-
if (useThinScrollbar == true) {
391+
if (scrollbarSize == "thin") {
382392
style.innerHTML += `
383393
#tabbrowser-tabs .arrowscrollbox-scrollbox {
384394
scrollbar-color: var(--tabs-scrollbar-color) transparent;
@@ -473,8 +483,8 @@ function zzzz_MultiRowTabLite() {
473483
tabsScrollbox = document.querySelector("#tabbrowser-tabs .arrowscrollbox-scrollbox");
474484
}
475485

476-
let tabsContainer = document.getElementById("TabsToolbar-customization-target");
477-
let mainWindow = document.getElementById("main-window");
486+
const tabsContainer = document.getElementById("TabsToolbar-customization-target");
487+
const mainWindow = document.getElementById("main-window");
478488

479489
// Adds the resizer element to tabsContainer
480490
let tabsResizer = document.createElement("div");
@@ -512,7 +522,7 @@ function zzzz_MultiRowTabLite() {
512522

513523
/* fix for moving multiple selected tabs */
514524
gBrowser.visibleTabs.forEach(t => t.style.transform && "");
515-
let tab = this._getDragTargetTab(event, false);
525+
const tab = this._getDragTargetTab(event, false);
516526
let selectedTabs = gBrowser.selectedTabs;
517527
while (selectedTabs.length) {
518528
let t = selectedTabs.pop();
@@ -538,7 +548,7 @@ function zzzz_MultiRowTabLite() {
538548
if (!this._dragTime)
539549
this._dragTime = Date.now();
540550
if (!tab.hasAttribute("pendingicon") && // annoying fix
541-
Date.now() >= this._dragTime + this._dragOverDelay);
551+
Date.now() >= this._dragTime + this._dragOverDelay)
542552
this.selectedItem = tab;
543553
ind.hidden = true;
544554
return;
@@ -591,17 +601,18 @@ function zzzz_MultiRowTabLite() {
591601
let dt = event.dataTransfer;
592602
let dropEffect = dt.dropEffect;
593603
let draggedTab;
594-
let movingTabs;
595604
if (dt.mozTypesAt(0)[0] == TAB_DROP_TYPE) {
596605
draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
597606
if (!draggedTab) {
598607
return;
599608
}
600-
movingTabs = draggedTab._dragData.movingTabs;
601-
draggedTab.container._finishGroupSelectedTabs(draggedTab);
609+
if (draggedTab.container._finishMoveTogetherSelectedTabs) {
610+
draggedTab.container._finishMoveTogetherSelectedTabs(draggedTab);
611+
} else {
612+
draggedTab.container._finishGroupSelectedTabs(draggedTab);
613+
}
602614
}
603-
if (draggedTab && dropEffect == "copy") {}
604-
else if (draggedTab && draggedTab.container == this) {
615+
if (draggedTab && dropEffect != "copy" && draggedTab.container == this) {
605616
newIndex = this._getDropIndex(event, false);
606617

607618
/* fix for moving multiple selected tabs */
@@ -619,7 +630,7 @@ function zzzz_MultiRowTabLite() {
619630
};
620631

621632
// We then attach the event listeners for the new functionability to take effect
622-
if (Listeners == false) {
633+
if (!Listeners) {
623634
gBrowser.tabContainer.addEventListener("dragover", gBrowser.tabContainer._onDragOver, true);
624635
gBrowser.tabContainer.addEventListener("drop", function(event){this.onDrop(event);}, true);
625636
Listeners = true;

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

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// @include main
66
// @compatibility Firefox 70 to Firefox 131.0a1 (2024-09-07)
77
// @author Alice0775, Endor8, TroudhuK, Izheil, Merci-chao
8+
// @version 13/11/2024 23:13 Fixed issue with Firefox 133+
89
// @version 07/09/2024 13:25 Compatibility fix for FF131a (Nightly)
910
// @version 10/05/2023 18:42 Fix tab-growth variable from not applying
10-
// @version 14/01/2023 22:36 Fixed new tab button getting overlapped with last tab
1111
// @version 15/12/2022 22:17 Fixed min/max/close button duplication when having menu bar always visible
1212
// @version 14/12/2022 19:11 Fixed issue with Firefox 108 (Stable)
1313
// @version 21/11/2022 18:38 Fixed issue with Firefox 108a (Nightly)
@@ -57,11 +57,11 @@ function zzzz_MultiRowTabLite() {
5757
// EDITABLE JAVASCRIPT VARIABLES
5858

5959
// Enables the use of the rows resizer
60-
let useResizer = false;
60+
const useResizer = false;
6161

6262
// Size of the scrollbar
6363
// auto = default OS size | thin = half the width | none = always hidden scrollbar
64-
let scrollbarSize = "auto";
64+
const scrollbarSize = "auto";
6565

6666
// CSS section
6767
let css =`
@@ -129,7 +129,6 @@ function zzzz_MultiRowTabLite() {
129129
YOU DON'T NEED TO CHANGE THESE unless you want to use values of --tab-min-height lower than 20px.
130130
Before changing them, you need to UNCOMMENT the 2 rules below for them TO TAKE EFFECT. */
131131
132-
/*
133132
#TabsToolbar {
134133
--toolbarbutton-inner-padding: inherit !important;
135134
}
@@ -139,12 +138,6 @@ function zzzz_MultiRowTabLite() {
139138
height: var(--tab-min-height) !important;
140139
}
141140
142-
.titlebar-buttonbox-container {
143-
display: block !important;
144-
}
145-
146-
*/
147-
148141
/*-------- Don't edit past here unless you know what you are doing --------*/
149142
150143
#tab-scrollbox-resizer {
@@ -228,6 +221,15 @@ function zzzz_MultiRowTabLite() {
228221
padding-inline-start: 0 !important;
229222
}
230223
224+
/* Remove duplicated min/max/close buttons */
225+
#nav-bar > .titlebar-buttonbox-container {
226+
display: none !important;
227+
}
228+
229+
#TabsToolbar .titlebar-buttonbox-container {
230+
display: block !important;
231+
}
232+
231233
`;
232234

233235
// We check if using australis here
@@ -241,12 +243,13 @@ function zzzz_MultiRowTabLite() {
241243

242244
// Check if it's proton past FF91
243245
let tabsHavePadding = false;
244-
let tabBackground = document.getElementsByClassName("tab-background")[0];
246+
const tabBackground = document.getElementsByClassName("tab-background")[0];
245247
if (parseInt(getComputedStyle(tabBackground).getPropertyValue('--tab-block-margin').substring(0,1)) > 0) {
246248
tabsHavePadding = true;
247249
}
248250

249251
// Here the FF71+ changes
252+
let style = document.createElement('style');
250253
if (document.querySelector("#tabbrowser-tabs > arrowscrollbox").shadowRoot) {
251254
css +=
252255
`scrollbar, #tab-scrollbox-resizer {-moz-window-dragging: no-drag !important}
@@ -257,7 +260,6 @@ function zzzz_MultiRowTabLite() {
257260
`
258261

259262
// This is a fix for the shadow elements:
260-
let style = document.createElement('style');
261263
style.innerHTML = `
262264
.scrollbox-clip {
263265
overflow: visible;
@@ -358,7 +360,7 @@ function zzzz_MultiRowTabLite() {
358360
-moz-window-dragging: no-drag}
359361
`;
360362

361-
if (useThinScrollbar == true) {
363+
if (scrollbarSize == "thin") {
362364
style.innerHTML += `
363365
#tabbrowser-tabs .arrowscrollbox-scrollbox {
364366
scrollbar-color: var(--tabs-scrollbar-color) transparent;
@@ -453,8 +455,8 @@ function zzzz_MultiRowTabLite() {
453455
tabsScrollbox = document.querySelector("#tabbrowser-tabs .arrowscrollbox-scrollbox");
454456
}
455457

456-
let tabsContainer = document.getElementById("TabsToolbar-customization-target");
457-
let mainWindow = document.getElementById("main-window");
458+
const tabsContainer = document.getElementById("TabsToolbar-customization-target");
459+
const mainWindow = document.getElementById("main-window");
458460

459461
// Adds the resizer element to tabsContainer
460462
let tabsResizer = document.createElement("div");
@@ -492,7 +494,7 @@ function zzzz_MultiRowTabLite() {
492494

493495
/* fix for moving multiple selected tabs */
494496
gBrowser.visibleTabs.forEach(t => t.style.transform && "");
495-
let tab = this._getDragTargetTab(event, false);
497+
const tab = this._getDragTargetTab(event, false);
496498
let selectedTabs = gBrowser.selectedTabs;
497499
while (selectedTabs.length) {
498500
let t = selectedTabs.pop();
@@ -518,7 +520,7 @@ function zzzz_MultiRowTabLite() {
518520
if (!this._dragTime)
519521
this._dragTime = Date.now();
520522
if (!tab.hasAttribute("pendingicon") && // annoying fix
521-
Date.now() >= this._dragTime + this._dragOverDelay);
523+
Date.now() >= this._dragTime + this._dragOverDelay)
522524
this.selectedItem = tab;
523525
ind.hidden = true;
524526
return;
@@ -571,17 +573,20 @@ function zzzz_MultiRowTabLite() {
571573
let dt = event.dataTransfer;
572574
let dropEffect = dt.dropEffect;
573575
let draggedTab;
574-
let movingTabs;
575576
if (dt.mozTypesAt(0)[0] == TAB_DROP_TYPE) {
576577
draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
577578
if (!draggedTab) {
578579
return;
579580
}
580-
movingTabs = draggedTab._dragData.movingTabs;
581-
draggedTab.container._finishGroupSelectedTabs(draggedTab);
581+
582+
// Fix for FF133+
583+
if (draggedTab.container._finishMoveTogetherSelectedTabs) {
584+
draggedTab.container._finishMoveTogetherSelectedTabs(draggedTab);
585+
} else {
586+
draggedTab.container._finishGroupSelectedTabs(draggedTab);
587+
}
582588
}
583-
if (draggedTab && dropEffect == "copy") {}
584-
else if (draggedTab && draggedTab.container == this) {
589+
if (draggedTab && dropEffect != "copy" && draggedTab.container == this) {
585590
newIndex = this._getDropIndex(event, false);
586591

587592
/* fix for moving multiple selected tabs */
@@ -599,7 +604,7 @@ function zzzz_MultiRowTabLite() {
599604
};
600605

601606
// We then attach the event listeners for the new functionability to take effect
602-
if (Listeners == false) {
607+
if (!Listeners) {
603608
gBrowser.tabContainer.addEventListener("dragover", gBrowser.tabContainer._onDragOver, true);
604609
gBrowser.tabContainer.addEventListener("drop", function(event){this.onDrop(event);}, true);
605610
Listeners = true;

0 commit comments

Comments
 (0)