Bug 1409348 - Prefer the per-provider report{Malware,Phish}MistakeURL in about:blocked. r?francois
MozReview-Commit-ID: 6Wmzf4SvXnE
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -22,16 +22,17 @@ XPCOMUtils.defineLazyModuleGetters(this,
LoginManagerContent: "resource://gre/modules/LoginManagerContent.jsm",
LoginFormFactory: "resource://gre/modules/LoginManagerContent.jsm",
InsecurePasswordUtils: "resource://gre/modules/InsecurePasswordUtils.jsm",
PluginContent: "resource:///modules/PluginContent.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
FormSubmitObserver: "resource:///modules/FormSubmitObserver.jsm",
PageMetadata: "resource://gre/modules/PageMetadata.jsm",
PlacesUIUtils: "resource:///modules/PlacesUIUtils.jsm",
+ SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
Utils: "resource://gre/modules/sessionstore/Utils.jsm",
WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.jsm",
Feeds: "resource:///modules/Feeds.jsm",
ContextMenu: "resource:///modules/ContextMenu.jsm",
});
// TabChildGlobal
var global = this;
@@ -151,24 +152,18 @@ var AboutBlockedSiteListener = {
if (!this.isBlockedSite) {
return;
}
if (aEvent.type != "AboutBlockedLoaded") {
return;
}
- let provider = "";
- if (docShell.failedChannel) {
- let classifiedChannel = docShell.failedChannel.
- QueryInterface(Ci.nsIClassifiedChannel);
- if (classifiedChannel) {
- provider = classifiedChannel.matchedProvider;
- }
- }
+ let blockedInfo = getSiteBlockedErrorDetails(docShell);
+ let provider = blockedInfo.provider || "";
let doc = content.document;
/**
* Set error description link in error details.
* For example, the "reported as a deceptive site" link for
* blocked phishing pages.
*/
@@ -177,27 +172,29 @@ var AboutBlockedSiteListener = {
if (desc) {
doc.getElementById("error_desc_link").setAttribute("href", desc + aEvent.detail.url);
}
// Set other links in error details.
switch (aEvent.detail.err) {
case "malware":
doc.getElementById("report_detection").setAttribute("href",
- "https://www.stopbadware.org/firefox");
+ (SafeBrowsing.getReportURL("MalwareMistake", blockedInfo) ||
+ "https://www.stopbadware.org/firefox"));
doc.getElementById("learn_more_link").setAttribute("href",
"https://www.stopbadware.org/firefox");
break;
case "unwanted":
doc.getElementById("learn_more_link").setAttribute("href",
"https://www.google.com/about/unwanted-software-policy.html");
break;
case "phishing":
doc.getElementById("report_detection").setAttribute("href",
- "https://safebrowsing.google.com/safebrowsing/report_error/?tpl=mozilla");
+ (SafeBrowsing.getReportURL("PhishMistake", blockedInfo) ||
+ "https://safebrowsing.google.com/safebrowsing/report_error/?tpl=mozilla"));
doc.getElementById("learn_more_link").setAttribute("href",
"https://www.antiphishing.org//");
break;
}
// Set the firefox support url.
doc.getElementById("firefox_support").setAttribute("href",
"https://support.mozilla.org/kb/how-does-phishing-and-malware-protection-work");