feat: Dont show reset line if the location is empty, b=no-bug, c=tabs

This commit is contained in:
mr. m
2026-03-15 12:45:53 +01:00
parent c6e8b0d3d9
commit 4f0e7daa13
2 changed files with 12 additions and 5 deletions

View File

@@ -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);

View File

@@ -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);