summaryrefslogtreecommitdiffstats
path: root/application/basilisk/base/content/aboutNetError.xhtml
diff options
context:
space:
mode:
Diffstat (limited to 'application/basilisk/base/content/aboutNetError.xhtml')
-rw-r--r--application/basilisk/base/content/aboutNetError.xhtml114
1 files changed, 20 insertions, 94 deletions
diff --git a/application/basilisk/base/content/aboutNetError.xhtml b/application/basilisk/base/content/aboutNetError.xhtml
index 609725c9e..3296600c8 100644
--- a/application/basilisk/base/content/aboutNetError.xhtml
+++ b/application/basilisk/base/content/aboutNetError.xhtml
@@ -123,13 +123,6 @@
document.getElementById("advancedButton")
.addEventListener("click", function togglePanelVisibility() {
toggleDisplay(panel);
- if (gIsCertError) {
- // Toggling the advanced panel must ensure that the debugging
- // information panel is hidden as well, since it's opened by the
- // error code link in the advanced panel.
- var div = document.getElementById("certificateErrorDebugInformation");
- div.style.display = "none";
- }
if (panel.style.display == "block") {
// send event to trigger telemetry ping
@@ -149,11 +142,6 @@
if (getCSSClass() == "expertBadCert") {
toggleDisplay(document.getElementById("badCertAdvancedPanel"));
- // Toggling the advanced panel must ensure that the debugging
- // information panel is hidden as well, since it's opened by the
- // error code link in the advanced panel.
- var div = document.getElementById("certificateErrorDebugInformation");
- div.style.display = "none";
}
disallowCertOverridesIfNeeded();
@@ -224,9 +212,6 @@
}
if (err == "sslv3Used") {
- document.getElementById("learnMoreContainer").style.display = "block";
- var learnMoreLink = document.getElementById("learnMoreLink");
- learnMoreLink.href = "https://support.mozilla.org/kb/how-resolve-sslv3-error-messages-firefox";
document.body.className = "certerror";
}
@@ -270,17 +255,6 @@
window.addEventListener("AboutNetErrorOptions", function(evt) {
// Pinning errors are of type nssFailure2
if (getErrorCode() == "nssFailure2" || getErrorCode() == "weakCryptoUsed") {
- document.getElementById("learnMoreContainer").style.display = "block";
- var learnMoreLink = document.getElementById("learnMoreLink");
- // nssFailure2 also gets us other non-overrideable errors. Choose
- // a "learn more" link based on description:
- if (getDescription().includes("mozilla_pkix_error_key_pinning_failure")) {
- learnMoreLink.href = "https://support.mozilla.org/kb/certificate-pinning-reports";
- }
- if (getErrorCode() == "weakCryptoUsed") {
- learnMoreLink.href = "https://support.mozilla.org/kb/how-resolve-weak-crypto-error-messages-firefox";
- }
-
const hasPrefStyleError = [
"interrupted", // This happens with subresources that are above the max tls
"SSL_ERROR_PROTOCOL_VERSION_ALERT",
@@ -312,7 +286,7 @@
}
}
- addDomainErrorLinks();
+ addDomainErrorLink();
}
function initPageCaptivePortal()
@@ -329,7 +303,7 @@
addAutofocus("openPortalLoginPageButton");
setupAdvancedButton(true);
- addDomainErrorLinks();
+ addDomainErrorLink();
// When the portal is freed, an event is generated by the frame script
// that we can pick up and attempt to reload the original page.
@@ -348,12 +322,10 @@
addAutofocus("returnButton");
setupAdvancedButton(true);
- document.getElementById("learnMoreContainer").style.display = "block";
-
let event = new CustomEvent("AboutNetErrorLoad", {bubbles:true});
document.getElementById("advancedButton").dispatchEvent(event);
- addDomainErrorLinks();
+ addDomainErrorLink();
}
/* Only do autofocus if we're the toplevel frame; otherwise we
@@ -372,16 +344,13 @@
}
}
- /* Try to preserve the links contained in the error description, like
- the error code.
-
- Also, in the case of SSL error pages about domain mismatch, see if
+ /* In the case of SSL error pages about domain mismatch, see if
we can hyperlink the user to the correct site. We don't want
to do this generically since it allows MitM attacks to redirect
users to a site under attacker control, but in certain cases
it is safe (and helpful!) to do so. Bug 402210
*/
- function addDomainErrorLinks() {
+ function addDomainErrorLink() {
// Rather than textContent, we need to treat description as HTML
var sdid = gIsCertError ? "badCertTechnicalInfo" : "errorShortDescText";
var sd = document.getElementById(sdid);
@@ -390,50 +359,28 @@
// sanitize description text - see bug 441169
- // First, find the index of the <a> tags we care about, being
+ // First, find the index of the <a> tag we care about, being
// careful not to use an over-greedy regex.
- var codeRe = /<a id="errorCode" title="([^"]+)">/;
- var codeResult = codeRe.exec(desc);
- var domainRe = /<a id="cert_domain_link" title="([^"]+)">/;
- var domainResult = domainRe.exec(desc);
-
- // The order of these links in the description is fixed in
- // TransportSecurityInfo.cpp:formatOverridableCertErrorMessage.
- var firstResult = domainResult;
- if (!domainResult)
- firstResult = codeResult;
- if (!firstResult)
+ var re = /<a id="cert_domain_link" title="([^"]+)">/;
+ var result = domainRe.exec(desc);
+
+ if (!result)
return;
// Remove sd's existing children
sd.textContent = "";
- // Everything up to the first link should be text content.
- sd.appendChild(document.createTextNode(desc.slice(0, firstResult.index)));
+ // Everything up to the link should be text content.
+ sd.appendChild(document.createTextNode(desc.slice(0, result.index)));
- // Now create the actual links.
- if (domainResult) {
- createLink(sd, "cert_domain_link", domainResult[1])
- // Append text for anything between the two links.
- sd.appendChild(document.createTextNode(desc.slice(desc.indexOf("</a>") + "</a>".length, codeResult.index)));
- }
- createLink(sd, "errorCode", codeResult[1])
+ // Now create the link itself.
+ var anchorEl = document.createElement("a");
+ anchorEl.setAttribute("id", "cert_domain_link");
+ anchorEl.setAttribute("title", result[1]);
+ anchorEl.appendChild(document.createTextNode(result[1]));
+ sd.appendChild(anchorEl);
- // Finally, append text for anything after the last closing </a>.
- sd.appendChild(document.createTextNode(desc.slice(desc.lastIndexOf("</a>") + "</a>".length)));
- }
-
- if (gIsCertError) {
- // Initialize the error code link embedded in the error message to
- // display debug information about the cert error.
- var errorCode = document.getElementById("errorCode");
- if (errorCode) {
- errorCode.href = "javascript:void(0)";
- errorCode.addEventListener("click", () => {
- let debugInfo = document.getElementById("certificateErrorDebugInformation");
- debugInfo.style.display = "block";
- debugInfo.scrollIntoView({block: "start", behavior: "smooth"});
- }, false);
- }
+ // Finally, append text for anything after the closing </a>.
+ sd.appendChild(document.createTextNode(desc.slice(desc.indexOf("</a>") + "</a>".length)));
}
// Initialize the cert domain link.
@@ -479,23 +426,8 @@
if (link.href && getCSSClass() != "expertBadCert") {
var panelId = gIsCertError ? "badCertAdvancedPanel" : "weakCryptoAdvancedPanel"
toggleDisplay(document.getElementById(panelId));
- if (gIsCertError) {
- // Toggling the advanced panel must ensure that the debugging
- // information panel is hidden as well, since it's opened by the
- // error code link in the advanced panel.
- var div = document.getElementById("certificateErrorDebugInformation");
- div.style.display = "none";
- }
}
}
-
- function createLink(el, id, text) {
- var anchorEl = document.createElement("a");
- anchorEl.setAttribute("id", id);
- anchorEl.setAttribute("title", text);
- anchorEl.appendChild(document.createTextNode(text));
- el.appendChild(anchorEl);
- }
]]></script>
</head>
@@ -628,12 +560,6 @@
</div>
- <div id="certificateErrorDebugInformation">
- <button id="copyToClipboard">&certerror.copyToClipboard.label;</button>
- <div id="certificateErrorText"/>
- <button id="copyToClipboard">&certerror.copyToClipboard.label;</button>
- </div>
-
<!--
- Note: It is important to run the script this way, instead of using
- an onload handler. This is because error pages are loaded as