From 56e2f5584b7d3993db74a3852ef731b834ec1931 Mon Sep 17 00:00:00 2001 From: Johann Hofmann Date: Tue, 16 Oct 2018 18:50:37 +0000 Subject: [PATCH] Bug 1492943 - Part 2 - Update copy for HSTS certificate errors. r=nhnt11 Copy changes as outlined in https://docs.google.com/document/d/18mKAiSSLRTVcjJ1C9rIMQRnQ7eMwqqXPPN0xIyW6DDI/edit?ts=5bbfbfbb# - New heading - Slightly updated description - Replace "More..." with "More Information" - Remove the "Recommended" label on the return button Differential Revision: https://phabricator.services.mozilla.com/D8831 --HG-- extra : moz-landing-system : lando --- browser/base/content/aboutNetError-new.xhtml | 7 ++++++ browser/base/content/aboutNetError.js | 23 +++++++++++++++---- .../browser_misused_characters_in_strings.js | 4 ++++ .../en-US/chrome/overrides/netError.dtd | 3 +++ browser/themes/shared/aboutNetError-new.css | 4 ++-- 5 files changed, 34 insertions(+), 7 deletions(-) diff --git a/browser/base/content/aboutNetError-new.xhtml b/browser/base/content/aboutNetError-new.xhtml index 0295acbd3d3c..b24ba55ed52d 100644 --- a/browser/base/content/aboutNetError-new.xhtml +++ b/browser/base/content/aboutNetError-new.xhtml @@ -32,6 +32,7 @@
&certerror.pagetitle2; + &certerror.sts.pagetitle; &captivePortal.title; &dnsNotFound.pageTitle; &malformedURI.pageTitle; @@ -60,6 +61,7 @@

&unsafeContentType.title;

&nssFailure2.title;

&certerror.longpagetitle2;

+

&certerror.sts.longpagetitle;

&cspBlocked.title;

&remoteXUL.title;

&corruptedContentErrorv2.title;

@@ -91,6 +93,7 @@
&unsafeContentType.longDesc;
&nssFailure2.longDesc2;
&certerror.introPara2;
+
&certerror.sts.introPara;
&cspBlocked.longDesc;
&remoteXUL.longDesc;
&corruptedContentErrorv2.longDesc;
@@ -116,6 +119,10 @@
&certerror.badCertDomain.whatCanYouDoAboutIt;
&certerror.badCertDomain.whatCanYouDoAboutIt;
+ + &returnToPreviousPage.label;
diff --git a/browser/base/content/aboutNetError.js b/browser/base/content/aboutNetError.js index ba0f764da8fd..ccf9358e26ac 100644 --- a/browser/base/content/aboutNetError.js +++ b/browser/base/content/aboutNetError.js @@ -128,6 +128,10 @@ function disallowCertOverridesIfNeeded() { } if (cssClass == "badStsCert") { document.getElementById("badStsCertExplanation").removeAttribute("hidden"); + + let stsReturnButtonText = document.getElementById("stsReturnButtonText").textContent; + document.getElementById("returnButton").textContent = stsReturnButtonText; + document.getElementById("advancedPanelReturnButton").textContent = stsReturnButtonText; } } @@ -152,15 +156,25 @@ function initPage() { err = "captivePortal"; } - let pageTitle = document.getElementById("ept_" + err); + let l10nErrId = err; + let className = getCSSClass(); + if (className) { + document.body.classList.add(className); + } + + if (gIsCertError && className == "badStsCert") { + l10nErrId += "_sts"; + } + + let pageTitle = document.getElementById("ept_" + l10nErrId); if (pageTitle) { document.title = pageTitle.textContent; } // if it's an unknown error or there's no title or description // defined, get the generic message - var errTitle = document.getElementById("et_" + err); - var errDesc = document.getElementById("ed_" + err); + var errTitle = document.getElementById("et_" + l10nErrId); + var errDesc = document.getElementById("ed_" + l10nErrId); if (!errTitle || !errDesc) { errTitle = document.getElementById("et_generic"); errDesc = document.getElementById("ed_generic"); @@ -208,7 +222,6 @@ function initPage() { var errContainer = document.getElementById("errorContainer"); errContainer.remove(); - var className = getCSSClass(); if (className && className != "expertBadCert") { // Associate a CSS class with the root of the page, if one was passed in, // to allow custom styling. @@ -322,7 +335,7 @@ function initPageCaptivePortal() { } function initPageCertError() { - document.body.className = "certerror"; + document.body.classList.add("certerror"); for (let host of document.querySelectorAll(".hostname")) { host.textContent = document.location.hostname; } diff --git a/browser/base/content/test/static/browser_misused_characters_in_strings.js b/browser/base/content/test/static/browser_misused_characters_in_strings.js index 694fb6d738f9..7c5374bf8fd1 100644 --- a/browser/base/content/test/static/browser_misused_characters_in_strings.js +++ b/browser/base/content/test/static/browser_misused_characters_in_strings.js @@ -16,6 +16,10 @@ let gWhitelist = [{ file: "netError.dtd", key: "certerror.introPara2", type: "single-quote", + }, { + file: "netError.dtd", + key: "certerror.sts.introPara", + type: "single-quote", }, { file: "netError.dtd", key: "certerror.expiredCert.whatCanYouDoAboutIt2", diff --git a/browser/locales/en-US/chrome/overrides/netError.dtd b/browser/locales/en-US/chrome/overrides/netError.dtd index fb49269afe60..8cc8199bd7e4 100644 --- a/browser/locales/en-US/chrome/overrides/netError.dtd +++ b/browser/locales/en-US/chrome/overrides/netError.dtd @@ -150,11 +150,13 @@ + has configured their website improperly. To protect your information from being stolen, &brandShortName; has not connected to this website."> . If you visit this site, attackers could try to steal information like your passwords, emails, or credit card details."> + because this website requires a secure connection."> @@ -214,6 +216,7 @@ was trying to connect. --> +