From dbf66fb8939b16a53241ee44efed452bc11059e9 Mon Sep 17 00:00:00 2001 From: "johnath%mozilla.com" Date: Tue, 22 Apr 2008 20:00:20 +0000 Subject: [PATCH] Change "Why was this site blocked?" to use more detailed report page. b=429697 r=gavin a=beltzner git-svn-id: svn://10.0.0.236/trunk@250624 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/browser/app/profile/firefox.js | 2 +- mozilla/browser/base/content/browser.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mozilla/browser/app/profile/firefox.js b/mozilla/browser/app/profile/firefox.js index 0eecba0c657..c98af3db5d4 100644 --- a/mozilla/browser/app/profile/firefox.js +++ b/mozilla/browser/app/profile/firefox.js @@ -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 diff --git a/mozilla/browser/base/content/browser.js b/mozilla/browser/base/content/browser.js index a9d01403656..495145fa463 100644 --- a/mozilla/browser/base/content/browser.js +++ b/mozilla/browser/base/content/browser.js @@ -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); }