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