Change "Why was this site blocked?" to use more detailed report page. b=429697 r=gavin a=beltzner

This commit is contained in:
johnath%mozilla.com 2008-04-22 20:00:20 +00:00
Родитель e6526e98ba
Коммит 3cc41d2ff4
2 изменённых файлов: 6 добавлений и 5 удалений

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

@ -632,7 +632,7 @@ pref("urlclassifier.gethashtables", "goog-phish-shavar,goog-malware-shavar");
pref("urlclassifier.confirm-age", 2700);
// URL for checking the reason for a malware warning.
pref("browser.safebrowsing.malware.reportURL", "http://www.stopbadware.org/reports/container?source=@APP_UA_NAME@&version=@APP_VERSION@&reportname=");
pref("browser.safebrowsing.malware.reportURL", "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
#endif

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

@ -2324,11 +2324,14 @@ function BrowserOnCommand(event) {
// This is the "Why is this site blocked" button. For malware,
// we can fetch a site-specific report, for phishing, we redirect
// to the generic page describing phishing protection.
var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
if (/e=malwareBlocked/.test(errorDoc.documentURI)) {
// Get the stop badware "why is this blocked" report url,
// append the current url, and go there.
try {
var reportURL = gPrefService.getCharPref("browser.safebrowsing.malware.reportURL");
var reportURL = formatter.formatURLPref("browser.safebrowsing.malware.reportURL");
reportURL += errorDoc.location.href;
content.location = reportURL;
} catch (e) {
@ -2337,9 +2340,7 @@ function BrowserOnCommand(event) {
}
else if (/e=phishingBlocked/.test(errorDoc.documentURI)) {
try {
content.location = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter)
.formatURLPref("browser.safebrowsing.warning.infoURL");
content.location = formatter.formatURLPref("browser.safebrowsing.warning.infoURL");
} catch (e) {
Components.utils.reportError("Couldn't get phishing info URL: " + e);
}