bug 427293: add a pref to unhide the buttons on the bad-cert error page by default for advanced users. r=johnath, ui-r=beltzner, sr=jst, a=beltzner

This commit is contained in:
dveditz@cruzio.com 2008-05-02 00:24:27 -07:00
parent 6f31226edd
commit 6aca124433
3 changed files with 12 additions and 1 deletions

View File

@ -445,6 +445,7 @@ pref("alerts.slideIncrementTime", 10);
pref("alerts.totalOpenTime", 4000);
pref("browser.xul.error_pages.enabled", true);
pref("browser.xul.error_pages.expert_bad_cert", false);
// We want to make sure mail URLs are handled externally...
pref("network.protocol-handler.external.mailto", true); // for mail

View File

@ -3036,6 +3036,12 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI,
if (!messageStr.IsEmpty()) {
if (errorClass == nsINSSErrorsService::ERROR_CLASS_BAD_CERT) {
error.AssignLiteral("nssBadCert");
PRBool expert = PR_FALSE;
mPrefs->GetBoolPref("browser.xul.error_pages.expert_bad_cert",
&expert);
if (expert) {
cssClass.AssignLiteral("expertBadCert");
}
} else {
error.AssignLiteral("nssFailure2");
}

View File

@ -163,9 +163,10 @@
errContainer.parentNode.removeChild(errContainer);
var className = getCSSClass();
if (className) {
if (className && className != "expertBadCert") {
// Associate a CSS class with the root of the page, if one was passed in,
// to allow custom styling.
// Not "expertBadCert" though, don't want to deal with the favicon
document.documentElement.className = className;
// Also, if they specified a CSS class, they must supply their own
@ -177,6 +178,9 @@
favicon.setAttribute("href", "chrome://global/skin/icons/" + className + "_favicon.png");
faviconParent.appendChild(favicon);
}
if (className == "expertBadCert") {
showSecuritySection();
}
if (err == "nssBadCert") {
// Remove the "Try again" button for security exceptions, since it's