diff --git a/browser/base/content/aboutNetError.xhtml b/browser/base/content/aboutNetError.xhtml index 1df2101a5ff7..daebab3656bb 100644 --- a/browser/base/content/aboutNetError.xhtml +++ b/browser/base/content/aboutNetError.xhtml @@ -351,6 +351,9 @@ function initPageCertError() { document.body.className = "certerror"; document.title = document.getElementById("certErrorPageTitle").textContent; + for (let host of document.querySelectorAll(".hostname")) { + host.textContent = document.location.hostname; + } setupAdvancedButton(true); diff --git a/browser/base/content/test/general/browser_aboutCertError.js b/browser/base/content/test/general/browser_aboutCertError.js index 8801f16b8334..93651f55bae7 100644 --- a/browser/base/content/test/general/browser_aboutCertError.js +++ b/browser/base/content/test/general/browser_aboutCertError.js @@ -217,7 +217,7 @@ add_task(function* checkWrongSystemTimeWarning() { }); add_task(function* checkAdvancedDetails() { - info("Loading a bad cert page and verifying the advanced details section"); + info("Loading a bad cert page and verifying the main error and advanced details section"); let browser; let certErrorLoaded; yield BrowserTestUtils.openNewForegroundTab(gBrowser, () => { @@ -231,6 +231,11 @@ add_task(function* checkAdvancedDetails() { let message = yield ContentTask.spawn(browser, null, function* () { let doc = content.document; + let shortDescText = doc.getElementById("errorShortDescText"); + info("Main error text: " + shortDescText.textContent); + ok(shortDescText.textContent.includes("expired.example.com"), + "Should list hostname in error message."); + let advancedButton = doc.getElementById("advancedButton"); advancedButton.click(); let el = doc.getElementById("errorCode");