From e74fffcff782ab9b5c5b193a305daef4defb7243 Mon Sep 17 00:00:00 2001 From: "dveditz%cruzio.com" Date: Fri, 2 May 2008 07:24:28 +0000 Subject: [PATCH] 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 git-svn-id: svn://10.0.0.236/trunk@251082 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/browser/app/profile/firefox.js | 1 + mozilla/camino/resources/application/all-camino.js.in | 1 + mozilla/docshell/base/nsDocShell.cpp | 6 ++++++ mozilla/docshell/resources/content/netError.xhtml | 6 +++++- mozilla/mail/app/profile/all-thunderbird.js | 1 + mozilla/suite/browser/browser-prefs.js | 1 + 6 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mozilla/browser/app/profile/firefox.js b/mozilla/browser/app/profile/firefox.js index b2da7a5a174..12baec6102f 100644 --- a/mozilla/browser/app/profile/firefox.js +++ b/mozilla/browser/app/profile/firefox.js @@ -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 diff --git a/mozilla/camino/resources/application/all-camino.js.in b/mozilla/camino/resources/application/all-camino.js.in index d1f62ae4e02..aaf48e0ebb2 100644 --- a/mozilla/camino/resources/application/all-camino.js.in +++ b/mozilla/camino/resources/application/all-camino.js.in @@ -158,6 +158,7 @@ pref("camino.viewsource_in_tab", false); // use the html network errors rather than sheets pref("browser.xul.error_pages.enabled", true); +pref("browser.xul.error_pages.expert_bad_cert", false); // map delete key to back button pref("browser.backspace_action", 0); diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 3c7110e5930..3064375a1cf 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -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"); } diff --git a/mozilla/docshell/resources/content/netError.xhtml b/mozilla/docshell/resources/content/netError.xhtml index 9c78bd4c44d..f491eb2f35b 100644 --- a/mozilla/docshell/resources/content/netError.xhtml +++ b/mozilla/docshell/resources/content/netError.xhtml @@ -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 diff --git a/mozilla/mail/app/profile/all-thunderbird.js b/mozilla/mail/app/profile/all-thunderbird.js index da1deaaf3a5..66c523c6084 100644 --- a/mozilla/mail/app/profile/all-thunderbird.js +++ b/mozilla/mail/app/profile/all-thunderbird.js @@ -320,6 +320,7 @@ pref("browser.chrome.site_icons", true); pref("browser.chrome.favicons", false); pref("browser.chrome.toolbar_tips", true); pref("browser.xul.error_pages.enabled", true); +pref("browser.xul.error_pages.expert_bad_cert", false); // Attachment download manager settings pref("mail.attachment.store.version", 0); diff --git a/mozilla/suite/browser/browser-prefs.js b/mozilla/suite/browser/browser-prefs.js index 928416a4c97..d828b486e72 100644 --- a/mozilla/suite/browser/browser-prefs.js +++ b/mozilla/suite/browser/browser-prefs.js @@ -408,6 +408,7 @@ pref("privacy.sanitize.promptOnSanitize", true); // Show XUL error pages instead of alerts for errors pref("browser.xul.error_pages.enabled", true); +pref("browser.xul.error_pages.expert_bad_cert", false); // Setting this pref to |true| forces BiDi UI menu items and keyboard shortcuts // to be exposed. By default, only expose it for bidi-associated system locales.