This commit is contained in:
Mr. M
2025-04-11 22:01:35 +02:00
8 changed files with 137 additions and 87 deletions

View File

@@ -30,11 +30,9 @@
this._initSidebarScrolling();
gZenCompactModeManager.preInit();
ZenWorkspaces.init();
gZenVerticalTabsManager.init();
gZenUIManager.init();
gZenCompactModeManager.init();
this._checkForWelcomePage();
@@ -42,7 +40,34 @@
} catch (e) {
console.error('ZenThemeModifier: Error initializing browser layout', e);
}
ZenWorkspaces.promiseInitialized.then(() => {
if (gBrowserInit.delayedStartupFinished) {
this.delayedStartupFinished();
} else {
Services.obs.addObserver(this, 'browser-delayed-startup-finished');
}
},
observe(aSubject, aTopic) {
// This nsIObserver method allows us to defer initialization until after
// this window has finished painting and starting up.
if (aTopic == 'browser-delayed-startup-finished' && aSubject == window) {
Services.obs.removeObserver(this, 'browser-delayed-startup-finished');
this.delayedStartupFinished();
}
},
delayedStartupFinished() {
ZenWorkspaces.promiseInitialized.then(async () => {
await delayedStartupPromise;
await SessionStore.promiseAllWindowsRestored;
setTimeout(() => {
gZenCompactModeManager.init();
setTimeout(() => {
// A bit of a hack to make sure the tabs toolbar is updated.
// Just in case we didn't get the right size.
gZenUIManager.updateTabsToolbar();
}, 100);
}, 0);
this.closeWatermark();
});
},

View File

@@ -544,7 +544,7 @@ var gZenVerticalTabsManager = {
);
elements = Array.from(elements).reverse();
// Add separator if it doesn't exist
if (!buttonsTarget.contains(this._topButtonsSeparatorElement)) {
if (!this._hasSetSingleToolbar) {
buttonsTarget.append(this._topButtonsSeparatorElement);
}
for (const button of elements) {
@@ -656,7 +656,9 @@ var gZenVerticalTabsManager = {
// Always move the splitter next to the sidebar
this.navigatorToolbox.after(document.getElementById('zen-sidebar-splitter'));
window.dispatchEvent(new Event('resize'));
gZenCompactModeManager.getAndApplySidebarWidth();
if (!isCompactMode) {
gZenCompactModeManager.getAndApplySidebarWidth();
}
gZenUIManager.updateTabsToolbar();
} catch (e) {
console.error(e);

View File

@@ -116,9 +116,8 @@
outline-offset: -1px;
min-width: var(--zen-toolbox-min-width);
/* times 4 because we have the inner padding and the outter padding to consider */
:root[zen-sidebar-expanded='true'] & {
width: calc(var(--zen-sidebar-width) - var(--zen-toolbox-padding));
width: calc(var(--zen-sidebar-width) + var(--zen-toolbox-padding));
}
:root[zen-single-toolbar='true'] {
@@ -352,6 +351,7 @@
}
& #zen-appcontent-navbar-container[zen-has-hover],
& #zen-appcontent-navbar-container:hover,
& #zen-appcontent-navbar-container:focus-within,
& #zen-appcontent-navbar-container[zen-user-show],
& #zen-appcontent-navbar-container[has-popup-menu],

View File

@@ -118,6 +118,7 @@
--toolbar-field-focus-background-color: var(--urlbar-box-bgcolor) !important;
--zen-input-border-color: light-dark(rgb(204, 204, 204), rgb(66, 65, 77));
--urlbar-box-hover-bgcolor: var(--toolbarbutton-hover-background) !important;
--input-bgcolor: light-dark(rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.2)) !important;
/* XUL */
--zen-main-browser-background: light-dark(rgb(235, 235, 235), #1b1b1b);

View File

@@ -55,24 +55,10 @@ var gZenCompactModeManager = {
buttons.removeAttribute('zen-has-hover');
});
}
this.preference = this._wasInCompactMode;
delete this._wasInCompactMode;
},
get preference() {
if (!document.documentElement.hasAttribute('zen-compact-mode')) {
window.addEventListener(
'MozAfterPaint',
() => {
document.documentElement.setAttribute(
'zen-compact-mode',
lazyCompactMode.mainAppWrapper.getAttribute('zen-compact-mode')
);
},
{ once: true }
);
}
return lazyCompactMode.mainAppWrapper.getAttribute('zen-compact-mode') === 'true';
},
@@ -167,11 +153,16 @@ var gZenCompactModeManager = {
await this.animateCompactMode();
this._evenListeners.forEach((callback) => callback());
}
gZenUIManager.updateTabsToolbar();
},
// NOTE: Dont actually use event, it's just so we make sure
// the caller is from the ResizeObserver
getAndApplySidebarWidth(event = undefined) {
if (this._ignoreNextResize) {
this._ignoreNextResize = false;
return;
}
let sidebarWidth = this.sidebar.getBoundingClientRect().width;
if (sidebarWidth > 1) {
gZenUIManager.restoreScrollbarState();
@@ -195,11 +186,15 @@ var gZenCompactModeManager = {
const isCompactMode = this.preference;
const canHideSidebar =
Services.prefs.getBoolPref('zen.view.compact.hide-tabbar') || gZenVerticalTabsManager._hasSetSingleToolbar;
const canAnimate =
let canAnimate =
lazyCompactMode.COMPACT_MODE_CAN_ANIMATE_SIDEBAR &&
!this.sidebar.hasAttribute('zen-user-show') &&
!this.sidebar.hasAttribute('zen-has-empty-tab') &&
!this.sidebar.hasAttribute('zen-has-hover');
if (typeof this._wasInCompactMode !== 'undefined') {
canAnimate = false;
delete this._wasInCompactMode;
}
// Do this so we can get the correct width ONCE compact mode styled have been applied
if (canAnimate) {
this.sidebar.setAttribute('animate', 'true');
@@ -217,10 +212,12 @@ var gZenCompactModeManager = {
}
if (canHideSidebar && isCompactMode) {
const elementSeparation = ZenThemeModifier.elementSeparation;
sidebarWidth -= 0.5 * splitterWidth;
if (elementSeparation < splitterWidth) {
// Subtract from the splitter width to end up with the correct element separation
sidebarWidth += 1.5 * splitterWidth - elementSeparation;
if (document.documentElement.hasAttribute('zen-sidebar-expanded')) {
sidebarWidth -= 0.5 * splitterWidth;
if (elementSeparation < splitterWidth) {
// Subtract from the splitter width to end up with the correct element separation
sidebarWidth += 1.5 * splitterWidth - elementSeparation;
}
}
gZenUIManager.motion
.animate(
@@ -239,17 +236,17 @@ var gZenCompactModeManager = {
.then(() => {
this.sidebar.style.transition = 'none';
this.sidebar.style.opacity = 0;
this.getAndApplySidebarWidth();
setTimeout(() => {
this.sidebar.removeAttribute('animate');
document.documentElement.removeAttribute('zen-compact-animating');
this.getAndApplySidebarWidth({});
this._ignoreNextResize = true;
this.sidebar.style.removeProperty('margin-right');
this.sidebar.style.removeProperty('margin-left');
this.sidebar.style.removeProperty('opacity');
setTimeout(() => {
this.sidebar.style.removeProperty('transition');
}, 200);
this.sidebar.style.removeProperty('transition');
resolve();
}, 0);
@@ -504,3 +501,11 @@ var gZenCompactModeManager = {
}
},
};
document.addEventListener(
'MozBeforeInitialXULLayout',
() => {
gZenCompactModeManager.preInit();
},
{ once: true }
);

View File

@@ -386,8 +386,8 @@
await this._resetTabToStoredState(tab);
}
async replacePinnedUrlWithCurrent() {
const tab = TabContextMenu.contextTab;
async replacePinnedUrlWithCurrent(tab = undefined) {
tab ??= TabContextMenu.contextTab;
if (!tab || !tab.pinned || !tab.getAttribute('zen-pin-id')) {
return;
}
@@ -806,8 +806,11 @@
if (!pin) {
return;
}
// Remove # and ? from the url
const pinUrl = pin.url.split('#')[0].split('?')[0];
const currentUrl = browser.currentURI.spec.split('#')[0].split('?')[0];
// Add an indicator that the pin has been changed
if (pin.url === browser.currentURI.spec) {
if (pinUrl === currentUrl) {
this.resetPinChangedUrl(tab);
return;
}
@@ -967,6 +970,20 @@
indicator.style.removeProperty('top');
}
}
async onTabLabelChanged(tab) {
if (!this._pinsCache) {
return;
}
// If our current pin in the cache point to about:blank, we need to update the entry
const pin = this._pinsCache.find((pin) => pin.uuid === tab.getAttribute('zen-pin-id'));
if (!pin) {
return;
}
if (pin.url === 'about:blank') {
await this.replacePinnedUrlWithCurrent(tab);
}
}
}
window.gZenPinnedTabManager = new ZenPinnedTabManager();

View File

@@ -983,11 +983,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
// If there's ANY pinned tab on the list, we clone the pinned tab
// state to all the tabs
const allArePinned = tabs.every((tab) => tab.pinned);
const allAreEssential = tabs.every((tab) => tab.hasAttribute('zen-essential'));
const thereIsOnePinned = tabs.some((tab) => tab.pinned);
const thereIsOneEssential = tabs.some((tab) => tab.hasAttribute('zen-essential'));
if ((thereIsOneEssential && !allAreEssential) || (thereIsOnePinned && !allArePinned)) {
if (thereIsOneEssential || (thereIsOnePinned && !allArePinned)) {
for (let i = 0; i < tabs.length; i++) {
const tab = tabs[i];
if (tab.pinned) {

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a9389a5c2 100644
index 5f406ea5d09273c9b70b84eee24c6267f88692f8..cdffd1cb1b7744aecc56a8ce57b115e218b527ed 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -424,11 +424,67 @@
@@ -151,16 +151,17 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
// If focus is on the old tab, move it to the new tab.
if (activeEl == oldTab) {
newTab.focus();
@@ -1762,7 +1833,7 @@
@@ -1762,7 +1833,8 @@
}
_setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) {
- if (!aLabel || aLabel.includes("about:reader?")) {
+ gZenPinnedTabManager.onTabLabelChanged(aTab);
+ if (!aLabel || aLabel.includes("about:reader?") || aTab.hasAttribute("zen-has-static-label")) {
return false;
}
@@ -1865,7 +1936,7 @@
@@ -1865,7 +1937,7 @@
newIndex = this.selectedTab._tPos + 1;
}
@@ -169,7 +170,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
let browser;
if (targetTab) {
browser = this.getBrowserForTab(targetTab);
@@ -2122,6 +2193,7 @@
@@ -2122,6 +2194,7 @@
uriIsAboutBlank,
userContextId,
skipLoad,
@@ -177,7 +178,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
} = {}) {
let b = document.createXULElement("browser");
// Use the JSM global to create the permanentKey, so that if the
@@ -2195,8 +2267,7 @@
@@ -2195,8 +2268,7 @@
// we use a different attribute name for this?
b.setAttribute("name", name);
}
@@ -187,7 +188,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
b.setAttribute("transparent", "true");
}
@@ -2373,7 +2444,7 @@
@@ -2373,7 +2445,7 @@
let panel = this.getPanel(browser);
let uniqueId = this._generateUniquePanelID();
@@ -196,7 +197,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
aTab.linkedPanel = uniqueId;
// Inject the <browser> into the DOM if necessary.
@@ -2432,8 +2503,8 @@
@@ -2432,8 +2504,8 @@
// If we transitioned from one browser to two browsers, we need to set
// hasSiblings=false on both the existing browser and the new browser.
if (this.tabs.length == 2) {
@@ -207,7 +208,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
} else {
aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1;
}
@@ -2655,6 +2726,7 @@
@@ -2655,6 +2727,7 @@
schemelessInput,
hasValidUserGestureActivation = false,
textDirectiveUserActivation = false,
@@ -215,7 +216,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
} = {}
) {
// all callers of addTab that pass a params object need to pass
@@ -2665,6 +2737,12 @@
@@ -2665,6 +2738,12 @@
);
}
@@ -228,7 +229,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (!UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.start("browser.tabs.opening", "initting", window);
}
@@ -2728,6 +2806,16 @@
@@ -2728,6 +2807,16 @@
noInitialLabel,
skipBackgroundNotify,
});
@@ -245,7 +246,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (insertTab) {
// insert the tab into the tab container in the correct position
this._insertTabAtIndex(t, {
@@ -2752,6 +2840,7 @@
@@ -2752,6 +2841,7 @@
initialBrowsingContextGroupId,
openWindowInfo,
skipLoad,
@@ -253,7 +254,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
}));
if (focusUrlBar) {
@@ -2871,6 +2960,9 @@
@@ -2871,6 +2961,9 @@
}
}
@@ -263,7 +264,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
// Additionally send pinned tab events
if (pinned) {
this._notifyPinnedStatus(t);
@@ -2891,12 +2983,15 @@
@@ -2891,12 +2984,15 @@
* @param {string} [label=]
* @returns {MozTabbrowserTabGroup}
*/
@@ -280,7 +281,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
return group;
}
@@ -2937,6 +3032,7 @@
@@ -2937,6 +3033,7 @@
insertBefore = null,
isUserCreated = false,
telemetryUserCreateSource = "unknown",
@@ -288,7 +289,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
} = {}
) {
if (!tabs?.length) {
@@ -2951,7 +3047,12 @@
@@ -2951,7 +3048,12 @@
id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
}
let group = this._createTabGroup(id, color, false, label);
@@ -302,7 +303,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
group,
insertBefore?.group ?? insertBefore
);
@@ -3268,6 +3369,7 @@
@@ -3268,6 +3370,7 @@
initialBrowsingContextGroupId,
openWindowInfo,
skipLoad,
@@ -310,7 +311,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
}
) {
// If we don't have a preferred remote type, and we have a remote
@@ -3331,6 +3433,7 @@
@@ -3331,6 +3434,7 @@
openWindowInfo,
name,
skipLoad,
@@ -318,7 +319,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
});
}
@@ -3509,6 +3612,27 @@
@@ -3509,6 +3613,27 @@
) {
tabWasReused = true;
tab = this.selectedTab;
@@ -346,7 +347,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (!tabData.pinned) {
this.unpinTab(tab);
} else {
@@ -3522,6 +3646,7 @@
@@ -3522,6 +3647,7 @@
restoreTabsLazily && !select && !tabData.pinned;
let url = "about:blank";
@@ -354,7 +355,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (tabData.entries?.length) {
let activeIndex = (tabData.index || tabData.entries.length) - 1;
// Ensure the index is in bounds.
@@ -3557,7 +3682,27 @@
@@ -3557,7 +3683,27 @@
skipLoad: true,
preferredRemoteType,
});
@@ -383,7 +384,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (select) {
tabToSelect = tab;
}
@@ -3570,8 +3715,8 @@
@@ -3570,8 +3716,8 @@
// inserted in the DOM. If the tab is not yet in the DOM,
// just insert it in the right place from the start.
if (!tab.parentNode) {
@@ -394,7 +395,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
tab.toggleAttribute("pinned", true);
this.tabContainer._invalidateCachedTabs();
// Then ensure all the tab open/pinning information is sent.
@@ -3581,7 +3726,8 @@
@@ -3581,7 +3727,8 @@
// needs calling:
shouldUpdateForPinnedTabs = true;
}
@@ -404,7 +405,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
let { groupId } = tabData;
const tabGroup = tabGroupWorkingData.get(groupId);
// if a tab refers to a tab group we don't know, skip any group
@@ -3595,7 +3741,10 @@
@@ -3595,7 +3742,10 @@
tabGroup.stateData.id,
tabGroup.stateData.color,
tabGroup.stateData.collapsed,
@@ -416,7 +417,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
);
tabsFragment.appendChild(tabGroup.node);
}
@@ -3646,6 +3795,9 @@
@@ -3646,6 +3796,9 @@
this.selectedTab = tabToSelect;
this.removeTab(leftoverTab);
}
@@ -426,7 +427,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (tabs.length > 1 || !tabs[0].selected) {
this._updateTabsAfterInsert();
@@ -3830,7 +3982,7 @@
@@ -3830,7 +3983,7 @@
// Ensure we have an index if one was not provided.
if (typeof index != "number") {
// Move the new tab after another tab if needed, to the end otherwise.
@@ -435,7 +436,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (
!bulkOrderedOpen &&
((openerTab &&
@@ -3876,18 +4028,18 @@
@@ -3876,18 +4029,18 @@
// Ensure index is within bounds.
if (tab.pinned) {
@@ -458,7 +459,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (tabAfter && tabAfter.group == tabGroup) {
// Place at the front of, or between tabs in, the same tab group
this.tabContainer.insertBefore(tab, tabAfter);
@@ -4199,6 +4351,9 @@
@@ -4199,6 +4352,9 @@
return;
}
@@ -468,7 +469,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
this.removeTabs(selectedTabs);
}
@@ -4450,6 +4605,7 @@
@@ -4450,6 +4606,7 @@
skipGroupCheck = false,
} = {}
) {
@@ -476,7 +477,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
// When 'closeWindowWithLastTab' pref is enabled, closing all tabs
// can be considered equivalent to closing the window.
if (
@@ -4556,6 +4712,7 @@
@@ -4556,6 +4713,7 @@
skipSessionStore,
} = {}
) {
@@ -484,7 +485,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.finish("browser.tabs.opening", window);
}
@@ -4572,6 +4729,12 @@
@@ -4572,6 +4730,12 @@
TelemetryStopwatch.start("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
}
@@ -497,7 +498,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
// Handle requests for synchronously removing an already
// asynchronously closing tab.
if (!animate && aTab.closing) {
@@ -4586,7 +4749,9 @@
@@ -4586,7 +4750,9 @@
// frame created for it (for example, by updating the visually selected
// state).
let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width;
@@ -508,7 +509,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (
!this._beginRemoveTab(aTab, {
closeWindowFastpath: true,
@@ -4600,7 +4765,6 @@
@@ -4600,7 +4766,6 @@
TelemetryStopwatch.cancel("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
return;
}
@@ -516,7 +517,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
let lockTabSizing =
!this.tabContainer.verticalMode &&
!aTab.pinned &&
@@ -4739,14 +4903,14 @@
@@ -4739,14 +4904,14 @@
!!this.tabsInCollapsedTabGroups.length;
if (
aTab.visible &&
@@ -533,7 +534,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (closeWindow) {
// We've already called beforeunload on all the relevant tabs if we get here,
@@ -4770,6 +4934,7 @@
@@ -4770,6 +4935,7 @@
newTab = true;
}
@@ -541,7 +542,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
aTab._endRemoveArgs = [closeWindow, newTab];
// swapBrowsersAndCloseOther will take care of closing the window without animation.
@@ -4810,9 +4975,7 @@
@@ -4810,9 +4976,7 @@
aTab._mouseleave();
if (newTab) {
@@ -552,7 +553,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
} else {
TabBarVisibility.update();
}
@@ -4941,6 +5104,8 @@
@@ -4941,6 +5105,8 @@
this.tabs[i]._tPos = i;
}
@@ -561,7 +562,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (!this._windowIsClosing) {
if (wasPinned) {
this.tabContainer._positionPinnedTabs();
@@ -5064,8 +5229,8 @@
@@ -5064,8 +5230,8 @@
return closedCount;
}
@@ -572,7 +573,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (unloadBlocked) {
return;
}
@@ -5159,7 +5324,7 @@
@@ -5159,7 +5325,7 @@
!excludeTabs.has(aTab.owner) &&
Services.prefs.getBoolPref("browser.tabs.selectOwnerOnClose")
) {
@@ -581,7 +582,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
}
// Try to find a remaining tab that comes after the given tab
@@ -5181,7 +5346,7 @@
@@ -5181,7 +5347,7 @@
}
if (tab) {
@@ -590,7 +591,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
}
// If no qualifying visible tab was found, see if there is a tab in
@@ -5599,10 +5764,10 @@
@@ -5599,10 +5765,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
}
@@ -603,7 +604,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
aTab.selected ||
aTab.closing ||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
@@ -5838,7 +6003,7 @@
@@ -5838,7 +6004,7 @@
moveTabTo(aTab, aIndex, { forceStandaloneTab = false } = {}) {
// Don't allow mixing pinned and unpinned tabs.
if (aTab.pinned) {
@@ -612,7 +613,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
} else {
aIndex = Math.max(aIndex, this.pinnedTabCount);
}
@@ -5848,10 +6013,17 @@
@@ -5848,10 +6014,17 @@
this.#handleTabMove(aTab, () => {
let neighbor = this.tabs[aIndex];
@@ -632,7 +633,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
neighbor.after(aTab);
} else {
this.tabContainer.insertBefore(aTab, neighbor);
@@ -5901,13 +6073,22 @@
@@ -5901,13 +6074,22 @@
* Bug 1955388 - prevent pinned tabs from commingling with non-pinned tabs
* when there are hidden tabs present
*/
@@ -656,7 +657,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (tab.pinned && this.tabContainer.verticalMode) {
return this.tabContainer.verticalPinnedTabsContainer;
}
@@ -5937,7 +6118,7 @@
@@ -5937,7 +6119,7 @@
}
moveTabToGroup(aTab, aGroup) {
@@ -665,7 +666,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
return;
}
if (aTab.group && aTab.group.id === aGroup.id) {
@@ -5961,6 +6142,10 @@
@@ -5961,6 +6143,10 @@
moveActionCallback();
@@ -676,7 +677,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
// Clear tabs cache after moving nodes because the order of tabs may have
// changed.
this.tabContainer._invalidateCachedTabs();
@@ -6015,7 +6200,7 @@
@@ -6015,7 +6201,7 @@
createLazyBrowser,
};
@@ -685,7 +686,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
if (aIndex < numPinned || (aTab.pinned && aIndex == numPinned)) {
params.pinned = true;
}
@@ -6765,7 +6950,7 @@
@@ -6765,7 +6951,7 @@
// preventDefault(). It will still raise the window if appropriate.
break;
}
@@ -694,7 +695,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
window.focus();
aEvent.preventDefault();
break;
@@ -7671,6 +7856,7 @@
@@ -7671,6 +7857,7 @@
aWebProgress.isTopLevel
) {
this.mTab.setAttribute("busy", "true");
@@ -702,7 +703,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected;
}
@@ -8640,7 +8826,7 @@ var TabContextMenu = {
@@ -8640,7 +8827,7 @@ var TabContextMenu = {
);
contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !this.multiselected;
@@ -711,7 +712,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
// Move Tab items
let contextMoveTabOptions = document.getElementById(
"context_moveTabOptions"
@@ -8674,7 +8860,7 @@ var TabContextMenu = {
@@ -8674,7 +8861,7 @@ var TabContextMenu = {
let isFirstTab =
!this.contextTabs[0].group &&
(this.contextTabs[0] == visibleTabs[0] ||
@@ -720,7 +721,7 @@ index 5f406ea5d09273c9b70b84eee24c6267f88692f8..3c36035a51392a288ab71494fd04cd2a
contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent;
document.getElementById("context_openTabInWindow").disabled =
@@ -8904,6 +9090,7 @@ var TabContextMenu = {
@@ -8904,6 +9091,7 @@ var TabContextMenu = {
if (this.contextTab.multiselected) {
gBrowser.removeMultiSelectedTabs();
} else {