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) {