From bd954c130c278cec04e9ef6e636b00408d450134 Mon Sep 17 00:00:00 2001 From: goodusername123 <61405538+goodusername123@users.noreply.github.com> Date: Sun, 13 Oct 2024 03:26:27 -0500 Subject: [PATCH] Restore "unread" tab Attribute This restore the `unread` tab Attribute that was removed all the way back in Firefox 61. This is useful for theming since it allows custom CSS styling for tabs that has been opened in the background but haven't been actually viewed yet. https://bugzilla.mozilla.org/show_bug.cgi?id=1453957 --- browser/components/tabbrowser/content/tabbrowser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js index c3ca2e04f8052..4f3294a768a00 100644 --- a/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js @@ -1312,6 +1312,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()) { @@ -6997,6 +6998,9 @@ this.mTab.setAttribute("bursting", "true"); } + + if (!this.mTab.selected) + this.mTab.setAttribute("unread", "true"); } if (this.mTab.hasAttribute("progress")) {