Bug 1400660 - Create a new pref to determine the initial state of the 'See details' panel in about:blocked pages. draft
authorPrathiksha <prathikshaprasadsuman@gmail.com>
Sat, 28 Oct 2017 01:56:31 +0530
changeset 693230 bdce8344b3131140e0db11da4c212d96e4c45dba
parent 692089 40a14ca1cf04499f398e4cb8ba359b39eae4e216
child 738971 c4d434266020dd0296748c909ec027aeef941a45
push id87729
push userbmo:prathikshaprasadsuman@gmail.com
push dateSat, 04 Nov 2017 14:49:23 +0000
bugs1400660
milestone58.0a1
Bug 1400660 - Create a new pref to determine the initial state of the 'See details' panel in about:blocked pages. MozReview-Commit-ID: CxZmvc34ULB
browser/app/profile/firefox.js
browser/base/content/content.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -649,16 +649,17 @@ pref("mousewheel.with_shift.action", 4);
 pref("mousewheel.with_alt.action", 2);
 pref("mousewheel.with_meta.action", 1); // win key on Win, Super/Hyper on Linux
 #endif
 pref("mousewheel.with_control.action",3);
 pref("mousewheel.with_win.action", 1);
 
 pref("browser.xul.error_pages.enabled", true);
 pref("browser.xul.error_pages.expert_bad_cert", false);
+pref("browser.xul.error_pages.show_safe_browsing_details_on_load", false);
 
 // Enable captive portal detection.
 pref("network.captive-portal-service.enabled", true);
 
 // If true, network link events will change the value of navigator.onLine
 pref("network.manage-offline-status", true);
 
 // We want to make sure mail URLs are handled externally...
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -194,16 +194,23 @@ var AboutBlockedSiteListener = {
           "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");
 
+    // Show safe browsing details on load if the pref is set to true.
+    let showDetails = Services.prefs.getBoolPref("browser.xul.error_pages.show_safe_browsing_details_on_load");
+    if (showDetails) {
+      let details = content.document.getElementById("errorDescriptionContainer");
+      details.removeAttribute("hidden");
+    }
+
     // Set safe browsing advisory link.
     let advisoryUrl = Services.prefs.getCharPref(
       "browser.safebrowsing.provider." + provider + ".advisoryURL", "");
     if (!advisoryUrl) {
       let el = content.document.getElementById("advisoryDesc");
       el.remove();
       return;
     }