From ee60bee20e6f09f3dcf35a1d503d6deae18342fd Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 4 Nov 2008 02:52:23 +0330 Subject: [PATCH] Bug 461627 - Hide the UI for saving certificate exceptions permanently in Private Browsing mode; r=johnath --- .../pki/resources/content/exceptionDialog.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/security/manager/pki/resources/content/exceptionDialog.js b/security/manager/pki/resources/content/exceptionDialog.js index 1c7c60ca5eb9..14a233b1c381 100644 --- a/security/manager/pki/resources/content/exceptionDialog.js +++ b/security/manager/pki/resources/content/exceptionDialog.js @@ -20,6 +20,7 @@ * * Contributor(s): * Johnathan Nightingale + * Ehsan Akhgari * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -82,6 +83,19 @@ function initExceptionDialog() { [brandName], 1)); gDialog.getButton("extra1").disabled = true; + // If the Private Browsing service is available and the mode is active, + // don't store permanent exceptions, since they would persist after + // private browsing mode was disabled. + try { + var pb = Components.classes["@mozilla.org/privatebrowsing;1"]. + getService(Components.interfaces.nsIPrivateBrowsingService); + if (pb.privateBrowsingEnabled) { + var permanentCheckbox = document.getElementById("permanent"); + permanentCheckbox.setAttribute("disabled", "true"); + permanentCheckbox.removeAttribute("checked"); + } + } catch (ex) {} + var args = window.arguments; if (args && args[0]) { if (args[0].location) {