Bug 1474820 - Add the 'Accept the Risk and Add Exception' Button to the new certificate error pages r=johannh draft
authortrisha <tgupta@mozilla.com>
Sun, 29 Jul 2018 18:20:20 +0530
changeset 823861 c71e7bbc3e8c5d53049f9cdb36436fa57f35aa5f
parent 821449 92c595c5b6b510d45ea4cf1304ced7ed5e01ab9b
child 825289 8762d6e2e20dfe3c0bbd4d1f4352f829274e95ca
child 826195 c5458c91d01167dc8138bf0be3ca65e3d3288d72
child 826197 997be870d7958bc04167ce755451625b0d71bee1
child 826198 d85e5c25d38a99d432c7d7c6352ccb0e2976a449
push id117808
push userbmo:guptatrisha97@gmail.com
push dateSun, 29 Jul 2018 17:56:18 +0000
reviewersjohannh
bugs1474820
milestone62.0a1
Bug 1474820 - Add the 'Accept the Risk and Add Exception' Button to the new certificate error pages r=johannh MozReview-Commit-ID: 4ggxgj82GGd
browser/base/content/aboutNetError-new.xhtml
browser/base/content/browser.js
browser/locales/en-US/chrome/overrides/netError.dtd
--- a/browser/base/content/aboutNetError-new.xhtml
+++ b/browser/base/content/aboutNetError-new.xhtml
@@ -185,17 +185,17 @@
         <div id="badCertAdvancedPanel" class="advanced-panel">
           <p id="badCertTechnicalInfo"/>
           <div id="learnMoreContainer">
             <p><a href="https://support.mozilla.org/kb/what-does-your-connection-is-not-secure-mean" id="learnMoreLink" target="new">&errorReporting.learnMore;</a></p>
           </div>
           <div id="advancedPanelButtonContainer" class="button-container">
             <button id="advancedPanelReturnButton" class="primary" autocomplete="off">&returnToPreviousPage1.label;</button>
             <div class="exceptionDialogButtonContainer">
-              <button id="exceptionDialogButton">&securityOverride.exceptionButtonLabel;</button>
+              <button id="exceptionDialogButton">&securityOverride.exceptionButton1Label;</button>
             </div>
           </div>
         </div>
 
         <div id="certificateErrorReporting">
             <p class="toggle-container-with-text">
                 <input type="checkbox" id="automaticallyReportInFuture" role="checkbox" />
                 <label for="automaticallyReportInFuture" id="automaticallyReportInFuture">&errorReporting.automatic2;</label>
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3108,21 +3108,25 @@ var BrowserOnClick = {
               params.prefetchCert = true;
             case 1 : // Pre-populate
               params.location = location;
           }
         } catch (e) {
           Cu.reportError("Couldn't get ssl_override pref: " + e);
         }
 
-        window.openDialog("chrome://pippki/content/exceptionDialog.xul",
+        if (!Services.prefs.getBoolPref("browser.security.newcerterrorpage.enabled", false)) {
+          window.openDialog("chrome://pippki/content/exceptionDialog.xul",
                           "", "chrome,centerscreen,modal", params);
 
-        // If the user added the exception cert, attempt to reload the page
-        if (params.exceptionAdded) {
+          // If the user added the exception cert, attempt to reload the page
+          if (params.exceptionAdded) {
+            browser.reload();
+          }
+        } else {
           browser.reload();
         }
         break;
 
       case "returnButton":
         if (isTopFrame) {
           secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_BAD_CERT_TOP_GET_ME_OUT_OF_HERE);
         }
--- a/browser/locales/en-US/chrome/overrides/netError.dtd
+++ b/browser/locales/en-US/chrome/overrides/netError.dtd
@@ -187,16 +187,17 @@ was trying to connect. -->
 <!ENTITY cspBlocked.title "Blocked by Content Security Policy">
 <!ENTITY cspBlocked.longDesc "<p>&brandShortName; prevented this page from loading in this way because the page has a content security policy that disallows it.</p>">
 
 <!ENTITY corruptedContentErrorv2.title "Corrupted Content Error">
 <!ENTITY corruptedContentErrorv2.longDesc "<p>The page you are trying to view cannot be shown because an error in the data transmission was detected.</p><ul><li>Please contact the website owners to inform them of this problem.</li></ul>">
 
 
 <!ENTITY securityOverride.exceptionButtonLabel "Add Exception…">
+<!ENTITY securityOverride.exceptionButton1Label "Accept the Risk and Add Exception">
 
 <!ENTITY errorReporting.automatic2 "Report errors like this to help Mozilla identify and block malicious sites">
 <!ENTITY errorReporting.learnMore "Learn more…">
 
 <!ENTITY remoteXUL.title "Remote XUL">
 <!ENTITY remoteXUL.longDesc "<p><ul><li>Please contact the website owners to inform them of this problem.</li></ul></p>">
 
 <!ENTITY sslv3Used.title "Unable to Connect Securely">