tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit d0ab30a3891bdd9a32a18338a52edfbf4ff3af30
parent 6bd1f87b31e358b29a43e1f9b2c575f7472f7a7a
Author: Dale Harvey <dale@arandomurl.com>
Date:   Wed,  7 Jan 2026 18:56:30 +0000

Bug 2008932 - Switch trustpanel to use etld+1. r=emz,urlbar-reviewers,dao

Differential Revision: https://phabricator.services.mozilla.com/D277779

Diffstat:
Mbrowser/base/content/browser-trustPanel.js | 5++++-
Mbrowser/components/urlbar/tests/browser/browser_trust_panel.js | 18++++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/browser/base/content/browser-trustPanel.js b/browser/base/content/browser-trustPanel.js @@ -5,6 +5,7 @@ /* import-globals-from browser-siteProtections.js */ ChromeUtils.defineESModuleGetters(this, { + BrowserUtils: "resource://gre/modules/BrowserUtils.sys.mjs", ContentBlockingAllowList: "resource://gre/modules/ContentBlockingAllowList.sys.mjs", E10SUtils: "resource://gre/modules/E10SUtils.sys.mjs", @@ -324,7 +325,9 @@ class TrustPanel { } async #updatePopup() { - this.#host = window.gIdentityHandler.getHostForDisplay(); + this.#host = BrowserUtils.formatURIForDisplay(this.#uri, { + onlyBaseDomain: true, + }); this.#popup.setAttribute( "connection", this.#isSecurePage() ? "secure" : "not-secure" diff --git a/browser/components/urlbar/tests/browser/browser_trust_panel.js b/browser/components/urlbar/tests/browser/browser_trust_panel.js @@ -230,3 +230,21 @@ add_task(async function test_update() { BrowserTestUtils.removeTab(tab); }); + +add_task(async function test_etld() { + const tab = await BrowserTestUtils.openNewForegroundTab({ + gBrowser, + opening: "https://www.example.com", + waitForLoad: true, + }); + + await UrlbarTestUtils.openTrustPanel(window); + + Assert.equal( + window.document.getElementById("trustpanel-popup-host").value, + "example.com", + "Showing the eTLD+1" + ); + + await BrowserTestUtils.removeTab(tab); +});