From af75d67b307a31e6b7733fabf0ce1c6b92c45b86 Mon Sep 17 00:00:00 2001 From: Mauro Balades Date: Mon, 12 Aug 2024 10:18:00 +0200 Subject: [PATCH] chore: Refactor Zen theme modifier, fix notification deck placement, and update tab styling --- .../content/browser-siteProtections-js.patch | 32 ------------------- src/browser/base/content/zenThemeModifier.js | 2 +- .../tabbrowser/content/tabbrowser-js.patch | 14 ++++++-- 3 files changed, 12 insertions(+), 36 deletions(-) delete mode 100644 src/browser/base/content/browser-siteProtections-js.patch diff --git a/src/browser/base/content/browser-siteProtections-js.patch b/src/browser/base/content/browser-siteProtections-js.patch deleted file mode 100644 index 0c0137514..000000000 --- a/src/browser/base/content/browser-siteProtections-js.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/browser/base/content/browser-siteProtections.js b/browser/base/content/browser-siteProtections.js -index 5364aa74cd938141e85e3a3333e8d1fa58ea3ae4..5cd1748a883b19caa2977c1047d51b9551686bf4 100644 ---- a/browser/base/content/browser-siteProtections.js -+++ b/browser/base/content/browser-siteProtections.js -@@ -1904,9 +1904,14 @@ var gProtectionsHandler = { - // the information contained there would mostly be broken and/or - // irrelevant anyway. - this._trackingProtectionIconContainer.hidden = true; -+ // ZEN: We make a clear distinction between native UI and websites for security reasons. -+ // we can remove the separator for websites that dont need it, like "about:*" pages, where -+ // they are safe to use. -+ this._nativeSeparatorForWebsitesContainer.hidden = true; - return; - } - this._trackingProtectionIconContainer.hidden = false; -+ this._nativeSeparatorForWebsitesContainer.hidden = false; - - // Check whether the user has added an exception for this site. - this.hasException = ContentBlockingAllowList.includes( -@@ -2882,4 +2887,12 @@ var gProtectionsHandler = { - - return messageEl; - }, -+ -+ get _nativeSeparatorForWebsitesContainer() { -+ delete this._nativeSeparatorForWebsitesContainer; -+ return (this._nativeSeparatorForWebsitesContainer = document.getElementById( -+ "zen-website-and-native-separator" -+ )); -+ }, -+ - }; diff --git a/src/browser/base/content/zenThemeModifier.js b/src/browser/base/content/zenThemeModifier.js index 52eef33d8..7acf89b3c 100644 --- a/src/browser/base/content/zenThemeModifier.js +++ b/src/browser/base/content/zenThemeModifier.js @@ -119,7 +119,7 @@ var ZenThemeModifier = { // Fix notification deck document.getElementById("zen-appcontent-navbar-container") - .appendChild(document.getElementById("tab-notification-deck")); + .appendChild(document.getElementById("tab-notification-deck-template")); gZenVerticalTabsManager.init(); gZenCompactModeManager.init(); diff --git a/src/browser/components/tabbrowser/content/tabbrowser-js.patch b/src/browser/components/tabbrowser/content/tabbrowser-js.patch index ff70cf068..a475fbfc5 100644 --- a/src/browser/components/tabbrowser/content/tabbrowser-js.patch +++ b/src/browser/components/tabbrowser/content/tabbrowser-js.patch @@ -1,8 +1,8 @@ diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js -index 2674dc2bebf436529a46d45c52cb56e86b82c03f..06d30b3e33562d8eaa04522d3719728126c59a81 100644 +index 6e7a8ca21a20626a0607d860c56e39991b4aa2b8..d998059907f2467b0648c94c54c502278e2b188d 100644 --- a/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js -@@ -3208,6 +3208,11 @@ +@@ -3214,6 +3214,11 @@ ) { tabWasReused = true; tab = this.selectedTab; @@ -14,7 +14,7 @@ index 2674dc2bebf436529a46d45c52cb56e86b82c03f..06d30b3e33562d8eaa04522d37197281 if (!tabData.pinned) { this.unpinTab(tab); } else { -@@ -3257,6 +3262,10 @@ +@@ -3263,6 +3268,10 @@ preferredRemoteType, }); @@ -25,3 +25,11 @@ index 2674dc2bebf436529a46d45c52cb56e86b82c03f..06d30b3e33562d8eaa04522d37197281 if (select) { tabToSelect = tab; } +@@ -4150,6 +4159,7 @@ + isLastTab || + aTab.pinned || + aTab.hidden || ++ true || + this._removingTabs.size > + 3 /* don't want lots of concurrent animations */ || + !aTab.hasAttribute(