From 4f0e7daa138754bdeb513283dfc2d0b65db4bea6 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Sun, 15 Mar 2026 12:45:53 +0100 Subject: [PATCH] feat: Dont show reset line if the location is empty, b=no-bug, c=tabs --- src/browser/base/content/browser-js.patch | 4 ++-- src/zen/tabs/ZenPinnedTabManager.mjs | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/browser/base/content/browser-js.patch b/src/browser/base/content/browser-js.patch index 59540592d..b9dd6c2d9 100644 --- a/src/browser/base/content/browser-js.patch +++ b/src/browser/base/content/browser-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js -index e2e0526a0ddd617291f1f6c17bcfb807954b481f..c3d2afff6eaa788309d1c1a7fa40f9b8b4f0fffe 100644 +index e2e0526a0ddd617291f1f6c17bcfb807954b481f..1373fe072b3c74a52413859d4ad3612cbe1a2bda 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -33,6 +33,7 @@ ChromeUtils.defineESModuleGetters(this, { @@ -28,7 +28,7 @@ index e2e0526a0ddd617291f1f6c17bcfb807954b481f..c3d2afff6eaa788309d1c1a7fa40f9b8 AboutReaderParent.updateReaderButton(gBrowser.selectedBrowser); TranslationsParent.onLocationChange(gBrowser.selectedBrowser); -+ gZenPinnedTabManager.onLocationChange(gBrowser.selectedBrowser); ++ gZenPinnedTabManager.onLocationChange(gBrowser.selectedBrowser, location); + PictureInPicture.updateUrlbarToggle(gBrowser.selectedBrowser); diff --git a/src/zen/tabs/ZenPinnedTabManager.mjs b/src/zen/tabs/ZenPinnedTabManager.mjs index b2df35b68..5c3e50681 100644 --- a/src/zen/tabs/ZenPinnedTabManager.mjs +++ b/src/zen/tabs/ZenPinnedTabManager.mjs @@ -818,8 +818,15 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature { } } - onLocationChange(browser) { - const tab = gBrowser.getTabForBrowser(browser); + onLocationChange(aBrowser, aLocation) { + if ( + (aLocation == "about:blank" && + BrowserUIUtils.checkEmptyPageOrigin(aBrowser)) || + aLocation == "" + ) { + return; + } + const tab = gBrowser.getTabForBrowser(aBrowser); if ( !tab || !tab.pinned || @@ -830,7 +837,7 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature { } // Remove # and ? from the URL const pinUrl = tab._zenPinnedInitialState.entry.url.split("#")[0]; - const currentUrl = browser.currentURI.spec.split("#")[0]; + const currentUrl = aLocation.split("#")[0]; // Add an indicator that the pin has been changed if (pinUrl === currentUrl) { this.resetPinChangedUrl(tab);