Bug 1498836 - Port bug 1498758 to TB: Update placeholder value of DNS over HTTPS input, add default pref value. r=mkmelin
authorRichard Marti <richard.marti@gmail.com>
Sat, 13 Oct 2018 19:41:24 +0200
changeset 33363 dc3c8dc2370a631044218746be0798259cda73f5
parent 33362 2df9fd956bec02951a1b546897a78509df63e476
child 33364 fe10a3a8d48e6395ff6456ee2bbffebb8bd024da
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersmkmelin
bugs1498836, 1498758
Bug 1498836 - Port bug 1498758 to TB: Update placeholder value of DNS over HTTPS input, add default pref value. r=mkmelin
mail/components/preferences/connection.js
mail/components/preferences/connection.xul
--- a/mail/components/preferences/connection.js
+++ b/mail/components/preferences/connection.js
@@ -186,9 +186,14 @@ var gConnectionsDialog = {
 
   writeDnsOverHttpsUri() {
     // called to update pref with user input
     let input = document.getElementById("networkDnsOverHttpsUrl");
     let uriString = input.value.trim();
     // turn an empty string into `undefined` to clear the pref back to the default
     return uriString.length ? uriString : undefined;
   },
+
+  initDnsOverHttpsUI() {
+    let input = document.getElementById("networkDnsOverHttpsUrl");
+    input.placeholder = document.getElementById("network.trr.uri").defaultValue;
+  },
 };
--- a/mail/components/preferences/connection.xul
+++ b/mail/components/preferences/connection.xul
@@ -10,17 +10,17 @@
 <?xml-stylesheet href="chrome://global/skin/"?>
 <?xml-stylesheet href="chrome://messenger/skin/preferences/preferences.css"?>
 
 <prefwindow id="ConnectionsDialog" type="child"
             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
             title="&connectionsDialog.title;"
             dlgbuttons="accept,cancel"
             onbeforeaccept="return gConnectionsDialog.beforeAccept();"
-            onload="gConnectionsDialog.checkForSystemProxy();"
+            onload="gConnectionsDialog.checkForSystemProxy(); gConnectionsDialog.initDnsOverHttpsUI();"
 #ifdef XP_MACOSX
             style="width: &window.macWidth; !important;">
 #else
             style="width: &window.width; !important;">
 #endif
 
   <prefpane id="ConnectionsDialogPane">
     <preferences id="ConnectionPreferences">
@@ -171,14 +171,13 @@
     <hbox class="indent" flex="1" align="center">
       <label control="networkDnsOverHttpsUrl"
              label="&dnsOverHttpsUrl.label;"
              accesskey="&dnsOverHttpsUrl.accesskey;"
              tooltiptext="&dnsOverHttpsUrl.tooltip;"/>
       <textbox id="networkDnsOverHttpsUrl"
                flex="1"
                preference="network.trr.uri"
-               placeholder="https://doh.example.com/dns-query"
                onsynctopreference="return gConnectionsDialog.writeDnsOverHttpsUri()"/>
     </hbox>
     <separator/>
   </prefpane>
 </prefwindow>