Bug 1388501 - Fixed missing PHA warning page on Fennec. draft
authorHenry Chang <hchang@mozilla.com>
Thu, 17 Aug 2017 17:24:19 +0800
changeset 648147 a69d0a8f647a39268797ea1b5848925dd8bd6893
parent 647136 9b101cdb3935c224f97a4f1e6de642c0ca5c3c5e
child 649729 b55b540784eed360c07cda18336a58c0c078a88e
push id74643
push userhchang@mozilla.com
push dateThu, 17 Aug 2017 09:27:05 +0000
bugs1388501
milestone57.0a1
Bug 1388501 - Fixed missing PHA warning page on Fennec. MozReview-Commit-ID: FPf85QAO2C9
mobile/android/chrome/content/blockedSite.xhtml
mobile/android/locales/en-US/chrome/phishing.dtd
--- a/mobile/android/chrome/content/blockedSite.xhtml
+++ b/mobile/android/chrome/content/blockedSite.xhtml
@@ -85,16 +85,19 @@
             error = "malware";
             break;
           case "deceptiveBlocked" :
             error = "phishing";
             break;
           case "unwantedBlocked" :
             error = "unwanted";
             break;
+          case "harmfulBlocked" :
+            error = "harmful";
+            break;
           default:
             return;
         }
 
         var el;
 
         if (error !== "malware") {
           el = document.getElementById("errorTitleText_malware");
@@ -118,25 +121,36 @@
           el = document.getElementById("errorTitleText_unwanted");
           el.remove();
           el = document.getElementById("errorShortDescText_unwanted");
           el.remove();
           el = document.getElementById("errorLongDescText_unwanted");
           el.remove();
         }
 
+        if (error !== "harmful") {
+          el = document.getElementById("errorTitleText_harmful");
+          el.remove();
+          el = document.getElementById("errorShortDescText_harmful");
+          el.remove();
+        }
+
         if (!getOverride()) {
           var btn = document.getElementById("ignoreWarningButton");
           if (btn) {
             btn.remove();
           }
         }
 
         // Set sitename
-        document.getElementById(error + "_sitename").textContent = getHostString();
+        let siteElem = document.getElementById(error + "_sitename");
+        if (siteElem) {
+          siteElem.textContent = getHostString();
+        }
+
         document.title = document.getElementById("errorTitleText_" + error)
                                  .innerHTML;
 
         // Inform the test harness that we're done loading the page
         var event = new CustomEvent("AboutBlockedLoaded", { bubbles: true });
         document.dispatchEvent(event);
       }
     ]]></script>
@@ -146,25 +160,27 @@
 
     <div id="errorPageContainer">
 
       <!-- Error Title -->
       <div id="errorTitle">
         <h1 id="errorTitleText_phishing" class="errorTitleText">&safeb.blocked.phishingPage.title3;</h1>
         <h1 id="errorTitleText_malware" class="errorTitleText">&safeb.blocked.malwarePage.title;</h1>
         <h1 id="errorTitleText_unwanted" class="errorTitleText">&safeb.blocked.unwantedPage.title;</h1>
+        <h1 id="errorTitleText_harmful" class="errorTitleText">&safeb.blocked.harmfulPage.title;</h1>
       </div>
 
       <div id="errorLongContent">
-      
+
         <!-- Short Description -->
         <div id="errorShortDesc">
           <p id="errorShortDescText_phishing">&safeb.blocked.phishingPage.shortDesc3;</p>
           <p id="errorShortDescText_malware">&safeb.blocked.malwarePage.shortDesc;</p>
           <p id="errorShortDescText_unwanted">&safeb.blocked.unwantedPage.shortDesc;</p>
+          <p id="errorShortDescText_harmful">&safeb.blocked.harmfulPage.shortDesc;</p>
         </div>
 
         <!-- Long Description -->
         <div id="errorLongDesc">
           <p id="errorLongDescText_phishing">&safeb.blocked.phishingPage.longDesc3;</p>
           <p id="errorLongDescText_malware">&safeb.blocked.malwarePage.longDesc;</p>
           <p id="errorLongDescText_unwanted">&safeb.blocked.unwantedPage.longDesc;</p>
         </div>
--- a/mobile/android/locales/en-US/chrome/phishing.dtd
+++ b/mobile/android/locales/en-US/chrome/phishing.dtd
@@ -18,8 +18,10 @@
 <!ENTITY safeb.blocked.phishingPage.shortDesc3 "This web page at <span id='phishing_sitename'/> has been reported as a deceptive site and has been blocked based on your security preferences.">
 <!ENTITY safeb.blocked.phishingPage.longDesc3 "<p>Deceptive sites are designed to trick you into doing something dangerous, like installing software, or revealing your personal information, like passwords, phone numbers or credit cards.</p><p>Entering any information on this web page may result in identity theft or other fraud.</p>">
 
 <!ENTITY safeb.blocked.unwantedPage.title "Reported Unwanted Software Site!">
 <!-- Localization note (safeb.blocked.unwanted.shortDesc) - Please don't translate the contents of the <span id="unwanted_sitename"/> tag.  It will be replaced at runtime with a domain name (e.g. www.badsite.com) -->
 <!ENTITY safeb.blocked.unwantedPage.shortDesc "This web page at <span id='unwanted_sitename'/> has been reported to contain unwanted software and has been blocked based on your security preferences.">
 <!ENTITY safeb.blocked.unwantedPage.longDesc "Unwanted software pages try to install software that can be deceptive and affect your system in unexpected ways.">
 
+<!ENTITY safeb.blocked.harmfulPage.title "The site ahead may contain malware">
+<!ENTITY safeb.blocked.harmfulPage.shortDesc "&brandShortName; blocked this page because it might try to install dangerous apps that steal or delete your information (for example, photos, passwords, messages and credit cards).">
\ No newline at end of file