Bug 1579019 - Disable "Config Editor" button if about:config is blocked by policy. r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 11 Sep 2019 00:08:14 +0200
changeset 36774 4e5fad04693c7317198a4e6f869ee36c8bd65c79
parent 36773 a466dc8e08635b376e7177714c81a31fc3273f0c
child 36775 fc2d525229e607e2ae04152cde5bd41ad6c31c9d
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
reviewersmkmelin
bugs1579019
Bug 1579019 - Disable "Config Editor" button if about:config is blocked by policy. r=mkmelin
mail/components/preferences/general.js
--- a/mail/components/preferences/general.js
+++ b/mail/components/preferences/general.js
@@ -429,16 +429,20 @@ var gGeneralPane = {
     Preferences.addSyncToPrefListener(element, () => this.writeCacheSize());
     Preferences.addSyncFromPrefListener(menulist, () =>
       this.readFontSelection()
     );
     Preferences.addSyncFromPrefListener(
       document.getElementById("soundUrlLocation"),
       () => this.readSoundLocation()
     );
+
+    if (!Services.policies.isAllowed("about:config")) {
+      document.getElementById("configEditor").disabled = true;
+    }
   },
 
   /**
    * Restores the default start page as the user's start page
    */
   restoreDefaultStartPage() {
     var startPage = Preferences.get("mailnews.start_page.url");
     startPage.value = startPage.defaultValue;