Bug 1734217 - Migrate aboutNetError from DTD to Fluent. r=fluent-reviewers,prathiksha,flod

To support and enable the migration, quite a bit of refactoring is needed.

Many of the localised error messages are in fact fragments of HTML, including messages with nesting not supported by Fluent. In the FTL, these have each been split up into multiple messages using a custom migration transform (included directly in the script). This allows for localisers to work with the messages without HTML syntax, but does require the messages' structures to be maintained elsewhere. To that effect, the JS file represents messages as arrays of `[tagName, l10nId, l10nArgs]` tuples from which it builds the messages' elements. This fixex bug 1621895.

Though extensive, the refactoring done here is for the most part limited to what's required by the Fluent migration. For instance, not all issues raised in bug 1722896 are resolved here. Places where the structure was sufficiently messy to have introduced bugs or dead code have been cleaned up a bit, though.

This variant of netError that's used by the browser is not itself overridden by anyone else, which allows for it to be tackled first and independently of the docshell and mobile variants. As a part of its content is still passed in as a query parameter, it's possible that later refactors of the rest of the netError system will allow for further clean-up here.

Differential Revision: https://phabricator.services.mozilla.com/D155951
This commit is contained in:
Eemeli Aro 2022-10-07 18:40:27 +00:00
parent c09f207391
commit ed0c600d94
14 changed files with 1468 additions and 797 deletions

View file

