Bug 402207 - SSL error page "Add Exception" support should be pref-controlled. r=gavin r=kengert ui-r=beltzner a=beltzner

This commit is contained in:
johnath@mozilla.com 2007-11-23 13:59:10 -08:00
Родитель af7076ecfc
Коммит 39e2a45b3f
3 изменённых файлов: 37 добавлений и 12 удалений

Просмотреть файл

@ -581,3 +581,9 @@ pref("browser.places.importBookmarksHTML", true);
// if false, will add the "Places" folder to the personal toolbar
pref("browser.places.createdDefaultQueries", false);
// Controls behavior of the "Add Exception" dialog launched from SSL error pages
// 0 - don't pre-populate anything
// 1 - pre-populate site URL, but don't fetch certificate
// 2 - pre-populate site URL and pre-fetch certificate
pref("browser.ssl_override_behavior", 1);

Просмотреть файл

@ -2304,8 +2304,19 @@ function BrowserOnCommand(event) {
var errorDoc = ot.ownerDocument;
if (ot == errorDoc.getElementById('exceptionDialogButton')) {
var params = { location : content.location.href,
exceptionAdded : false };
var params = { exceptionAdded : false };
try {
switch (gPrefService.getIntPref("browser.ssl_override_behavior")) {
case 2 : // Pre-fetch & pre-populate
params.prefetchCert = true;
case 1 : // Pre-populate
params.location = content.location.href;
}
} catch (e) {
Components.utils.reportError("Couldn't get ssl_override pref: " + e);
}
window.openDialog('chrome://pippki/content/exceptionDialog.xul',
'','chrome,centerscreen,modal', params);

Просмотреть файл

@ -82,16 +82,21 @@ function initExceptionDialog() {
[brandName], 1));
gDialog.getButton("extra1").disabled = true;
if (window.arguments[0]
&& window.arguments[0].location) {
// We were pre-seeded with a location. Populate the location bar, and check
// the cert
document.getElementById("locationTextBox").value = window.arguments[0].location;
checkCert();
var args = window.arguments;
if (args && args[0]) {
if (args[0].location) {
// We were pre-seeded with a location.
document.getElementById("locationTextBox").value = args[0].location;
document.getElementById('checkCertButton').disabled = false;
// We can optionally pre-fetch the certificate too
if (args[0].prefetchCert)
checkCert();
}
// Set out parameter to false by default
args[0].exceptionAdded = false;
}
// Set out parameter to false by default
window.arguments[0].exceptionAdded = false;
}
// returns true if found and global status could be set
@ -341,6 +346,9 @@ function addException() {
flags,
!permanentCheckbox.checked);
window.arguments[0].exceptionAdded = true;
var args = window.arguments;
if (args && args[0])
args[0].exceptionAdded = true;
gDialog.acceptDialog();
}