Added the old unread attribute for tabs

This commit is contained in:
mr. M 2024-10-24 21:09:57 +02:00
parent 24d09cc134
commit 2e9c147c44
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB

View file

@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index c89ae2cbb978d6218bd56a059c5ca1e371231607..f86d0e4e32988ce0b498ace83a9fcd9b5a2c7afd 100644
index c89ae2cbb978d6218bd56a059c5ca1e371231607..58c05bd5c935f73e154e84f66b39f58e5741caf6 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -456,11 +456,26 @@
@ -31,7 +31,15 @@ index c89ae2cbb978d6218bd56a059c5ca1e371231607..f86d0e4e32988ce0b498ace83a9fcd9b
}
return i;
},
@@ -2705,6 +2720,11 @@
@@ -1340,6 +1355,7 @@
if (!this._previewMode) {
newTab.recordTimeFromUnloadToReload();
newTab.updateLastAccessed();
+ newTab.removeAttribute("unread");
oldTab.updateLastAccessed();
// if this is the foreground window, update the last-seen timestamps.
if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) {
@@ -2705,6 +2721,11 @@
);
}
@ -43,7 +51,7 @@ index c89ae2cbb978d6218bd56a059c5ca1e371231607..f86d0e4e32988ce0b498ace83a9fcd9b
if (!UserInteraction.running("browser.tabs.opening", window)) {
UserInteraction.start("browser.tabs.opening", "initting", window);
}
@@ -2773,6 +2793,9 @@
@@ -2773,6 +2794,9 @@
noInitialLabel,
skipBackgroundNotify,
});
@ -53,7 +61,7 @@ index c89ae2cbb978d6218bd56a059c5ca1e371231607..f86d0e4e32988ce0b498ace83a9fcd9b
if (insertTab) {
// insert the tab into the tab container in the correct position
this._insertTabAtIndex(t, {
@@ -3262,6 +3285,14 @@
@@ -3262,6 +3286,14 @@
) {
tabWasReused = true;
tab = this.selectedTab;
@ -68,7 +76,7 @@ index c89ae2cbb978d6218bd56a059c5ca1e371231607..f86d0e4e32988ce0b498ace83a9fcd9b
if (!tabData.pinned) {
this.unpinTab(tab);
} else {
@@ -3275,6 +3306,9 @@
@@ -3275,6 +3307,9 @@
restoreTabsLazily && !select && !tabData.pinned;
let url = "about:blank";
@ -78,7 +86,7 @@ index c89ae2cbb978d6218bd56a059c5ca1e371231607..f86d0e4e32988ce0b498ace83a9fcd9b
if (tabData.entries?.length) {
let activeIndex = (tabData.index || tabData.entries.length) - 1;
// Ensure the index is in bounds.
@@ -3311,6 +3345,12 @@
@@ -3311,6 +3346,12 @@
preferredRemoteType,
});
@ -91,7 +99,7 @@ index c89ae2cbb978d6218bd56a059c5ca1e371231607..f86d0e4e32988ce0b498ace83a9fcd9b
if (select) {
tabToSelect = tab;
}
@@ -3345,7 +3385,7 @@
@@ -3345,7 +3386,7 @@
this.tabContainer._invalidateCachedTabs();
}
}
@ -100,7 +108,7 @@ index c89ae2cbb978d6218bd56a059c5ca1e371231607..f86d0e4e32988ce0b498ace83a9fcd9b
tab.initialize();
}
@@ -4152,6 +4192,13 @@
@@ -4152,6 +4193,13 @@
TelemetryStopwatch.start("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
}
@ -114,7 +122,7 @@ index c89ae2cbb978d6218bd56a059c5ca1e371231607..f86d0e4e32988ce0b498ace83a9fcd9b
// Handle requests for synchronously removing an already
// asynchronously closing tab.
if (!animate && aTab.closing) {
@@ -4198,6 +4245,7 @@
@@ -4198,6 +4246,7 @@
isLastTab ||
aTab.pinned ||
aTab.hidden ||
@ -122,7 +130,7 @@ index c89ae2cbb978d6218bd56a059c5ca1e371231607..f86d0e4e32988ce0b498ace83a9fcd9b
this._removingTabs.size >
3 /* don't want lots of concurrent animations */ ||
!aTab.hasAttribute(
@@ -5131,10 +5179,10 @@
@@ -5131,10 +5180,10 @@
SessionStore.deleteCustomTabValue(aTab, "hiddenBy");
},
@ -135,7 +143,15 @@ index c89ae2cbb978d6218bd56a059c5ca1e371231607..f86d0e4e32988ce0b498ace83a9fcd9b
aTab.selected ||
aTab.closing ||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
@@ -7870,7 +7918,7 @@ var TabContextMenu = {
@@ -7050,6 +7099,7 @@
aWebProgress.isTopLevel
) {
this.mTab.setAttribute("busy", "true");
+ if (!this.mTab.selected) this.mTab.setAttribute("unread", "true");
gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected;
gBrowser.syncThrobberAnimations(this.mTab);
@@ -7870,7 +7920,7 @@ var TabContextMenu = {
);
contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !multiselectionContext;