@ -117,7 +117,7 @@ class NetErrorChild extends RemotePageChild {
let span = doc.createElement("span");
span.appendChild(link);
doc.l10n.setAttributes(span, "dns-not-found-with-suggestion", {
doc.l10n.setAttributes(span, "neterror-dns-not-found-with-suggestion", {
hostAndPath: displayHost + pathQueryRef,
});

File diff suppressed because it is too large Load diff

View file

@ -1,17 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html [
<!ENTITY % htmlDTD
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%htmlDTD;
<!ENTITY % netErrorDTD
SYSTEM "chrome://browser/locale/netError.dtd">
%netErrorDTD;
<!ENTITY % globalDTD
SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
]>
<!DOCTYPE html>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
@ -21,7 +10,7 @@
<head>
<meta http-equiv="Content-Security-Policy" content="default-src chrome:; object-src 'none'" />
<meta name="color-scheme" content="light dark" />
<title>&loadError.label;</title>
<title data-l10n-id="neterror-page-title"></title>
<link rel="stylesheet" href="chrome://browser/skin/aboutNetError.css" type="text/css" media="all" />
<link rel="icon" id="favicon"/>
<link rel="localization" href="browser/aboutCertError.ftl" />
@ -30,94 +19,13 @@
<link rel="localization" href="browser/netError.ftl"/>
</head>
<body dir="&locale.dir;">
<!-- ERROR ITEM CONTAINER (removed during loading to avoid bug 39098) -->
<div id="errorContainer">
<div id="errorPageTitlesContainer">
<span id="ept_nssBadCert">&certerror.pagetitle2;</span>
<span id="ept_nssBadCert_sts">&certerror.sts.pagetitle;</span>
<span id="ept_captivePortal">&captivePortal.title;</span>
<span id="ept_dnsNotFound" data-l10n-id="dns-not-found-title"></span>
<span id="ept_malformedURI">&malformedURI.pageTitle;</span>
<span id="ept_blockedByPolicy">&blockedByPolicy.title;</span>
</div>
<div id="errorDescriptionsContainer">
<div id="ed_generic">&generic.longDesc;</div>
<div id="ed_captivePortal">&captivePortal.longDesc2;</div>
<div id="ed_dnsNotFound">
<span data-l10n-id="dns-not-found-hint-header"></span>
<ul>
<li data-l10n-id="dns-not-found-hint-try-again"></li>
<li data-l10n-id="dns-not-found-hint-check-network"></li>
<li data-l10n-id="dns-not-found-hint-firewall"></li>
</ul>
</div>
<div id="ed_fileNotFound">&fileNotFound.longDesc;</div>
<div id="ed_fileAccessDenied">&fileAccessDenied.longDesc;</div>
<div id="ed_malformedURI"></div>
<div id="ed_unknownProtocolFound">&unknownProtocolFound.longDesc;</div>
<div id="ed_connectionFailure">&connectionFailure.longDesc;</div>
<div id="ed_netTimeout">&netTimeout.longDesc;</div>
<div id="ed_redirectLoop">&redirectLoop.longDesc;</div>
<div id="ed_unknownSocketType">&unknownSocketType.longDesc;</div>
<div id="ed_netReset">&netReset.longDesc;</div>
<div id="ed_notCached">&notCached.longDesc;</div>
<div id="ed_netOffline">&netOffline.longDesc2;</div>
<div id="ed_netInterrupt">&netInterrupt.longDesc;</div>
<div id="ed_deniedPortAccess">&deniedPortAccess.longDesc;</div>
<div id="ed_proxyResolveFailure">&proxyResolveFailure.longDesc;</div>
<div id="ed_proxyConnectFailure">&proxyConnectFailure.longDesc;</div>
<div id="ed_contentEncodingError">&contentEncodingError.longDesc;</div>
<div id="ed_unsafeContentType">&unsafeContentType.longDesc;</div>
<div id="ed_nssFailure2">&nssFailure2.longDesc2;</div>
<div id="ed_nssBadCert">&certerror.introPara2;</div>
<div id="ed_nssBadCert_sts">&certerror.sts.introPara;</div>
<div id="ed_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE">&certerror.expiredCert.introPara;</div>
<div id="ed_mitm">&certerror.mitm.longDesc;</div>
<div id="ed_cspBlocked">&cspBlocked.longDesc;</div>
<div id="ed_xfoBlocked">&xfoBlocked.longDesc;</div>
<div id="ed_corruptedContentErrorv2">&corruptedContentErrorv2.longDesc;</div>
<div id="ed_sslv3Used">&sslv3Used.longDesc2;</div>
<div id="ed_inadequateSecurityError">&inadequateSecurityError.longDesc;</div>
<div id="ed_blockedByPolicy"></div>
<div id="ed_clockSkewError">&clockSkewError.longDesc;</div>
<div id="ed_networkProtocolError">&networkProtocolError.longDesc;</div>
</div>
<div id="errorDescriptions2Container">
<div id="ed2_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE">&certerror.expiredCert.secondPara2;</div>
<div id="ed2_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE_sts">&certerror.expiredCert.sts.secondPara;</div>
</div>
<div id="whatCanYouDoAboutItTitleContainer">
<div id="edd_nssBadCert"><strong>&certerror.whatCanYouDoAboutItTitle;</strong></div>
</div>
<div id="whatCanYouDoAboutItContainer">
<div id="es_nssBadCert_SEC_ERROR_UNKNOWN_ISSUER">&certerror.unknownIssuer.whatCanYouDoAboutIt;</div>
<div id="es_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE">&certerror.expiredCert.whatCanYouDoAboutIt2;</div>
<div id="es_nssBadCert_SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE">&certerror.expiredCert.whatCanYouDoAboutIt2;</div>
<div id="es_nssBadCert_MOZILLA_PKIX_ERROR_NOT_YET_VALID_CERTIFICATE">&certerror.expiredCert.whatCanYouDoAboutIt2;</div>
<div id="es_nssBadCert_MOZILLA_PKIX_ERROR_NOT_YET_VALID_ISSUER_CERTIFICATE">&certerror.expiredCert.whatCanYouDoAboutIt2;</div>
<div id="es_nssBadCert_SSL_ERROR_BAD_CERT_DOMAIN">&certerror.badCertDomain.whatCanYouDoAboutIt;</div>
<div id="es_nssBadCert_MOZILLA_PKIX_ERROR_MITM_DETECTED">
<ul>
<li>&certerror.mitm.whatCanYouDoAboutIt1;</li>
<li>&certerror.mitm.whatCanYouDoAboutIt2;</li>
<li id="mitmWhatCanYouDoAboutIt3">&certerror.mitm.whatCanYouDoAboutIt3;</li>
</ul>
</div>
</div>
<!-- Stores an alternative text for when we don't want to add "Recommended" to the
return button. This is one of many l10n atrocities in this file and should be
removed when we finally switch to Fluent. -->
<span id="stsReturnButtonText">&returnToPreviousPage.label;</span>
<span id="stsMitmWhatCanYouDoAboutIt3">&certerror.mitm.sts.whatCanYouDoAboutIt3;</span>
</div>
<body>
<!-- PAGE CONTAINER (for styling purposes only) -->
<div id="errorPageContainer" class="container">
<div id="text-container">
<!-- Error Title -->
<div class="title">
<h1 class="title-text"/>
<h1 class="title-text"></h1>
</div>
<!-- LONG CONTENT (the section most likely to require scrolling) -->
@ -125,36 +33,29 @@
<!-- Short Description -->
<div id="errorShortDesc">
<p id="errorShortDescText" />
<p id="errorShortDescText"></p>
</div>
<div id="errorShortDesc2">
<p id="errorShortDescText2" />
<p id="errorShortDescText2"></p>
</div>
<div id="errorWhatToDoTitle">
<p id="errorWhatToDoTitleText" />
<p id="errorWhatToDoTitleText"></p>
</div>
<div id="errorWhatToDo">
<p id="badStsCertExplanation" hidden="true">&certerror.whatShouldIDo.badStsCertExplanation1;</p>
<p id="errorWhatToDoText" />
<p id="badStsCertExplanation" hidden="true"></p>
<p id="errorWhatToDoText"></p>
</div>
<div id="errorWhatToDo2">
<p id="errorWhatToDoText2" />
<p id="badStsCertExplanation" hidden="true">&certerror.whatShouldIDo.badStsCertExplanation1;</p>
</div>
<!-- Long Description -->
<div id="errorLongDesc"></div>
<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
<div id="errorLongDesc" />
<div id="tlsVersionNotice" hidden="true">
<p data-l10n-id="cert-error-old-tls-version"></p>
</div>
<p id="tlsVersionNotice" hidden="true"></p>
<div id="learnMoreContainer">
<p><a id="learnMoreLink" target="_blank" rel="noopener noreferrer" data-telemetry-id="learn_more_link">&errorReporting.learnMore;</a></p>
<p><a id="learnMoreLink" target="_blank" rel="noopener noreferrer" data-telemetry-id="learn_more_link" data-l10n-id="neterror-learn-more-link"></a></p>
</div>
<div id="openInNewWindowContainer" class="button-container">
@ -166,31 +67,31 @@
<!-- UI for option to report certificate errors to Mozilla. Removed on
init for other error types .-->
<div id="prefChangeContainer" class="button-container">
<p>&prefReset.longDesc;</p>
<button id="prefResetButton" class="primary">&prefReset.label;</button>
<p data-l10n-id="neterror-pref-reset"></p>
<button id="prefResetButton" class="primary" data-l10n-id="neterror-pref-reset-button"></button>
</div>
<div id="certErrorAndCaptivePortalButtonContainer" class="button-container">
<button id="returnButton" class="primary" data-telemetry-id="return_button_top">&returnToPreviousPage1.label;</button>
<button id="openPortalLoginPageButton" class="primary">&openPortalLoginPage.label2;</button>
<button class="primary try-again">&retry.label;</button>
<button id="advancedButton" data-telemetry-id="advanced_button">&advanced2.label;</button>
<button id="returnButton" class="primary" data-telemetry-id="return_button_top" data-l10n-id="neterror-return-to-previous-page-recommended-button"></button>
<button id="openPortalLoginPageButton" class="primary" data-l10n-id="neterror-open-portal-login-page-button"></button>
<button class="primary try-again" data-l10n-id="neterror-try-again-button"></button>
<button id="advancedButton" data-telemetry-id="advanced_button" data-l10n-id="neterror-advanced-button"></button>
</div>
</div>
<div id="netErrorButtonContainer" class="button-container">
<button class="primary try-again">&retry.label;</button>
<button class="primary try-again" data-l10n-id="neterror-try-again-button"></button>
</div>
<div id="advancedPanelContainer">
<div id="badCertAdvancedPanel" class="advanced-panel" hidden="">
<p id="badCertTechnicalInfo"/>
<a id="viewCertificate" href="javascript:void(0)">&viewCertificate.label;</a>
<p id="badCertTechnicalInfo"></p>
<a id="viewCertificate" href="javascript:void(0)" data-l10n-id="neterror-view-certificate-link"></a>
<div id="advancedPanelButtonContainer" class="button-container">
<button id="advancedPanelReturnButton" class="primary" data-telemetry-id="return_button_adv">&returnToPreviousPage1.label;</button>
<button class="primary try-again">&retry.label;</button>
<button id="advancedPanelReturnButton" class="primary" data-telemetry-id="return_button_adv" data-l10n-id="neterror-return-to-previous-page-recommended-button"></button>
<button class="primary try-again" data-l10n-id="neterror-try-again-button"></button>
<div class="exceptionDialogButtonContainer">
<button id="exceptionDialogButton" data-telemetry-id="exception_button">&securityOverride.exceptionButton1Label;</button>
<button id="exceptionDialogButton" data-telemetry-id="exception_button" data-l10n-id="neterror-override-exception-button"></button>
</div>
</div>
</div>
@ -198,18 +99,18 @@
<div id="blockingErrorReporting" class="advanced-panel" hidden="">
<p class="toggle-container-with-text">
<input type="checkbox" id="automaticallyReportBlockingInFuture" role="checkbox"/>
<label for="automaticallyReportBlockingInFuture" >&errorReporting.automatic2;</label>
<label for="automaticallyReportBlockingInFuture" data-l10n-id="neterror-error-reporting-automatic" ></label>
</p>
</div>
<div id="certificateErrorDebugInformation" class="advanced-panel" hidden="">
<button id="copyToClipboardTop" data-telemetry-id="clipboard_button_top">&certerror.copyToClipboard.label;</button>
<button id="copyToClipboardTop" data-telemetry-id="clipboard_button_top" data-l10n-id="neterror-copy-to-clipboard-button"></button>
<div id="certificateErrorText"/>
<button id="copyToClipboardBottom" data-telemetry-id="clipboard_button_bot">&certerror.copyToClipboard.label;</button>
<button id="copyToClipboardBottom" data-telemetry-id="clipboard_button_bot" data-l10n-id="neterror-copy-to-clipboard-button"></button>
</div>
</div>
</div>
</body>
<script src="chrome://browser/content/certerror/aboutNetErrorCodes.js"/>
<script type="module" src="chrome://browser/content/certerror/aboutNetError.js"/>
<script src="chrome://browser/content/certerror/aboutNetErrorCodes.js"></script>
<script type="module" src="chrome://browser/content/certerror/aboutNetError.js"></script>
</html>

View file

@ -163,7 +163,14 @@ add_task(async function checkAdvancedDetails() {
let message = await SpecialPowers.spawn(bc, [], async function() {
let doc = content.document;
let shortDescText = doc.getElementById("errorShortDescText");
// Wait until fluent sets the error description.
let shortDescText;
await ContentTaskUtils.waitForCondition(() => {
shortDescText = doc.getElementById("errorShortDescText");
return shortDescText.textContent != "";
}, "error description has been set");
Assert.ok(
shortDescText.textContent.includes("expired.example.com"),
"Should list hostname in error message."
@ -502,18 +509,20 @@ add_task(async function checkViewSource() {
await SpecialPowers.spawn(browser, [], async function() {
let doc = content.document;
// Wait until fluent sets the errorCode inner text.
let el;
// Wait until fluent sets the error code and description.
let errorCode;
let shortDescText;
await ContentTaskUtils.waitForCondition(() => {
el = doc.getElementById("errorCode");
return el.textContent != "";
}, "error code has been set inside the advanced button panel");
errorCode = doc.getElementById("errorCode");
shortDescText = doc.getElementById("errorShortDescText");
return errorCode.textContent != "" && shortDescText.textContent != "";
}, "error code and description have been set");
Assert.equal(
el.textContent,
errorCode.textContent,
"SEC_ERROR_EXPIRED_CERTIFICATE",
"Correct error message found"
);
Assert.equal(el.tagName, "a", "Error message is a link");
Assert.equal(errorCode.tagName, "a", "Error message is a link");
let titleText = doc.querySelector(".title-text");
Assert.equal(
@ -521,7 +530,6 @@ add_task(async function checkViewSource() {
"Warning: Potential Security Risk Ahead"
);
let shortDescText = doc.getElementById("errorShortDescText");
Assert.ok(
shortDescText.textContent.includes("expired.example.com"),
"Should list hostname in error message."

View file

@ -31,7 +31,6 @@ add_task(async function checkWrongSystemTimeWarning() {
return SpecialPowers.spawn(browser, [], async function() {
let doc = content.document;
let div = doc.getElementById("errorShortDescText");
let systemDateDiv = doc.getElementById("wrongSystemTime_systemDate1");
let learnMoreLink = doc.getElementById("learnMoreLink");
await ContentTaskUtils.waitForCondition(
@ -42,7 +41,6 @@ add_task(async function checkWrongSystemTimeWarning() {
return {
divDisplay: content.getComputedStyle(div).display,
text: div.textContent,
systemDate: systemDateDiv.textContent,
learnMoreLink: learnMoreLink.href,
};
});
@ -54,8 +52,6 @@ add_task(async function checkWrongSystemTimeWarning() {
Math.floor(Date.now() / 1000)
);
let formatter = new Intl.DateTimeFormat("default");
// For this test, we want to trick Firefox into believing that
// the local system time (as returned by Date.now()) is wrong.
// Because we don't want to actually change the local system time,
@ -73,7 +69,9 @@ add_task(async function checkWrongSystemTimeWarning() {
// date is correct by recording the difference as clock skew.
Services.prefs.setIntPref(PREF_SERVICES_SETTINGS_CLOCK_SKEW_SECONDS, skew);
let localDateFmt = formatter.format(localDate);
let localDateFmt = new Intl.DateTimeFormat("en-US", {
dateStyle: "medium",
}).format(localDate);
info("Loading a bad cert page with a skewed clock");
let message = await setUpPage();
@ -91,7 +89,7 @@ add_task(async function checkWrongSystemTimeWarning() {
message.text.includes("expired.example.com"),
"URL found in error message"
);
ok(message.systemDate.includes(localDateFmt), "Correct local date displayed");
ok(message.text.includes(localDateFmt), "Correct local date displayed");
ok(
message.learnMoreLink.includes("time-errors"),
"time-errors in the Learn More URL"

View file

@ -66,24 +66,24 @@ add_task(async function checkMitmPriming() {
"Stored the correct issuer"
);
await SpecialPowers.spawn(browser, [], () => {
let mitmName1 = content.document.querySelector(
"#errorShortDescText .mitm-name"
);
ok(
ContentTaskUtils.is_visible(mitmName1),
"Potential man in the middle is displayed"
);
is(mitmName1.textContent, "Unknown CA", "Shows the name of the issuer.");
await SpecialPowers.spawn(browser, [], async () => {
const shortDesc = content.document.querySelector("#errorShortDescText");
const whatToDo = content.document.querySelector("#errorWhatToDoText");
let mitmName2 = content.document.querySelector(
"#errorWhatToDoText .mitm-name"
await ContentTaskUtils.waitForCondition(
() => shortDesc.textContent != "" && whatToDo.textContent != "",
"DOM localization has been updated"
);
ok(
ContentTaskUtils.is_visible(mitmName2),
"Potential man in the middle is displayed"
shortDesc.textContent.includes("Unknown CA"),
"Shows the name of the issuer."
);
ok(
whatToDo.textContent.includes("Unknown CA"),
"Shows the name of the issuer."
);
is(mitmName2.textContent, "Unknown CA", "Shows the name of the issuer.");
});
BrowserTestUtils.removeTab(gBrowser.selectedTab);

View file

@ -10,56 +10,6 @@
* removed from the exceptions list, thus ensuring there are no stale
* entries. */
let gExceptionsList = [
{
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.introPara",
type: "single-quote",
},
{
file: "netError.dtd",
key: "certerror.expiredCert.whatCanYouDoAboutIt2",
type: "single-quote",
},
{
file: "netError.dtd",
key: "certerror.whatShouldIDo.badStsCertExplanation1",
type: "single-quote",
},
{
file: "netError.dtd",
key: "inadequateSecurityError.longDesc",
type: "single-quote",
},
{
file: "netError.dtd",
key: "clockSkewError.longDesc",
type: "single-quote",
},
{
file: "netError.dtd",
key: "certerror.mitm.longDesc",
type: "single-quote",
},
{
file: "netError.dtd",
key: "certerror.mitm.whatCanYouDoAboutIt3",
type: "single-quote",
},
{
file: "netError.dtd",
key: "certerror.mitm.sts.whatCanYouDoAboutIt3",
type: "single-quote",
},
{
file: "layout_errors.properties",
key: "ImageMapRectBoundsError",

View file

@ -110,4 +110,3 @@ browser.jar:
# L10n resources and overrides.
% override chrome://global/locale/appstrings.properties chrome://browser/locale/appstrings.properties
% override chrome://global/locale/netError.dtd chrome://browser/locale/netError.dtd

View file

@ -2,12 +2,144 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
## Error page titles
neterror-page-title = Problem loading page
certerror-page-title = Warning: Potential Security Risk Ahead
certerror-sts-page-title = Did Not Connect: Potential Security Issue
neterror-blocked-by-policy-page-title = Blocked Page
neterror-captive-portal-page-title = Log in to network
neterror-dns-not-found-title = Server Not Found
neterror-malformed-uri-page-title = Invalid URL
## Error page actions
neterror-advanced-button = Advanced…
neterror-copy-to-clipboard-button = Copy text to clipboard
neterror-learn-more-link = Learn more…
neterror-open-portal-login-page-button = Open Network Login Page
neterror-override-exception-button = Accept the Risk and Continue
neterror-pref-reset-button = Restore default settings
neterror-return-to-previous-page-button = Go Back
neterror-return-to-previous-page-recommended-button = Go Back (Recommended)
neterror-try-again-button = Try Again
neterror-view-certificate-link = View Certificate
##
neterror-pref-reset = It looks like your network security settings might be causing this. Do you want the default settings to be restored?
neterror-error-reporting-automatic = Report errors like this to help { -vendor-short-name } identify and block malicious sites
## Specific error messages
neterror-generic-error = { -brand-short-name } cant load this page for some reason.
neterror-load-error-try-again = The site could be temporarily unavailable or too busy. Try again in a few moments.
neterror-load-error-connection = If you are unable to load any pages, check your computers network connection.
neterror-load-error-firewall = If your computer or network is protected by a firewall or proxy, make sure that { -brand-short-name } is permitted to access the web.
neterror-captive-portal = You must log in to this network before you can access the internet.
dns-not-found-title = Server Not Found
# Variables:
# $hostAndPath (String) - a suggested site (e.g. "www.example.com") that the user may have meant instead.
dns-not-found-with-suggestion = Did you mean to go to <a data-l10n-name="website">{ $hostAndPath }</a>?
dns-not-found-hint-header = <strong>If you entered the right address, you can:</strong>
dns-not-found-hint-try-again = Try again later
dns-not-found-hint-check-network = Check your network connection
dns-not-found-hint-firewall = Check that { -brand-short-name } has permission to access the web (you might be connected but behind a firewall)
neterror-dns-not-found-with-suggestion = Did you mean to go to <a data-l10n-name="website">{ $hostAndPath }</a>?
neterror-dns-not-found-hint-header = <strong>If you entered the right address, you can:</strong>
neterror-dns-not-found-hint-try-again = Try again later
neterror-dns-not-found-hint-check-network = Check your network connection
neterror-dns-not-found-hint-firewall = Check that { -brand-short-name } has permission to access the web (you might be connected but behind a firewall)
neterror-file-not-found-filename = Check the file name for capitalization or other typing errors.
neterror-file-not-found-moved = Check to see if the file was moved, renamed or deleted.
neterror-access-denied = It may have been removed, moved, or file permissions may be preventing access.
neterror-unknown-protocol = You might need to install other software to open this address.
neterror-redirect-loop = This problem can sometimes be caused by disabling or refusing to accept cookies.
neterror-unknown-socket-type-psm-installed = Check to make sure your system has the Personal Security Manager installed.
neterror-unknown-socket-type-server-config = This might be due to a non-standard configuration on the server.
neterror-not-cached-intro = The requested document is not available in { -brand-short-name }s cache.
neterror-not-cached-sensitive = As a security precaution, { -brand-short-name } does not automatically re-request sensitive documents.
neterror-not-cached-try-again = Click Try Again to re-request the document from the website.
neterror-net-offline = Press “Try Again” to switch to online mode and reload the page.
neterror-proxy-resolve-failure-settings = Check the proxy settings to make sure that they are correct.
neterror-proxy-resolve-failure-connection = Check to make sure your computer has a working network connection.
neterror-proxy-resolve-failure-firewall = If your computer or network is protected by a firewall or proxy, make sure that { -brand-short-name } is permitted to access the web.
neterror-proxy-connect-failure-settings = Check the proxy settings to make sure that they are correct.
neterror-proxy-connect-failure-contact-admin = Contact your network administrator to make sure the proxy server is working.
neterror-content-encoding-error = Please contact the website owners to inform them of this problem.
neterror-unsafe-content-type = Please contact the website owners to inform them of this problem.
neterror-nss-failure-not-verified = The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
neterror-nss-failure-contact-website = Please contact the website owners to inform them of this problem.
# Variables:
# $hostname (String) - Hostname of the website to which the user was trying to connect.
certerror-intro = { -brand-short-name } detected a potential security threat and did not continue to <b>{ $hostname }</b>. If you visit this site, attackers could try to steal information like your passwords, emails, or credit card details.
# Variables:
# $hostname (String) - Hostname of the website to which the user was trying to connect.
certerror-sts-intro = { -brand-short-name } detected a potential security threat and did not continue to <b>{ $hostname }</b> because this website requires a secure connection.
# Variables:
# $hostname (String) - Hostname of the website to which the user was trying to connect.
certerror-expired-cert-intro = { -brand-short-name } detected an issue and did not continue to <b>{ $hostname }</b>. The website is either misconfigured or your computer clock is set to the wrong time.
# Variables:
# $hostname (String) - Hostname of the website to which the user was trying to connect.
# $mitm (String) - The name of the software intercepting communications between you and the website (or “man in the middle”)
certerror-mitm = <b>{ $hostname }</b> is most likely a safe site, but a secure connection could not be established. This issue is caused by <b>{ $mitm }</b>, which is either software on your computer or your network.
neterror-corrupted-content-intro = The page you are trying to view cannot be shown because an error in the data transmission was detected.
neterror-corrupted-content-contact-website = Please contact the website owners to inform them of this problem.
# Do not translate "SSL_ERROR_UNSUPPORTED_VERSION".
neterror-sslv3-used = Advanced info: SSL_ERROR_UNSUPPORTED_VERSION
# Variables:
# $hostname (String) - Hostname of the website to which the user was trying to connect.
neterror-inadequate-security-intro = <b>{ $hostname }</b> uses security technology that is outdated and vulnerable to attack. An attacker could easily reveal information which you thought to be safe. The website administrator will need to fix the server first before you can visit the site.
# Do not translate "NS_ERROR_NET_INADEQUATE_SECURITY".
neterror-inadequate-security-code = Error code: NS_ERROR_NET_INADEQUATE_SECURITY
# Variables:
# $hostname (String) - Hostname of the website to which the user was trying to connect.
# $now (Date) - The current datetime, to be formatted as a date
neterror-clock-skew-error = Your computer thinks it is { DATETIME($now, dateStyle: "medium") }, which prevents { -brand-short-name } from connecting securely. To visit <b>{ $hostname }</b>, update your computer clock in your system settings to the current date, time, and time zone, and then refresh <b>{ $hostname }</b>.
neterror-network-protocol-error-intro = The page you are trying to view cannot be shown because an error in the network protocol was detected.
neterror-network-protocol-error-contact-website = Please contact the website owners to inform them of this problem.
certerror-expired-cert-second-para = Its likely the websites certificate is expired, which prevents { -brand-short-name } from connecting securely. If you visit this site, attackers could try to steal information like your passwords, emails, or credit card details.
certerror-expired-cert-sts-second-para = Its likely the websites certificate is expired, which prevents { -brand-short-name } from connecting securely.
certerror-what-can-you-do-about-it-title = What can you do about it?
certerror-unknown-issuer-what-can-you-do-about-it-website = The issue is most likely with the website, and there is nothing you can do to resolve it.
certerror-unknown-issuer-what-can-you-do-about-it-contact-admin = If you are on a corporate network or using antivirus software, you can reach out to the support teams for assistance. You can also notify the websites administrator about the problem.
# Variables:
# $hostname (String) - Hostname of the website to which the user was trying to connect.
# $now (Date) - The current datetime, to be formatted as a date
certerror-expired-cert-what-can-you-do-about-it-clock = Your computer clock is set to { DATETIME($now, dateStyle: "medium") }. Make sure your computer is set to the correct date, time, and time zone in your system settings, and then refresh <b>{ $hostname }</b>.
certerror-expired-cert-what-can-you-do-about-it-contact-website = If your clock is already set to the right time, the website is likely misconfigured, and there is nothing you can do to resolve the issue. You can notify the websites administrator about the problem.
certerror-bad-cert-domain-what-can-you-do-about-it = The issue is most likely with the website, and there is nothing you can do to resolve it. You can notify the websites administrator about the problem.
certerror-mitm-what-can-you-do-about-it-antivirus = If your antivirus software includes a feature that scans encrypted connections (often called “web scanning” or “https scanning”), you can disable that feature. If that doesnt work, you can remove and reinstall the antivirus software.
certerror-mitm-what-can-you-do-about-it-corporate = If you are on a corporate network, you can contact your IT department.
# Variables:
# $mitm (String) - The name of the software intercepting communications between you and the website (or “man in the middle”)
certerror-mitm-what-can-you-do-about-it-attack = If you are not familiar with <b>{ $mitm }</b>, then this could be an attack and you should not continue to the site.
# Variables:
# $mitm (String) - The name of the software intercepting communications between you and the website (or “man in the middle”)
certerror-mitm-what-can-you-do-about-it-attack-sts = If you are not familiar with <b>{ $mitm }</b>, then this could be an attack, and there is nothing you can do to access the site.
# Variables:
# $hostname (String) - Hostname of the website to which the user was trying to connect.
certerror-what-should-i-do-bad-sts-cert-explanation = <b>{ $hostname }</b> has a security policy called HTTP Strict Transport Security (HSTS), which means that { -brand-short-name } can only connect to it securely. You cant add an exception to visit this site.

View file

@ -1,192 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%brandDTD;
<!ENTITY loadError.label "Problem loading page">
<!ENTITY retry.label "Try Again">
<!ENTITY returnToPreviousPage.label "Go Back">
<!ENTITY returnToPreviousPage1.label "Go Back (Recommended)">
<!ENTITY advanced2.label "Advanced…">
<!ENTITY viewCertificate.label "View Certificate">
<!-- Specific error messages -->
<!ENTITY connectionFailure.longDesc "&sharedLongDesc;">
<!ENTITY deniedPortAccess.longDesc "">
<!ENTITY fileNotFound.longDesc "
<ul>
<li>Check the file name for capitalization or other typing errors.</li>
<li>Check to see if the file was moved, renamed or deleted.</li>
</ul>
">
<!ENTITY fileAccessDenied.longDesc "
<ul>
<li>It may have been removed, moved, or file permissions may be preventing access.</li>
</ul>
">
<!ENTITY generic.longDesc "
<p>&brandShortName; cant load this page for some reason.</p>
">
<!ENTITY captivePortal.title "Log in to network">
<!ENTITY captivePortal.longDesc2 "
<p>You must log in to this network before you can access the Internet.</p>
">
<!ENTITY openPortalLoginPage.label2 "Open Network Login Page">
<!ENTITY malformedURI.pageTitle "Invalid URL">
<!ENTITY netInterrupt.longDesc "&sharedLongDesc;">
<!ENTITY notCached.longDesc "<p>The requested document is not available in &brandShortName;s cache.</p><ul><li>As a security precaution, &brandShortName; does not automatically re-request sensitive documents.</li><li>Click Try Again to re-request the document from the website.</li></ul>">
<!ENTITY netOffline.longDesc2 "
<ul>
<li>Press &quot;Try Again&quot; to switch to online mode and reload the page.</li>
</ul>
">
<!ENTITY contentEncodingError.longDesc "
<ul>
<li>Please contact the website owners to inform them of this problem.</li>
</ul>
">
<!ENTITY unsafeContentType.longDesc "
<ul>
<li>Please contact the website owners to inform them of this problem.</li>
</ul>
">
<!ENTITY netReset.longDesc "&sharedLongDesc;">
<!ENTITY netTimeout.longDesc "&sharedLongDesc;">
<!ENTITY unknownProtocolFound.longDesc "
<ul>
<li>You might need to install other software to open this address.</li>
</ul>
">
<!ENTITY proxyConnectFailure.longDesc "
<ul>
<li>Check the proxy settings to make sure that they are correct.</li>
<li>Contact your network administrator to make sure the proxy server is
working.</li>
</ul>
">
<!ENTITY proxyResolveFailure.longDesc "
<ul>
<li>Check the proxy settings to make sure that they are correct.</li>
<li>Check to make sure your computer has a working network connection.</li>
<li>If your computer or network is protected by a firewall or proxy, make sure
that &brandShortName; is permitted to access the Web.</li>
</ul>
">
<!ENTITY redirectLoop.longDesc "
<ul>
<li>This problem can sometimes be caused by disabling or refusing to accept
cookies.</li>
</ul>
">
<!ENTITY unknownSocketType.longDesc "
<ul>
<li>Check to make sure your system has the Personal Security Manager
installed.</li>
<li>This might be due to a non-standard configuration on the server.</li>
</ul>
">
<!ENTITY nssFailure2.longDesc2 "
<ul>
<li>The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.</li>
<li>Please contact the website owners to inform them of this problem.</li>
</ul>
">
<!-- Localization note (certerror.introPara2) - The text content of the span tag
will be replaced at runtime with the name of the server to which the user
was trying to connect. -->
<!ENTITY certerror.introPara2 "&brandShortName; detected a potential security threat and did not continue to <span class='hostname'/>. If you visit this site, attackers could try to steal information like your passwords, emails, or credit card details.">
<!ENTITY certerror.sts.introPara "&brandShortName; detected a potential security threat and did not continue to <span class='hostname'/> because this website requires a secure connection.">
<!ENTITY certerror.expiredCert.introPara "&brandShortName; detected an issue and did not continue to <span class='hostname'/>. The website is either misconfigured or your computer clock is set to the wrong time.">
<!ENTITY certerror.expiredCert.secondPara2 "Its likely the websites certificate is expired, which prevents &brandShortName; from connecting securely. If you visit this site, attackers could try to steal information like your passwords, emails, or credit card details.">
<!ENTITY certerror.expiredCert.sts.secondPara "Its likely the websites certificate is expired, which prevents &brandShortName; from connecting securely.">
<!ENTITY certerror.whatCanYouDoAboutItTitle "What can you do about it?">
<!ENTITY certerror.unknownIssuer.whatCanYouDoAboutIt "
<p>The issue is most likely with the website, and there is nothing you can do to resolve it.</p>
<p>If you are on a corporate network or using anti-virus software, you can reach out to the support teams for assistance. You can also notify the websites administrator about the problem.</p>
">
<!ENTITY certerror.expiredCert.whatCanYouDoAboutIt2 "
<p>Your computer clock is set to <span id='wrongSystemTime_systemDate2'/>. Make sure your computer is set to the correct date, time, and time zone in your system settings, and then refresh <span class='hostname'/>.</p>
<p>If your clock is already set to the right time, the website is likely misconfigured, and there is nothing you can do to resolve the issue. You can notify the websites administrator about the problem.</p>
">
<!ENTITY certerror.badCertDomain.whatCanYouDoAboutIt "
<p>The issue is most likely with the website, and there is nothing you can do to resolve it. You can notify the websites administrator about the problem.</p>
">
<!ENTITY sharedLongDesc "
<ul>
<li>The site could be temporarily unavailable or too busy. Try again in a few
moments.</li>
<li>If you are unable to load any pages, check your computers network
connection.</li>
<li>If your computer or network is protected by a firewall or proxy, make sure
that &brandShortName; is permitted to access the Web.</li>
</ul>
">
<!ENTITY cspBlocked.longDesc "<p>&brandShortName; prevented this page from loading in this way because the page has a content security policy that disallows it.</p>">
<!ENTITY xfoBlocked.longDesc "<p>&brandShortName; prevented this page from loading in this context because the page has an X-Frame-Options policy that disallows it.</p>">
<!ENTITY corruptedContentErrorv2.longDesc "<p>The page you are trying to view cannot be shown because an error in the data transmission was detected.</p><ul><li>Please contact the website owners to inform them of this problem.</li></ul>">
<!ENTITY securityOverride.exceptionButton1Label "Accept the Risk and Continue">
<!ENTITY errorReporting.automatic2 "Report errors like this to help Mozilla identify and block malicious sites">
<!ENTITY errorReporting.learnMore "Learn more…">
<!-- LOCALIZATION NOTE (sslv3Used.longDesc2) - Do not translate
"SSL_ERROR_UNSUPPORTED_VERSION". -->
<!ENTITY sslv3Used.longDesc2 "Advanced info: SSL_ERROR_UNSUPPORTED_VERSION">
<!ENTITY certerror.pagetitle2 "Warning: Potential Security Risk Ahead">
<!ENTITY certerror.sts.pagetitle "Did Not Connect: Potential Security Issue">
<!ENTITY certerror.whatShouldIDo.badStsCertExplanation1 "<span class='hostname'></span> has a security policy called HTTP Strict Transport Security (HSTS), which means that &brandShortName; can only connect to it securely. You cant add an exception to visit this site.">
<!ENTITY certerror.copyToClipboard.label "Copy text to clipboard">
<!-- LOCALIZATION NOTE (inadequateSecurityError.longDesc) - Do not translate
"NS_ERROR_NET_INADEQUATE_SECURITY". -->
<!ENTITY inadequateSecurityError.longDesc "<p><span class='hostname'></span> uses security technology that is outdated and vulnerable to attack. An attacker could easily reveal information which you thought to be safe. The website administrator will need to fix the server first before you can visit the site.</p><p>Error code: NS_ERROR_NET_INADEQUATE_SECURITY</p>">
<!ENTITY blockedByPolicy.title "Blocked Page">
<!ENTITY certerror.mitm.longDesc "<span class='hostname'></span> is most likely a safe site, but a secure connection could not be established. This issue is caused by <span class='mitm-name'/>, which is either software on your computer or your network.">
<!ENTITY certerror.mitm.whatCanYouDoAboutIt1 "If your antivirus software includes a feature that scans encrypted connections (often called “web scanning” or “https scanning”), you can disable that feature. If that doesnt work, you can remove and reinstall the antivirus software.">
<!ENTITY certerror.mitm.whatCanYouDoAboutIt2 "If you are on a corporate network, you can contact your IT department.">
<!ENTITY certerror.mitm.whatCanYouDoAboutIt3 "If you are not familiar with <span class='mitm-name'/>, then this could be an attack and you should not continue to the site.">
<!ENTITY certerror.mitm.sts.whatCanYouDoAboutIt3 "If you are not familiar with <span class='mitm-name'/>, then this could be an attack, and there is nothing you can do to access the site.">
<!ENTITY clockSkewError.longDesc "Your computer thinks it is <span id='wrongSystemTime_systemDate1'/>, which prevents &brandShortName; from connecting securely. To visit <span class='hostname'></span>, update your computer clock in your system settings to the current date, time, and time zone, and then refresh <span class='hostname'></span>.">
<!ENTITY prefReset.longDesc "It looks like your network security settings might be causing this. Do you want the default settings to be restored?">
<!ENTITY prefReset.label "Restore default settings">
<!ENTITY networkProtocolError.longDesc "<p>The page you are trying to view cannot be shown because an error in the network protocol was detected.</p><ul><li>Please contact the website owners to inform them of this problem.</li></ul>">

View file

@ -38,7 +38,6 @@
locale/browser/syncSetup.properties (%chrome/browser/syncSetup.properties)
% locale browser-region @AB_CD@ %locale/browser-region/
# the following files are browser-specific overrides
locale/browser/netError.dtd (%chrome/overrides/netError.dtd)
locale/browser/appstrings.properties (%chrome/overrides/appstrings.properties)
#ifdef XPI_NAME

View file

@ -60,6 +60,10 @@ button:disabled {
margin-top: 2em;
}
#errorWhatToDoTitle .bold {
font-weight: bold;
}
#prefChangeContainer {
display: none;
}
@ -149,11 +153,6 @@ body:not(.neterror) #advancedButton {
max-width: var(--in-content-container-max-width);
}
.mitm-name,
#hostname {
font-weight: bold;
}
#errorCode {
white-space: nowrap;
}

View file

@ -50,13 +50,12 @@ void DOMSecurityMonitor::AuditParsingOfHTMLXMLFragments(
/*
* WARNING: Do not add any new entries to the htmlFragmentAllowlist
* withiout proper review from a dom:security peer!
* without proper review from a dom:security peer!
*/
static nsLiteralCString htmlFragmentAllowlist[] = {
"chrome://global/content/elements/marquee.js"_ns,
nsLiteralCString(
"chrome://pocket/content/panels/js/vendor/jquery-2.1.1.min.js"),
"chrome://browser/content/certerror/aboutNetError.js"_ns,
nsLiteralCString("chrome://devtools/content/shared/sourceeditor/"
"codemirror/codemirror.bundle.js"),
nsLiteralCString(

View file

@ -0,0 +1,795 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from __future__ import absolute_import
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import TERM_REFERENCE, transforms_from, VARIABLE_REFERENCE
from fluent.migrate.transforms import (
COPY,
LegacySource,
REPLACE,
REPLACE_IN_TEXT,
Transform,
)
import re
class MATCH(LegacySource):
"""Custom transform for extracting parts of a netError.dtd message.
`start` and `end` are not included in the result, which is always trimmed.
`index` allows for targeting matches beyond the first (=0) in the source.
`replacements` are optional; if set, they work as in `REPLACE()`
"""
def __init__(
self, path, key, start: str, end: str, index=0, replacements=None, **kwargs
):
super(MATCH, self).__init__(path, key, **kwargs)
self.start = start
self.end = end
self.index = index
self.replacements = replacements
def __call__(self, ctx):
element: FTL.TextElement = super(MATCH, self).__call__(ctx)
text: str = element.value
starts = list(re.finditer(re.escape(self.start), text))
if self.index > len(starts) - 1:
print(
f" WARNING: index {self.index} out of range for {self.start} in {self.key}"
)
return Transform.pattern_of(element)
start = starts[self.index].end()
end = text.find(self.end, start)
text = self.trim_text(text[start:end])
element.value = re.sub("[\n\r]+", " ", text)
if self.replacements is None:
return Transform.pattern_of(element)
else:
return REPLACE_IN_TEXT(element, self.replacements)(ctx)
def BOLD_VARIABLE_REFERENCE(name):
return FTL.Pattern(
[
FTL.TextElement("<b>"),
FTL.Placeable(VARIABLE_REFERENCE(name)),
FTL.TextElement("</b>"),
]
)
# These strings are dropped as unused:
# - cspBlocked.longDesc
# - xfoBlocked.longDesc
def migrate(ctx):
"""Bug 1734217 - Migrate aboutNetError.xhtml from DTD to Fluent, part {index}"""
source = "browser/chrome/overrides/netError.dtd"
target = "browser/browser/netError.ftl"
ctx.add_transforms(
target,
target,
transforms_from(
"""
neterror-page-title = { COPY(source, "loadError.label") }
certerror-page-title = { COPY(source, "certerror.pagetitle2") }
certerror-sts-page-title = { COPY(source, "certerror.sts.pagetitle") }
neterror-blocked-by-policy-page-title = { COPY(source, "blockedByPolicy.title") }
neterror-captive-portal-page-title = { COPY(source, "captivePortal.title") }
neterror-malformed-uri-page-title = { COPY(source, "malformedURI.pageTitle") }
neterror-advanced-button = { COPY(source, "advanced2.label") }
neterror-copy-to-clipboard-button = { COPY(source, "certerror.copyToClipboard.label") }
neterror-learn-more-link = { COPY(source, "errorReporting.learnMore") }
neterror-open-portal-login-page-button = { COPY(source, "openPortalLoginPage.label2") }
neterror-override-exception-button = { COPY(source, "securityOverride.exceptionButton1Label") }
neterror-pref-reset-button = { COPY(source, "prefReset.label") }
neterror-return-to-previous-page-button = { COPY(source, "returnToPreviousPage.label") }
neterror-return-to-previous-page-recommended-button = { COPY(source, "returnToPreviousPage1.label") }
neterror-try-again-button = { COPY(source, "retry.label") }
neterror-view-certificate-link = { COPY(source, "viewCertificate.label") }
neterror-pref-reset = { COPY(source, "prefReset.longDesc") }
""",
source=source,
)
+ [
FTL.Message(
id=FTL.Identifier("neterror-error-reporting-automatic"),
value=REPLACE(
source,
"errorReporting.automatic2",
replacements={
"Mozilla": TERM_REFERENCE("vendor-short-name"),
},
),
),
FTL.Message(
id=FTL.Identifier("neterror-generic-error"),
value=MATCH(
source,
"generic.longDesc",
start="<p>",
end="</p>",
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
},
),
),
FTL.Message(
id=FTL.Identifier("neterror-load-error-try-again"),
value=MATCH(
source,
"sharedLongDesc",
start="<li>",
end="</li>",
index=0,
),
),
FTL.Message(
id=FTL.Identifier("neterror-load-error-connection"),
value=MATCH(
source,
"sharedLongDesc",
start="<li>",
end="</li>",
index=1,
),
),
FTL.Message(
id=FTL.Identifier("neterror-load-error-firewall"),
value=MATCH(
source,
"sharedLongDesc",
start="<li>",
end="</li>",
index=2,
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
},
),
),
FTL.Message(
id=FTL.Identifier("neterror-captive-portal"),
value=MATCH(
source,
"captivePortal.longDesc2",
start="<p>",
end="</p>",
),
),
]
+ transforms_from(
"""
neterror-dns-not-found-title = { COPY_PATTERN(prev, "dns-not-found-title") }
neterror-dns-not-found-with-suggestion = { COPY_PATTERN(prev, "dns-not-found-with-suggestion") }
neterror-dns-not-found-hint-header = { COPY_PATTERN(prev, "dns-not-found-hint-header") }
neterror-dns-not-found-hint-try-again = { COPY_PATTERN(prev, "dns-not-found-hint-try-again") }
neterror-dns-not-found-hint-check-network = { COPY_PATTERN(prev, "dns-not-found-hint-check-network") }
neterror-dns-not-found-hint-firewall = { COPY_PATTERN(prev, "dns-not-found-hint-firewall") }
""",
prev=target,
)
+ [
# file-not-found-long-desc = { COPY(source, "fileNotFound.longDesc") }
# <ul>
# <li>Check the file name for capitalization or other typing errors.</li>
# <li>Check to see if the file was moved, renamed or deleted.</li>
# </ul>
FTL.Message(
id=FTL.Identifier("neterror-file-not-found-filename"),
value=MATCH(
source,
"fileNotFound.longDesc",
start="<li>",
end="</li>",
index=0,
),
),
FTL.Message(
id=FTL.Identifier("neterror-file-not-found-moved"),
value=MATCH(
source,
"fileNotFound.longDesc",
start="<li>",
end="</li>",
index=1,
),
),
# file-access-denied-long-desc = { COPY(source, "fileAccessDenied.longDesc") }
# <ul>
# <li>It may have been removed, moved, or file permissions may be preventing access.</li>
# </ul>
FTL.Message(
id=FTL.Identifier("neterror-access-denied"),
value=MATCH(
source,
"fileAccessDenied.longDesc",
start="<li>",
end="</li>",
index=0,
),
),
# unknown-protocol-found-long-desc = { COPY(source, "unknownProtocolFound.longDesc") }
# <ul>
# <li>You might need to install other software to open this address.</li>
# </ul>
FTL.Message(
id=FTL.Identifier("neterror-unknown-protocol"),
value=MATCH(
source,
"unknownProtocolFound.longDesc",
start="<li>",
end="</li>",
index=0,
),
),
# redirect-loop-long-desc = { COPY(source, "redirectLoop.longDesc") }
# <ul>
# <li>This problem can sometimes be caused by disabling or refusing to accept
# cookies.</li>
# </ul>
FTL.Message(
id=FTL.Identifier("neterror-redirect-loop"),
value=MATCH(
source,
"redirectLoop.longDesc",
start="<li>",
end="</li>",
index=0,
),
),
# unknown-socket-type-long-desc = { COPY(source, "unknownSocketType.longDesc") }
# <ul>
# <li>Check to make sure your system has the Personal Security Manager
# installed.</li>
# <li>This might be due to a non-standard configuration on the server.</li>
# </ul>
FTL.Message(
id=FTL.Identifier("neterror-unknown-socket-type-psm-installed"),
value=MATCH(
source,
"unknownSocketType.longDesc",
start="<li>",
end="</li>",
index=0,
),
),
FTL.Message(
id=FTL.Identifier("neterror-unknown-socket-type-server-config"),
value=MATCH(
source,
"unknownSocketType.longDesc",
start="<li>",
end="</li>",
index=1,
),
),
# not-cached-long-desc = { COPY(source, "notCached.longDesc") }
# <p>The requested document is not available in &brandShortName;s cache.</p>
# <ul>
# <li>As a security precaution, &brandShortName; does not automatically re-request sensitive documents.</li>
# <li>Click Try Again to re-request the document from the website.</li>
# </ul>
FTL.Message(
id=FTL.Identifier("neterror-not-cached-intro"),
value=MATCH(
source,
"notCached.longDesc",
start="<p>",
end="</p>",
index=0,
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
},
),
),
FTL.Message(
id=FTL.Identifier("neterror-not-cached-sensitive"),
value=MATCH(
source,
"notCached.longDesc",
start="<li>",
end="</li>",
index=0,
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
},
),
),
FTL.Message(
id=FTL.Identifier("neterror-not-cached-try-again"),
value=MATCH(
source,
"notCached.longDesc",
start="<li>",
end="</li>",
index=1,
),
),
# net-offline-long-desc = { COPY(source, "netOffline.longDesc2") }
# <ul>
# <li>Press "Try Again" to switch to online mode and reload the page.</li>
# </ul>
FTL.Message(
id=FTL.Identifier("neterror-net-offline"),
value=MATCH(
source,
"netOffline.longDesc2",
start="<li>",
end="</li>",
index=0,
replacements={
' "': FTL.TextElement(""),
'" ': FTL.TextElement(""),
},
),
),
# proxy-resolve-failure-long-desc = { COPY(source, "proxyResolveFailure.longDesc") }
# <ul>
# <li>Check the proxy settings to make sure that they are correct.</li>
# <li>Check to make sure your computer has a working network connection.</li>
# <li>If your computer or network is protected by a firewall or proxy, make sure
# that &brandShortName; is permitted to access the Web.</li>
# </ul>
FTL.Message(
id=FTL.Identifier("neterror-proxy-resolve-failure-settings"),
value=MATCH(
source,
"proxyResolveFailure.longDesc",
start="<li>",
end="</li>",
index=0,
),
),
FTL.Message(
id=FTL.Identifier("neterror-proxy-resolve-failure-connection"),
value=MATCH(
source,
"proxyResolveFailure.longDesc",
start="<li>",
end="</li>",
index=1,
),
),
FTL.Message(
id=FTL.Identifier("neterror-proxy-resolve-failure-firewall"),
value=MATCH(
source,
"proxyResolveFailure.longDesc",
start="<li>",
end="</li>",
index=2,
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
},
),
),
# proxy-connect-failure-long-desc = { COPY(source, "proxyConnectFailure.longDesc") }
# <ul>
# <li>Check the proxy settings to make sure that they are correct.</li>
# <li>Contact your network administrator to make sure the proxy server is
# working.</li>
# </ul>
FTL.Message(
id=FTL.Identifier("neterror-proxy-connect-failure-settings"),
value=MATCH(
source,
"proxyConnectFailure.longDesc",
start="<li>",
end="</li>",
index=0,
),
),
FTL.Message(
id=FTL.Identifier("neterror-proxy-connect-failure-contact-admin"),
value=MATCH(
source,
"proxyConnectFailure.longDesc",
start="<li>",
end="</li>",
index=1,
),
),
# content-encoding-error-long-desc = { COPY(source, "contentEncodingError.longDesc") }
# <ul>
# <li>Please contact the website owners to inform them of this problem.</li>
# </ul>
FTL.Message(
id=FTL.Identifier("neterror-content-encoding-error"),
value=MATCH(
source,
"contentEncodingError.longDesc",
start="<li>",
end="</li>",
index=0,
),
),
# unsafe-content-type-long-desc = { COPY(source, "unsafeContentType.longDesc") }
# <ul>
# <li>Please contact the website owners to inform them of this problem.</li>
# </ul>
FTL.Message(
id=FTL.Identifier("neterror-unsafe-content-type"),
value=MATCH(
source,
"unsafeContentType.longDesc",
start="<li>",
end="</li>",
index=0,
),
),
# nss-failure2-long-desc = { COPY(source, "nssFailure2.longDesc2") }
# <ul>
# <li>The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.</li>
# <li>Please contact the website owners to inform them of this problem.</li>
# </ul>
FTL.Message(
id=FTL.Identifier("neterror-nss-failure-not-verified"),
value=MATCH(
source,
"nssFailure2.longDesc2",
start="<li>",
end="</li>",
index=0,
),
),
FTL.Message(
id=FTL.Identifier("neterror-nss-failure-contact-website"),
value=MATCH(
source,
"nssFailure2.longDesc2",
start="<li>",
end="</li>",
index=1,
),
),
# certerror-intro-para = { COPY(source, "certerror.introPara2") }
FTL.Message(
id=FTL.Identifier("certerror-intro"),
value=REPLACE(
source,
"certerror.introPara2",
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
"<span class='hostname'/>": BOLD_VARIABLE_REFERENCE("hostname"),
},
),
),
# certerror-sts-intro-para = { COPY(source, "certerror.sts.introPara") }
FTL.Message(
id=FTL.Identifier("certerror-sts-intro"),
value=REPLACE(
source,
"certerror.sts.introPara",
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
"<span class='hostname'/>": BOLD_VARIABLE_REFERENCE("hostname"),
},
),
),
# certerror-expired-cert-intro-para = { COPY(source, "certerror.expiredCert.introPara") }
FTL.Message(
id=FTL.Identifier("certerror-expired-cert-intro"),
value=REPLACE(
source,
"certerror.expiredCert.introPara",
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
"<span class='hostname'/>": BOLD_VARIABLE_REFERENCE("hostname"),
},
),
),
# certerror-mitm-long-desc = { COPY(source, "certerror.mitm.longDesc") }
FTL.Message(
id=FTL.Identifier("certerror-mitm"),
value=REPLACE(
source,
"certerror.mitm.longDesc",
replacements={
"<span class='hostname'></span>": BOLD_VARIABLE_REFERENCE(
"hostname"
),
"<span class='mitm-name'/>": BOLD_VARIABLE_REFERENCE("mitm"),
},
),
),
# corrupted-content-errorv2-long-desc = { COPY(source, "corruptedContentErrorv2.longDesc") }
# <p>The page you are trying to view cannot be shown because an error in the data transmission was detected.</p>
# <ul><li>Please contact the website owners to inform them of this problem.</li></ul>
FTL.Message(
id=FTL.Identifier("neterror-corrupted-content-intro"),
value=MATCH(
source,
"corruptedContentErrorv2.longDesc",
start="<p>",
end="</p>",
index=0,
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
},
),
),
FTL.Message(
id=FTL.Identifier("neterror-corrupted-content-contact-website"),
value=MATCH(
source,
"corruptedContentErrorv2.longDesc",
start="<li>",
end="</li>",
index=0,
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
},
),
),
# neterror-sslv3-used = { COPY(source, "sslv3Used.longDesc2") }
# Advanced info: SSL_ERROR_UNSUPPORTED_VERSION
FTL.Message(
id=FTL.Identifier("neterror-sslv3-used"),
value=COPY(
source,
"sslv3Used.longDesc2",
),
),
# inadequate-security-error-long-desc = { COPY(source, "inadequateSecurityError.longDesc") }
# <p><span class='hostname'></span> uses security technology that is outdated and vulnerable to attack. An attacker could easily reveal information which you thought to be safe. The website administrator will need to fix the server first before you can visit the site.</p>
# <p>Error code: NS_ERROR_NET_INADEQUATE_SECURITY</p>
FTL.Message(
id=FTL.Identifier("neterror-inadequate-security-intro"),
value=MATCH(
source,
"inadequateSecurityError.longDesc",
start="<p>",
end="</p>",
index=0,
replacements={
"<span class='hostname'></span>": BOLD_VARIABLE_REFERENCE(
"hostname"
),
},
),
),
FTL.Message(
id=FTL.Identifier("neterror-inadequate-security-code"),
value=MATCH(
source,
"inadequateSecurityError.longDesc",
start="<p>",
end="</p>",
index=1,
),
),
# clock-skew-error-long-desc = { COPY(source, "clockSkewError.longDesc") }
# Your computer thinks it is <span id='wrongSystemTime_systemDate1'/>, which prevents &brandShortName; from connecting securely. To visit <span class='hostname'></span>, update your computer clock in your system settings to the current date, time, and time zone, and then refresh <span class='hostname'></span>.
FTL.Message(
id=FTL.Identifier("neterror-clock-skew-error"),
value=REPLACE(
source,
"clockSkewError.longDesc",
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
"<span class='hostname'></span>": BOLD_VARIABLE_REFERENCE(
"hostname"
),
"<span id='wrongSystemTime_systemDate1'/>": FTL.FunctionReference(
id=FTL.Identifier("DATETIME"),
arguments=FTL.CallArguments(
positional=[VARIABLE_REFERENCE("now")],
named=[
FTL.NamedArgument(
FTL.Identifier("dateStyle"),
FTL.StringLiteral("medium"),
)
],
),
),
},
),
),
# network-protocol-error-long-desc = { COPY(source, "networkProtocolError.longDesc") }
# <p>The page you are trying to view cannot be shown because an error in the network protocol was detected.</p>
# <ul><li>Please contact the website owners to inform them of this problem.</li></ul>
FTL.Message(
id=FTL.Identifier("neterror-network-protocol-error-intro"),
value=MATCH(
source,
"networkProtocolError.longDesc",
start="<p>",
end="</p>",
index=0,
),
),
FTL.Message(
id=FTL.Identifier("neterror-network-protocol-error-contact-website"),
value=MATCH(
source,
"networkProtocolError.longDesc",
start="<li>",
end="</li>",
index=0,
),
),
# certerror-expired-cert-second-para = { COPY(source, "certerror.expiredCert.secondPara2") }
# Its likely the websites certificate is expired, which prevents &brandShortName; from connecting securely. If you visit this site, attackers could try to steal information like your passwords, emails, or credit card details.
FTL.Message(
id=FTL.Identifier("certerror-expired-cert-second-para"),
value=REPLACE(
source,
"certerror.expiredCert.secondPara2",
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
},
),
),
# certerror-expired-cert-sts-second-para = { COPY(source, "certerror.expiredCert.sts.secondPara") }
# Its likely the websites certificate is expired, which prevents &brandShortName; from connecting securely.
FTL.Message(
id=FTL.Identifier("certerror-expired-cert-sts-second-para"),
value=REPLACE(
source,
"certerror.expiredCert.sts.secondPara",
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
},
),
),
# certerror-what-can-you-do-about-it-title = { COPY(source, "certerror.whatCanYouDoAboutItTitle") }
# What can you do about it?
FTL.Message(
id=FTL.Identifier("certerror-what-can-you-do-about-it-title"),
value=COPY(
source,
"certerror.whatCanYouDoAboutItTitle",
),
),
# certerror-unknown-issuer-what-can-you-do-about-it = { COPY(source, "certerror.unknownIssuer.whatCanYouDoAboutIt") }
# <p>The issue is most likely with the website, and there is nothing you can do to resolve it.</p>
# <p>If you are on a corporate network or using anti-virus software, you can reach out to the support teams for assistance. You can also notify the websites administrator about the problem.</p>
FTL.Message(
id=FTL.Identifier(
"certerror-unknown-issuer-what-can-you-do-about-it-website"
),
value=MATCH(
source,
"certerror.unknownIssuer.whatCanYouDoAboutIt",
start="<p>",
end="</p>",
index=0,
),
),
FTL.Message(
id=FTL.Identifier(
"certerror-unknown-issuer-what-can-you-do-about-it-contact-admin"
),
value=MATCH(
source,
"certerror.unknownIssuer.whatCanYouDoAboutIt",
start="<p>",
end="</p>",
index=1,
),
),
# certerror-expired-cert-what-can-you-do-about-it = { COPY(source, "certerror.expiredCert.whatCanYouDoAboutIt2") }
# <p>Your computer clock is set to <span id='wrongSystemTime_systemDate2'/>. Make sure your computer is set to the correct date, time, and time zone in your system settings, and then refresh <span class='hostname'/>.</p>
# <p>If your clock is already set to the right time, the website is likely misconfigured, and there is nothing you can do to resolve the issue. You can notify the websites administrator about the problem.</p>
FTL.Message(
id=FTL.Identifier(
"certerror-expired-cert-what-can-you-do-about-it-clock"
),
value=MATCH(
source,
"certerror.expiredCert.whatCanYouDoAboutIt2",
start="<p>",
end="</p>",
index=0,
replacements={
"<span class='hostname'/>": BOLD_VARIABLE_REFERENCE("hostname"),
"<span id='wrongSystemTime_systemDate2'/>": FTL.FunctionReference(
id=FTL.Identifier("DATETIME"),
arguments=FTL.CallArguments(
positional=[VARIABLE_REFERENCE("now")],
named=[
FTL.NamedArgument(
FTL.Identifier("dateStyle"),
FTL.StringLiteral("medium"),
)
],
),
),
},
),
),
FTL.Message(
id=FTL.Identifier(
"certerror-expired-cert-what-can-you-do-about-it-contact-website"
),
value=MATCH(
source,
"certerror.expiredCert.whatCanYouDoAboutIt2",
start="<p>",
end="</p>",
index=1,
),
),
# certerror-bad-cert-domain-what-can-you-do-about-it = { COPY(source, "certerror.badCertDomain.whatCanYouDoAboutIt") }
# <p>The issue is most likely with the website, and there is nothing you can do to resolve it. You can notify the websites administrator about the problem.</p>
FTL.Message(
id=FTL.Identifier("certerror-bad-cert-domain-what-can-you-do-about-it"),
value=MATCH(
source,
"certerror.badCertDomain.whatCanYouDoAboutIt",
start="<p>",
end="</p>",
index=0,
),
),
# certerror-mitm-what-can-you-do-about-it-antivirus = { COPY(source, "certerror.mitm.whatCanYouDoAboutIt1") }
# If your antivirus software includes a feature that scans encrypted connections (often called “web scanning” or “https scanning”), you can disable that feature. If that doesnt work, you can remove and reinstall the antivirus software.
FTL.Message(
id=FTL.Identifier("certerror-mitm-what-can-you-do-about-it-antivirus"),
value=COPY(
source,
"certerror.mitm.whatCanYouDoAboutIt1",
),
),
# certerror-mitm-what-can-you-do-about-it-corporate = { COPY(source, "certerror.mitm.whatCanYouDoAboutIt2") }
# If you are on a corporate network, you can contact your IT department.
FTL.Message(
id=FTL.Identifier("certerror-mitm-what-can-you-do-about-it-corporate"),
value=COPY(
source,
"certerror.mitm.whatCanYouDoAboutIt2",
),
),
# certerror-mitm-what-can-you-do-about-it-attack = { COPY(source, "certerror.mitm.whatCanYouDoAboutIt3") }
# If you are not familiar with <span class='mitm-name'/>, then this could be an attack and you should not continue to the site.
FTL.Message(
id=FTL.Identifier("certerror-mitm-what-can-you-do-about-it-attack"),
value=REPLACE(
source,
"certerror.mitm.whatCanYouDoAboutIt3",
replacements={
"<span class='mitm-name'/>": BOLD_VARIABLE_REFERENCE("mitm"),
},
),
),
# certerror-mitm-sts-what-can-you-do-about-it = { COPY(source, "certerror.mitm.sts.whatCanYouDoAboutIt3") }
# If you are not familiar with <span class='mitm-name'/>, then this could be an attack, and there is nothing you can do to access the site.
FTL.Message(
id=FTL.Identifier("certerror-mitm-what-can-you-do-about-it-attack-sts"),
value=REPLACE(
source,
"certerror.mitm.sts.whatCanYouDoAboutIt3",
replacements={
"<span class='mitm-name'/>": BOLD_VARIABLE_REFERENCE("mitm"),
},
),
),
# certerror-what-should-i-do-bad-sts-cert-explanation = { COPY(source, "certerror.whatShouldIDo.badStsCertExplanation1") }
# <span class='hostname'></span> has a security policy called HTTP Strict Transport Security (HSTS), which means that &brandShortName; can only connect to it securely. You cant add an exception to visit this site.
FTL.Message(
id=FTL.Identifier(
"certerror-what-should-i-do-bad-sts-cert-explanation"
),
value=REPLACE(
source,
"certerror.whatShouldIDo.badStsCertExplanation1",
replacements={
"&brandShortName;": TERM_REFERENCE("brand-short-name"),
"<span class='hostname'></span>": BOLD_VARIABLE_REFERENCE(
"hostname"
),
},
),
),
],
)