Bug 1478572 - Turn on ESLint in mail/components/preferences (automatic changes). r=aceman
authorGeoff Lankow <geoff@darktrojan.net>
Mon, 03 Sep 2018 17:23:00 +1200
changeset 33088 0cac668a566b3f8bbfda07a76506b279d50215ec
parent 33087 a86f6197340ca93718eed554ae3c9a5417f4899a
child 33089 2a29ee0adb310b54a6a2df72034953fed8f2b043
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersaceman
bugs1478572
Bug 1478572 - Turn on ESLint in mail/components/preferences (automatic changes). r=aceman
.eslintignore
mail/components/preferences/actionsshared.js
mail/components/preferences/advanced.js
mail/components/preferences/applicationManager.js
mail/components/preferences/applications.js
mail/components/preferences/attachmentReminder.js
mail/components/preferences/chat.js
mail/components/preferences/compose.js
mail/components/preferences/connection.js
mail/components/preferences/cookies.js
mail/components/preferences/display.js
mail/components/preferences/downloads.js
mail/components/preferences/fonts.js
mail/components/preferences/general.js
mail/components/preferences/messagestyle.js
mail/components/preferences/offline.js
mail/components/preferences/permissions.js
mail/components/preferences/preferences.js
mail/components/preferences/preferencesTab.js
mail/components/preferences/privacy.js
mail/components/preferences/security.js
mail/components/preferences/sendoptions.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -61,16 +61,17 @@ mail/themes/**
 # mail/components exclusions
 mail/components/*
 !mail/components/about-support
 !mail/components/accountcreation
 !mail/components/addrbook
 !mail/components/devtools
 !mail/components/downloads
 !mail/components/extensions
+!mail/components/preferences
 
 # calendar/ exclusions
 
 # prefs files
 calendar/lightning/content/lightning.js
 
 # third party library
 calendar/base/modules/ical.js
--- a/mail/components/preferences/actionsshared.js
+++ b/mail/components/preferences/actionsshared.js
@@ -3,29 +3,28 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var FILEACTION_SAVE_TO_DISK     = 1;
 var FILEACTION_OPEN_INTERNALLY  = 2;
 var FILEACTION_OPEN_DEFAULT     = 3;
 var FILEACTION_OPEN_CUSTOM      = 4;
 var FILEACTION_OPEN_PLUGIN      = 5;
-function FileAction ()
-{
+function FileAction() {
 }
 FileAction.prototype = {
-  type        : "",
-  extension   : "",
+  type: "",
+  extension: "",
   hasExtension: true,
-  editable    : true,
-  smallIcon   : "",
-  bigIcon     : "",
-  typeName    : "",
-  action      : "",
-  mimeInfo    : null,
-  customHandler       : "",
-  handleMode          : false,
-  pluginAvailable     : false,
-  pluginEnabled       : false,
-  handledOnlyByPlugin : false
+  editable: true,
+  smallIcon: "",
+  bigIcon: "",
+  typeName: "",
+  action: "",
+  mimeInfo: null,
+  customHandler: "",
+  handleMode: false,
+  pluginAvailable: false,
+  pluginEnabled: false,
+  handledOnlyByPlugin: false,
 };
 
 
--- a/mail/components/preferences/advanced.js
+++ b/mail/components/preferences/advanced.js
@@ -13,29 +13,27 @@ ChromeUtils.import("resource://gre/modul
 
 var gAdvancedPane = {
   mPane: null,
   mInitialized: false,
   mShellServiceWorking: false,
   mBundle: null,
   requestingLocales: null,
 
-  init: function ()
-  {
+  init() {
     this.mPane = document.getElementById("paneAdvanced");
     this.updateCompactOptions();
     this.mBundle = document.getElementById("bundlePreferences");
     this.formatLocaleSetLabels();
 
     if (Services.prefs.getBoolPref("intl.multilingual.enabled")) {
       this.initMessengerLocale();
     }
 
-    if (!(("arguments" in window) && window.arguments[1]))
-    {
+    if (!(("arguments" in window) && window.arguments[1])) {
       // If no tab was specified, select the last used tab.
       let preference = document.getElementById("mail.preferences.advanced.selectedTabIndex");
       if (preference.value)
         document.getElementById("advancedPrefs").selectedIndex = preference.value;
     }
     if (AppConstants.MOZ_UPDATER)
       this.updateReadPrefs();
 
@@ -50,34 +48,28 @@ var gAdvancedPane = {
       this.initSubmitCrashes();
     this.initTelemetry();
     this.updateActualCacheSize();
 
     // Search integration -- check whether we should hide or disable integration
     let hideSearchUI = false;
     let disableSearchUI = false;
     ChromeUtils.import("resource:///modules/SearchIntegration.js");
-    if (SearchIntegration)
-    {
+    if (SearchIntegration) {
       if (SearchIntegration.osVersionTooLow)
         hideSearchUI = true;
       else if (SearchIntegration.osComponentsNotRunning)
         disableSearchUI = true;
-    }
-    else
-    {
+    } else {
       hideSearchUI = true;
     }
 
-    if (hideSearchUI)
-    {
+    if (hideSearchUI) {
       document.getElementById("searchIntegrationContainer").hidden = true;
-    }
-    else if (disableSearchUI)
-    {
+    } else if (disableSearchUI) {
       let searchCheckbox = document.getElementById("searchIntegration");
       searchCheckbox.checked = false;
       document.getElementById("searchintegration.enable").disabled = true;
     }
 
     // If the shell service is not working, disable the "Check now" button
     // and "perform check at startup" checkbox.
     try {
@@ -91,17 +83,17 @@ var gAdvancedPane = {
         document.getElementById("alwaysCheckDefault").checked = false;
       }
       if (document.getElementById("checkDefaultButton"))
         document.getElementById("checkDefaultButton").disabled = true;
       this.mShellServiceWorking = false;
     }
 
     if (AppConstants.MOZ_UPDATER) {
-      let distroId = Services.prefs.getCharPref("distribution.id" , "");
+      let distroId = Services.prefs.getCharPref("distribution.id", "");
       if (distroId) {
         let distroVersion = Services.prefs.getCharPref("distribution.version");
 
         let distroIdField = document.getElementById("distributionId");
         distroIdField.value = distroId + " - " + distroVersion;
         distroIdField.style.display = "block";
 
         let distroAbout = Services.prefs.getStringPref("distribution.about", "");
@@ -147,174 +139,161 @@ var gAdvancedPane = {
       }
 
       gAppUpdater = new appUpdater();
     }
 
     this.mInitialized = true;
   },
 
-  tabSelectionChanged: function ()
-  {
-    if (this.mInitialized)
-    {
+  tabSelectionChanged() {
+    if (this.mInitialized) {
       document.getElementById("mail.preferences.advanced.selectedTabIndex")
               .valueFromPreferences = document.getElementById("advancedPrefs").selectedIndex;
     }
   },
 
   /**
    * Checks whether Thunderbird is currently registered with the operating
    * system as the default app for mail, rss and news.  If Thunderbird is not
    * currently the default app, the user is given the option of making it the
    * default for each type; otherwise, the user is informed that Thunderbird is
    * already the default.
    */
-  checkDefaultNow: function (aAppType)
-  {
+  checkDefaultNow(aAppType) {
     if (!this.mShellServiceWorking)
       return;
 
     // otherwise, bring up the default client dialog
     gSubDialog.open("chrome://messenger/content/systemIntegrationDialog.xul",
                     "resizable=no", "calledFromPrefs");
   },
 
-  showConfigEdit: function()
-  {
+  showConfigEdit() {
     gSubDialog.open("chrome://global/content/config.xul");
   },
 
   /**
    * Set the default store contract ID.
    */
-  updateDefaultStore: function(storeID)
-  {
+  updateDefaultStore(storeID) {
     Services.prefs.setCharPref("mail.serverDefaultStoreContractID", storeID);
   },
 
   // NETWORK TAB
 
   /*
    * Preferences:
    *
    * browser.cache.disk.capacity
    * - the size of the browser cache in KB
    */
 
   // Retrieves the amount of space currently used by disk cache
-  updateActualCacheSize: function()
-  {
+  updateActualCacheSize() {
     let actualSizeLabel = document.getElementById("actualDiskCacheSize");
     let prefStrBundle = document.getElementById("bundlePreferences");
 
     // Needs to root the observer since cache service keeps only a weak reference.
     this.observer = {
-      onNetworkCacheDiskConsumption: function(consumption) {
+      onNetworkCacheDiskConsumption(consumption) {
         let size = DownloadUtils.convertByteUnits(consumption);
         // The XBL binding for the string bundle may have been destroyed if
         // the page was closed before this callback was executed.
         if (!prefStrBundle.getFormattedString) {
           return;
         }
         actualSizeLabel.value = prefStrBundle.getFormattedString("actualDiskCacheSize", size);
       },
 
       QueryInterface: ChromeUtils.generateQI([
         Ci.nsICacheStorageConsumptionObserver,
-        Ci.nsISupportsWeakReference
-      ])
+        Ci.nsISupportsWeakReference,
+      ]),
     };
 
     actualSizeLabel.value = prefStrBundle.getString("actualDiskCacheSizeCalculated");
 
     try {
       let cacheService =
         Cc["@mozilla.org/netwerk/cache-storage-service;1"]
           .getService(Ci.nsICacheStorageService);
       cacheService.asyncGetDiskConsumption(this.observer);
     } catch (e) {}
   },
 
-  updateCacheSizeUI: function (smartSizeEnabled)
-  {
+  updateCacheSizeUI(smartSizeEnabled) {
     document.getElementById("useCacheBefore").disabled = smartSizeEnabled;
     document.getElementById("cacheSize").disabled = smartSizeEnabled;
     document.getElementById("useCacheAfter").disabled = smartSizeEnabled;
   },
 
-  readSmartSizeEnabled: function ()
-  {
+  readSmartSizeEnabled() {
     // The smart_size.enabled preference element is inverted="true", so its
     // value is the opposite of the actual pref value
     var disabled = document.getElementById("browser.cache.disk.smart_size.enabled").value;
     this.updateCacheSizeUI(!disabled);
   },
 
   /**
    * Converts the cache size from units of KB to units of MB and returns that
    * value.
    */
-  readCacheSize: function ()
-  {
+  readCacheSize() {
     var preference = document.getElementById("browser.cache.disk.capacity");
     return preference.value / 1024;
   },
 
   /**
    * Converts the cache size as specified in UI (in MB) to KB and returns that
    * value.
    */
-  writeCacheSize: function ()
-  {
+  writeCacheSize() {
     var cacheSize = document.getElementById("cacheSize");
     var intValue = parseInt(cacheSize.value, 10);
     return isNaN(intValue) ? 0 : intValue * 1024;
   },
 
   /**
    * Clears the cache.
    */
-  clearCache: function ()
-  {
+  clearCache() {
     try {
       let cache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
                     .getService(Ci.nsICacheStorageService);
       cache.clear();
     } catch (ex) {}
     this.updateActualCacheSize();
   },
 
-  updateButtons: function (aButtonID, aPreferenceID)
-  {
+  updateButtons(aButtonID, aPreferenceID) {
     var button = document.getElementById(aButtonID);
     var preference = document.getElementById(aPreferenceID);
     // This is actually before the value changes, so the value is not as you expect.
     button.disabled = preference.value == true;
     return undefined;
   },
 
 /**
  * Selects the item of the radiogroup based on the pref values and locked
  * states.
  *
  * UI state matrix for update preference conditions
  *
  * UI Components:                              Preferences
  * Radiogroup                                  i   = app.update.auto
  */
-updateReadPrefs: function ()
-{
+updateReadPrefs() {
   var autoPref = document.getElementById("app.update.auto");
   var radiogroup = document.getElementById("updateRadioGroup");
 
   if (autoPref.value)
-    radiogroup.value="auto";      // Automatically install updates
+    radiogroup.value = "auto";      // Automatically install updates
   else
-    radiogroup.value="checkOnly"; // Check, but let me choose
+    radiogroup.value = "checkOnly"; // Check, but let me choose
 
   var canCheck = Cc["@mozilla.org/updates/update-service;1"].
                    getService(Ci.nsIApplicationUpdateService).
                    canCheckForUpdates;
 
   // canCheck is false if the binary platform or OS version is not known.
   // A locked pref is sufficient to disable the radiogroup.
   radiogroup.disabled = !canCheck || autoPref.locked;
@@ -326,140 +305,128 @@ updateReadPrefs: function ()
     try {
       let wrk = Cc["@mozilla.org/windows-registry-key;1"]
                   .createInstance(Ci.nsIWindowsRegKey);
       wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
                "SOFTWARE\\Mozilla\\MaintenanceService",
                wrk.ACCESS_READ | wrk.WOW64_64);
       installed = wrk.readIntValue("Installed");
       wrk.close();
-    } catch(e) { }
+    } catch (e) { }
     if (installed != 1) {
       document.getElementById("useService").hidden = true;
     }
   }
 },
 
 /**
  * Sets the pref values based on the selected item of the radiogroup.
  */
-updateWritePrefs: function ()
-{
+updateWritePrefs() {
   var autoPref = document.getElementById("app.update.auto");
   var radiogroup = document.getElementById("updateRadioGroup");
   switch (radiogroup.value) {
     case "auto":      // Automatically install updates
       autoPref.value = true;
       break;
     case "checkOnly": // Check, but but let me choose
       autoPref.value = false;
       break;
   }
 },
 
-  showUpdates: function ()
-  {
+  showUpdates() {
     gSubDialog.open("chrome://mozapps/content/update/history.xul");
   },
 
-  updateCompactOptions: function(aCompactEnabled)
-  {
+  updateCompactOptions(aCompactEnabled) {
     document.getElementById("offlineCompactFolderMin").disabled =
       !document.getElementById("offlineCompactFolder").checked ||
       document.getElementById("mail.purge_threshhold_mb").locked;
   },
 
-  updateSubmitCrashReports: function(aChecked)
-  {
+  updateSubmitCrashReports(aChecked) {
     Cc["@mozilla.org/toolkit/crash-reporter;1"]
       .getService(Ci.nsICrashReporter)
       .submitReports = aChecked;
   },
   /**
    * Display the return receipts configuration dialog.
    */
-  showReturnReceipts: function()
-  {
+  showReturnReceipts() {
     gSubDialog.open("chrome://messenger/content/preferences/receipts.xul",
                     "resizable=no");
   },
 
   /**
    * Display the the connection settings dialog.
    */
-  showConnections: function ()
-  {
+  showConnections() {
     gSubDialog.open("chrome://messenger/content/preferences/connection.xul",
                     "resizable=no");
   },
 
   /**
    * Display the the offline settings dialog.
    */
-  showOffline: function()
-  {
+  showOffline() {
     gSubDialog.open("chrome://messenger/content/preferences/offline.xul",
                     "resizable=no");
   },
 
   /**
    * Display the user's certificates and associated options.
    */
-  showCertificates: function ()
-  {
+  showCertificates() {
     gSubDialog.open("chrome://pippki/content/certManager.xul");
   },
 
   /**
    * security.OCSP.enabled is an integer value for legacy reasons.
    * A value of 1 means OCSP is enabled. Any other value means it is disabled.
    */
-  readEnableOCSP: function ()
-  {
+  readEnableOCSP() {
     var preference = document.getElementById("security.OCSP.enabled");
     // This is the case if the preference is the default value.
     if (preference.value === undefined) {
       return true;
     }
     return preference.value == 1;
   },
 
   /**
    * See documentation for readEnableOCSP.
    */
-  writeEnableOCSP: function ()
-  {
+  writeEnableOCSP() {
     var checkbox = document.getElementById("enableOCSP");
     return checkbox.checked ? 1 : 0;
   },
 
   /**
    * Display a dialog from which the user can manage his security devices.
    */
-  showSecurityDevices: function ()
-  {
+  showSecurityDevices() {
     gSubDialog.open("chrome://pippki/content/device_manager.xul");
   },
 
   /**
    * When the user toggles the layers.acceleration.disabled pref,
    * sync its new value to the gfx.direct2d.disabled pref too.
    */
-  updateHardwareAcceleration: function(aVal)
-  {
+  updateHardwareAcceleration(aVal) {
     if (AppConstants.platforms == "win")
       Services.prefs.setBoolPref("gfx.direct2d.disabled", !aVal);
   },
 
   // DATA CHOICES TAB
 
   /**
    * Open a text link.
    */
-  openTextLink: function (evt) {
+  openTextLink(evt) {
     // Opening links behind a modal dialog is poor form. Work around flawed
     // text-link handling by opening in browser if we'd instead get a content
     // tab behind the modal options dialog.
     if (Services.prefs.getBoolPref("browser.preferences.instantApply")) {
       return true; // Yes, open the link in a content tab.
     }
     var url = evt.target.getAttribute("href");
     var messenger = Cc["@mozilla.org/messenger;1"]
@@ -467,64 +434,61 @@ updateWritePrefs: function ()
     messenger.launchExternalURL(url);
     evt.preventDefault();
     return false;
   },
 
   /**
    * Set up or hide the Learn More links for various data collection options
    */
-  _setupLearnMoreLink: function (pref, element) {
+  _setupLearnMoreLink(pref, element) {
     // set up the Learn More link with the correct URL
     let url = Services.prefs.getCharPref(pref);
     let el = document.getElementById(element);
 
     if (url) {
       el.setAttribute("href", url);
     } else {
       el.setAttribute("hidden", "true");
     }
   },
 
-  initSubmitCrashes: function ()
-  {
+  initSubmitCrashes() {
     var checkbox = document.getElementById("submitCrashesBox");
     try {
       var cr = Cc["@mozilla.org/toolkit/crash-reporter;1"].
                getService(Ci.nsICrashReporter);
       checkbox.checked = cr.submitReports;
     } catch (e) {
       checkbox.style.display = "none";
     }
     this._setupLearnMoreLink("toolkit.crashreporter.infoURL", "crashReporterLearnMore");
   },
 
-  updateSubmitCrashes: function ()
-  {
+  updateSubmitCrashes() {
     var checkbox = document.getElementById("submitCrashesBox");
     try {
       var cr = Cc["@mozilla.org/toolkit/crash-reporter;1"].
                getService(Ci.nsICrashReporter);
       cr.submitReports = checkbox.checked;
     } catch (e) { }
   },
 
 
   /**
    * The preference/checkbox is configured in XUL.
    *
    * In all cases, set up the Learn More link sanely
    */
-  initTelemetry: function ()
-  {
+  initTelemetry() {
     if (AppConstants.MOZ_TELEMETRY_REPORTING)
       this._setupLearnMoreLink("toolkit.telemetry.infoURL", "telemetryLearnMore");
   },
 
-  formatLocaleSetLabels: function() {
+  formatLocaleSetLabels() {
     const localeService =
       Cc["@mozilla.org/intl/localeservice;1"]
         .getService(Ci.mozILocaleService);
     const osprefs =
       Cc["@mozilla.org/intl/ospreferences;1"]
         .getService(Ci.mozIOSPreferences);
     let appLocale = localeService.getAppLocalesAsBCP47()[0];
     let rsLocale = osprefs.getRegionalPrefsLocales()[0];
--- a/mail/components/preferences/applicationManager.js
+++ b/mail/components/preferences/applicationManager.js
@@ -64,18 +64,17 @@ var gAppManagerDialog = {
   remove: function appManager_remove() {
     var list = document.getElementById("appList");
     this._removed.push(list.selectedItem.app);
     var index = list.selectedIndex;
     list.selectedItem.remove();
     if (list.getRowCount() == 0) {
       // The list is now empty, make the bottom part disappear
       document.getElementById("appDetails").hidden = true;
-    }
-    else {
+    } else {
       // Select the item at the same index, if we removed the last
       // item of the list, select the previous item
       if (index == list.getRowCount())
         --index;
       list.selectedIndex = index;
     }
   },
 
@@ -94,10 +93,10 @@ var gAppManagerDialog = {
       address = app.uriTemplate;
     else if (app instanceof Ci.nsIWebContentHandlerInfo)
       address = app.uri;
     document.getElementById("appLocation").value = address;
     var bundle = document.getElementById("appManagerBundle");
     var appType = (app instanceof Ci.nsILocalHandlerApp) ?
                     "descriptionLocalApp" : "descriptionWebApp";
     document.getElementById("appType").value = bundle.getString(appType);
-  }
+  },
 };
--- a/mail/components/preferences/applications.js
+++ b/mail/components/preferences/applications.js
@@ -1,14 +1,14 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-//****************************************************************************//
+//* ***************************************************************************//
 // Constants & Enumeration Values
 
 var PREF_DISABLED_PLUGIN_TYPES = "plugin.disable_full_page_plugin_for_types";
 
 // Preferences that affect which entries to show in the list.
 var PREF_SHOW_PLUGINS_IN_LIST = "browser.download.show_plugins_in_list";
 var PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS =
   "browser.download.hide_plugins_without_extensions";
@@ -24,36 +24,33 @@ var kActionUsePlugin = 5;
 var APP_ICON_ATTR_NAME = "appHandlerIcon";
 
 // CloudFile account tools used by gCloudFileTab.
 ChromeUtils.import("resource:///modules/cloudFileAccounts.js");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
-//****************************************************************************//
+//* ***************************************************************************//
 // Utilities
 
 function getDisplayNameForFile(aFile) {
   if (AppConstants.platform == "win") {
     if (aFile instanceof Ci.nsILocalFileWin) {
       try {
         return aFile.getVersionInfoField("FileDescription");
-      }
-      catch(ex) {
+      } catch (ex) {
         // fall through to the file name
       }
     }
-  }
-  else if (AppConstants.platform == "macosx") {
+  } else if (AppConstants.platform == "macosx") {
     if (aFile instanceof Ci.nsILocalFileMac) {
       try {
         return aFile.bundleDisplayName;
-      }
-      catch(ex) {
+      } catch (ex) {
         // fall through to the file name
       }
     }
   }
 
   return aFile.leafName;
 }
 
@@ -76,26 +73,26 @@ function getLocalHandlerApp(aFile) {
 function ArrayEnumerator(aItems) {
   this._index = 0;
   this._contents = aItems;
 }
 
 ArrayEnumerator.prototype = {
   _index: 0,
 
-  hasMoreElements: function() {
+  hasMoreElements() {
     return this._index < this._contents.length;
   },
 
-  getNext: function() {
+  getNext() {
     return this._contents[this._index++];
-  }
+  },
 };
 
-//****************************************************************************//
+//* ***************************************************************************//
 // HandlerInfoWrapper
 
 /**
  * This object wraps nsIHandlerInfo with some additional functionality
  * the Applications prefpane needs to display and allow modification of
  * the list of handled types.
  *
  * We create an instance of this wrapper for each entry we might display
@@ -114,26 +111,26 @@ function HandlerInfoWrapper(aType, aHand
 }
 
 HandlerInfoWrapper.prototype = {
   // The wrapped nsIHandlerInfo object.  In general, this object is private,
   // but there are a couple cases where callers access it directly for things
   // we haven't (yet?) implemented, so we make it a public property.
   wrappedHandlerInfo: null,
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // Convenience Utils
 
   _handlerSvc: Cc["@mozilla.org/uriloader/handler-service;1"]
                  .getService(Ci.nsIHandlerService),
 
   _categoryMgr: Cc["@mozilla.org/categorymanager;1"]
                   .getService(Ci.nsICategoryManager),
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // nsIHandlerInfo
 
   // The MIME type or protocol scheme.
   _type: null,
   get type() {
     return this._type;
   },
 
@@ -153,32 +150,32 @@ HandlerInfoWrapper.prototype = {
     return this.wrappedHandlerInfo.preferredApplicationHandler;
   },
 
   set preferredApplicationHandler(aNewValue) {
     this.wrappedHandlerInfo.preferredApplicationHandler = aNewValue;
 
     // Make sure the preferred handler is in the set of possible handlers.
     if (aNewValue)
-      this.addPossibleApplicationHandler(aNewValue)
+      this.addPossibleApplicationHandler(aNewValue);
   },
 
   get possibleApplicationHandlers() {
     return this.wrappedHandlerInfo.possibleApplicationHandlers;
   },
 
-  addPossibleApplicationHandler: function(aNewHandler) {
+  addPossibleApplicationHandler(aNewHandler) {
     try {
       if (this.possibleApplicationHandlers.indexOf(0, aNewHandler) != -1)
         return;
     } catch (e) { }
     this.possibleApplicationHandlers.appendElement(aNewHandler);
   },
 
-  removePossibleApplicationHandler: function(aHandler) {
+  removePossibleApplicationHandler(aHandler) {
     var defaultApp = this.preferredApplicationHandler;
     if (defaultApp && aHandler.equals(defaultApp)) {
       // If the app we remove was the default app, we must make sure
       // it won't be used anymore
       this.alwaysAskBeforeHandling = true;
       this.preferredApplicationHandler = null;
     }
 
@@ -208,18 +205,17 @@ HandlerInfoWrapper.prototype = {
     // Note: "save to disk" is an invalid value for protocol info objects,
     // but the alwaysAskBeforeHandling getter will detect that situation
     // and always return true in that case to override this invalid value.
     if (this.wrappedHandlerInfo.preferredAction ==
           Ci.nsIHandlerInfo.useHelperApp &&
         !gApplicationsPane.isValidHandlerApp(this.preferredApplicationHandler)) {
       if (this.wrappedHandlerInfo.hasDefaultHandler)
         return Ci.nsIHandlerInfo.useSystemDefault;
-      else
-        return Ci.nsIHandlerInfo.saveToDisk;
+      return Ci.nsIHandlerInfo.saveToDisk;
     }
 
     return this.wrappedHandlerInfo.preferredAction;
   },
 
   set preferredAction(aNewValue) {
     // We don't modify the preferred action if the new action is to use a plugin
     // because handler info objects don't understand our custom "use plugin"
@@ -252,36 +248,36 @@ HandlerInfoWrapper.prototype = {
     return this.wrappedHandlerInfo.alwaysAskBeforeHandling;
   },
 
   set alwaysAskBeforeHandling(aNewValue) {
     this.wrappedHandlerInfo.alwaysAskBeforeHandling = aNewValue;
   },
 
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // nsIMIMEInfo
 
   // The primary file extension associated with this type, if any.
   //
   // XXX Plugin objects contain an array of MimeType objects with "suffixes"
   // properties; if this object has an associated plugin, shouldn't we check
   // those properties for an extension?
   get primaryExtension() {
     try {
       if (this.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo &&
           this.wrappedHandlerInfo.primaryExtension)
         return this.wrappedHandlerInfo.primaryExtension;
-    } catch(ex) {}
+    } catch (ex) {}
 
     return null;
   },
 
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // Plugin Handling
 
   // A plugin that can handle this type, if any.
   //
   // Note: just because we have one doesn't mean it *will* handle the type.
   // That depends on whether or not the type is in the list of types for which
   // plugin handling is disabled.
   plugin: null,
@@ -299,43 +295,43 @@ HandlerInfoWrapper.prototype = {
   // check for the presence of a user-configured record to determine whether
   // or not this type is only handled by a plugin.  Filed as bug 395142.
   handledOnlyByPlugin: undefined,
 
   get isDisabledPluginType() {
     return this._getDisabledPluginTypes().includes(this.type);
   },
 
-  _getDisabledPluginTypes: function() {
+  _getDisabledPluginTypes() {
     var types = "";
 
     if (Services.prefs.prefHasUserValue(PREF_DISABLED_PLUGIN_TYPES))
       types = Services.prefs.getCharPref(PREF_DISABLED_PLUGIN_TYPES);
 
     // Only split if the string isn't empty so we don't end up with an array
     // containing a single empty string.
     return types ? types.split(",") : [];
   },
 
-  disablePluginType: function() {
+  disablePluginType() {
     var disabledPluginTypes = this._getDisabledPluginTypes();
 
     if (!disabledPluginTypes.includes(this.type))
       disabledPluginTypes.push(this.type);
 
     Services.prefs.setCharPref(PREF_DISABLED_PLUGIN_TYPES,
                                disabledPluginTypes.join(","));
 
     // Update the category manager so existing browser windows update.
     this._categoryMgr.deleteCategoryEntry("Gecko-Content-Viewers",
                                           this.type,
                                           false);
   },
 
-  enablePluginType: function() {
+  enablePluginType() {
     var disabledPluginTypes = this._getDisabledPluginTypes();
 
     var type = this.type;
     disabledPluginTypes = disabledPluginTypes.filter(v => v != type);
 
     Services.prefs.setCharPref(PREF_DISABLED_PLUGIN_TYPES,
                                disabledPluginTypes.join(","));
 
@@ -344,59 +340,59 @@ HandlerInfoWrapper.prototype = {
       addCategoryEntry("Gecko-Content-Viewers",
                        this.type,
                        "@mozilla.org/content/plugin/document-loader-factory;1",
                        false,
                        true);
   },
 
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // Storage
 
-  store: function() {
+  store() {
     this._handlerSvc.store(this.wrappedHandlerInfo);
   },
 
-  remove: function() {
+  remove() {
     this._handlerSvc.remove(this.wrappedHandlerInfo);
   },
 
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // Icons
 
   get smallIcon() {
     return this._getIcon(16);
   },
 
   get largeIcon() {
     return this._getIcon(32);
   },
 
-  _getIcon: function(aSize) {
+  _getIcon(aSize) {
     if (this.primaryExtension)
       return "moz-icon://goat." + this.primaryExtension + "?size=" + aSize;
 
     if (this.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo)
       return "moz-icon://goat?size=" + aSize + "&contentType=" + this.type;
 
     // FIXME: consider returning some generic icon when we can't get a URL for
     // one (for example in the case of protocol schemes).  Filed as bug 395141.
     return null;
-  }
+  },
 };
 
 var gApplicationsTabController = {
   mInitialized: false,
   // We default to displaying the Outgoing tab, which is the tab at index 1
   // of the attachmentPrefs tabs.
   mDefaultIndex: 1,
 
-  init: function() {
+  init() {
     if (this.mInitialized)
       return;
 
     gApplicationsPane.init();
 
     let tabbox = document.getElementById("attachmentPrefs");
 
     // If BigFiles is disabled, hide the "Outgoing" tab, and the tab
@@ -417,80 +413,80 @@ var gApplicationsTabController = {
       // If no tab was specified, select the last used tab.
       let preference = document.getElementById("mail.preferences.applications.selectedTabIndex");
       tabbox.selectedIndex = preference.value != null ? preference.value : this.mDefaultIndex;
     }
 
     this.mInitialized = true;
   },
 
-  tabSelectionChanged: function() {
+  tabSelectionChanged() {
     if (this.mInitialized)
       document.getElementById("mail.preferences.applications.selectedTabIndex")
               .valueFromPreferences = document.getElementById("attachmentPrefs")
               .selectedIndex;
   },
 
-}
+};
 
 var gCloudFileController = {
   commands: {
     cmd_addCloudfileAccount: {
-      isEnabled: function() {
+      isEnabled() {
         return true;
       },
-      doCommand: function() {
+      doCommand() {
         gCloudFileTab.addCloudFileAccount();
       },
     },
 
     cmd_removeCloudfileAccount: {
-      isEnabled: function() {
+      isEnabled() {
         let listbox = document.getElementById("cloudFileView");
         return listbox.selectedCount > 0;
       },
-      doCommand: function() {
+      doCommand() {
         gCloudFileTab.removeCloudFileAccount();
       },
     },
 
     cmd_reauthCloudfileAccount: {
-      isEnabled: function() {
+      isEnabled() {
         return true;
       },
-      doCommand: function() {
+      doCommand() {
         gCloudFileTab.authSelected();
       },
     },
 
   },
 
-  supportsCommand: function(aCommand) {
+  supportsCommand(aCommand) {
     return (aCommand in this.commands);
   },
 
-  isCommandEnabled: function(aCommand) {
+  isCommandEnabled(aCommand) {
     if (!this.supportsCommand(aCommand))
       return false;
     return this.commands[aCommand].isEnabled();
   },
 
-  doCommand: function(aCommand) {
+  doCommand(aCommand) {
     if (!this.supportsCommand(aCommand))
       return;
 
     let cmd = this.commands[aCommand];
 
     if (!cmd.isEnabled())
       return;
 
     cmd.doCommand();
   },
-  onEvent: function(event) {},
-}
+  onEvent(event) {},
+};
 
 function CommandUpdate_CloudFile() {
   goUpdateCommand("cmd_removeCloudfileAccount");
   goUpdateCommand("cmd_addCloudfileAccount");
 }
 
 var gCloudFileTab = {
   _initialized: false,
@@ -504,17 +500,17 @@ var gCloudFileTab = {
   _loadingPanel: null,
   _authErrorPanel: null,
 
   get _strings() {
     return Services.strings
                    .createBundle("chrome://messenger/locale/preferences/applications.properties");
   },
 
-  init: function() {
+  init() {
     if (this._initialized)
       return;
 
     this._list = document.getElementById("cloudFileView");
     this._settingsDeck = document.getElementById("cloudFileSettingsDeck");
     this._defaultPanel = document.getElementById("cloudFileDefaultPanel");
     this._settingsPanelWrap = document.getElementById("cloudFileSettingsWrapper");
     this._loadingPanel = document.getElementById("cloudFileLoadingPanel");
@@ -608,28 +604,28 @@ var gCloudFileTab = {
     }
   },
 
   requestUserInfoForItem: function CFT_requestUserInfoForItem(aItem, aWithUI) {
     let accountKey = aItem.value;
     let account = cloudFileAccounts.getAccount(accountKey);
 
     let observer = {
-      onStopRequest: function(aRequest, aContext, aStatusCode) {
+      onStopRequest(aRequest, aContext, aStatusCode) {
         gCloudFileTab._accountCache[accountKey].result = aStatusCode;
         gCloudFileTab.onUserInfoRequestDone(accountKey);
       },
-      onStartRequest: function(aRequest, aContext) {
+      onStartRequest(aRequest, aContext) {
         aItem.setAttribute("state", "connecting");
       },
     };
 
-    let accountInfo = {account: account,
+    let accountInfo = {account,
                        listItem: aItem,
-                       result: Cr.NS_ERROR_NOT_AVAILABLE}
+                       result: Cr.NS_ERROR_NOT_AVAILABLE};
 
     this._accountCache[accountKey] = accountInfo;
 
     this._settingsDeck.selectedPanel = this._loadingPanel;
     account.refreshUserInfo(aWithUI, observer);
   },
 
   onUserInfoRequestDone: function CFT_onUserInfoRequestDone(aAccountKey) {
@@ -681,27 +677,25 @@ var gCloudFileTab = {
     let account = this._accountCache[aAccountKey].account;
     let result = this._accountCache[aAccountKey].result;
 
     if (result == Cr.NS_ERROR_NOT_AVAILABLE)
       this._settingsDeck.selectedPanel = this._loadingPanel;
     else if (result == Cr.NS_OK) {
       this._settingsDeck.selectedPanel = this._settingsPanelWrap;
       this._showAccountManagement(account);
-    }
-    else if (result == Ci.nsIMsgCloudFileProvider.authErr) {
+    } else if (result == Ci.nsIMsgCloudFileProvider.authErr) {
       this._settingsDeck.selectedPanel = this._authErrorPanel;
-    }
-    else {
+    } else {
       Cu.reportError("Unexpected connection error.");
     }
   },
 
   _showAccountManagement: function CFT__showAccountManagement(aProvider) {
-    let iframe = document.createElement('iframe');
+    let iframe = document.createElement("iframe");
 
     iframe.setAttribute("src", aProvider.managementURL);
     iframe.setAttribute("flex", "1");
 
     // If we have a past iframe, we replace it. Else append
     // to the wrapper.
     if (this._settings)
       this._settings.remove();
@@ -711,17 +705,17 @@ var gCloudFileTab = {
 
     // When the iframe loads, populate it with the provider.
     this._settings.contentWindow.addEventListener("load",
       function loadProvider() {
         try {
           iframe.contentWindow
                 .wrappedJSObject
                 .onLoadProvider(aProvider);
-        } catch(e) {
+        } catch (e) {
           Cu.reportError(e);
         }
       }, {capture: false, once: true});
 
     // When the iframe (or any subcontent) fires the DOMContentLoaded event,
     // attach the _onClickLink handler to any anchor elements that we can find.
     this._settings.contentWindow.addEventListener("DOMContentLoaded",
       function addClickListeners(e) {
@@ -802,20 +796,20 @@ var gCloudFileTab = {
   },
 
   updateThreshold: function CFT_updateThreshold() {
     document.getElementById("cloudFileThreshold").disabled =
     !document.getElementById("enableThreshold").checked;
   },
 
   QueryInterface: ChromeUtils.generateQI(["nsIObserver",
-                                          "nsISupportsWeakReference"])
-}
+                                          "nsISupportsWeakReference"]),
+};
 
-//****************************************************************************//
+//* ***************************************************************************//
 // Prefpane Controller
 
 var gApplicationsPane = {
   // The set of types the app knows how to handle.  A hash of HandlerInfoWrapper
   // objects, indexed by type.
   _handledTypes: {},
 
   // The list of types we can show, sorted by the sort column/direction.
@@ -829,38 +823,38 @@ var gApplicationsPane = {
 
   // A count of the number of times each visible type description appears.
   // We use these counts to determine whether or not to annotate descriptions
   // with their types to distinguish duplicate descriptions from each other.
   // A hash of integer counts, indexed by string description.
   _visibleTypeDescriptionCount: new Map(),
 
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // Convenience & Performance Shortcuts
 
   // These get defined by init().
-  _brandShortName : null,
-  _prefsBundle    : null,
-  _list           : null,
-  _filter         : null,
+  _brandShortName: null,
+  _prefsBundle: null,
+  _list: null,
+  _filter: null,
 
-  _mimeSvc      : Cc["@mozilla.org/mime;1"]
+  _mimeSvc: Cc["@mozilla.org/mime;1"]
                     .getService(Ci.nsIMIMEService),
 
-  _helperAppSvc : Cc["@mozilla.org/uriloader/external-helper-app-service;1"]
+  _helperAppSvc: Cc["@mozilla.org/uriloader/external-helper-app-service;1"]
                     .getService(Ci.nsIExternalHelperAppService),
 
-  _handlerSvc   : Cc["@mozilla.org/uriloader/handler-service;1"]
+  _handlerSvc: Cc["@mozilla.org/uriloader/handler-service;1"]
                     .getService(Ci.nsIHandlerService),
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // Initialization & Destruction
 
-  init: function() {
+  init() {
     // Initialize shortcuts to some commonly accessed elements & values.
     this._brandShortName =
       document.getElementById("bundleBrand").getString("brandShortName");
     this._prefsBundle = document.getElementById("bundlePreferences");
     this._list = document.getElementById("handlersView");
     this._filter = document.getElementById("filter");
 
     // Observe preferences that influence what we display so we can rebuild
@@ -869,17 +863,17 @@ var gApplicationsPane = {
     Services.prefs.addObserver(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS, this);
 
     // Listen for window unload so we can remove our preference observers.
     window.addEventListener("unload", this, {capture: false, once: true});
 
     // Figure out how we should be sorting the list.  We persist sort settings
     // across sessions, so we can't assume the default sort column/direction.
     // XXX should we be using the XUL sort service instead?
-    this._sortColumn = document.getElementById("typeColumn")
+    this._sortColumn = document.getElementById("typeColumn");
     if (document.getElementById("actionColumn").hasAttribute("sortDirection")) {
       this._sortColumn = document.getElementById("actionColumn");
       // The typeColumn element always has a sortDirection attribute,
       // either because it was persisted or because the default value
       // from the xul file was used.  If we are sorting on the other
       // column, we should remove it.
       document.getElementById("typeColumn").removeAttribute("sortDirection");
     }
@@ -893,35 +887,35 @@ var gApplicationsPane = {
     var _delayedPaneLoad = function(self) {
       self._loadData();
       self._rebuildVisibleTypes();
       self._sortVisibleTypes();
       self.rebuildView();
 
       // Notify observers that the UI is now ready
       Services.obs.notifyObservers(window, "app-handler-pane-loaded");
-    }
+    };
     setTimeout(_delayedPaneLoad, 0, this);
   },
 
-  destroy: function() {
+  destroy() {
     Services.prefs.removeObserver(PREF_SHOW_PLUGINS_IN_LIST, this);
     Services.prefs.removeObserver(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS, this);
   },
 
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // nsISupports
 
   QueryInterface: ChromeUtils.generateQI(["nsIObserver"]),
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // nsIObserver
 
-  observe: function (aSubject, aTopic, aData) {
+  observe(aSubject, aTopic, aData) {
     // Rebuild the list when there are changes to preferences that influence
     // whether or not to show certain entries in the list.
     if (aTopic == "nsPref:changed" && !this._storingAction) {
       // These two prefs alter the list of visible types, so we have to rebuild
       // that list when they change.
       if (aData == PREF_SHOW_PLUGINS_IN_LIST ||
           aData == PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS) {
         this._rebuildVisibleTypes();
@@ -930,29 +924,29 @@ var gApplicationsPane = {
 
       // All the prefs we observe can affect what we display, so we rebuild
       // the view when any of them changes.
       this.rebuildView();
     }
   },
 
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // EventListener
 
-  handleEvent: function(aEvent) {
+  handleEvent(aEvent) {
     if (aEvent.type == "unload")
       this.destroy();
   },
 
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // Composed Model Construction
 
-  _loadData: function() {
+  _loadData() {
     this._loadPluginHandlers();
     this._loadApplicationHandlers();
   },
 
   /**
    * Load the set of handlers defined by plugins.
    *
    * Note: if there's more than one plugin for a given MIME type, we assume
@@ -967,17 +961,17 @@ var gApplicationsPane = {
    *
    * I'll also note that my reading of nsPluginTag::RegisterWithCategoryManager
    * suggests that enabledPlugin is only determined during registration
    * and does not get updated when plugin.disable_full_page_plugin_for_types
    * changes (unless modification of that preference spawns reregistration).
    * So even if we could use enabledPlugin to get the plugin that would be used,
    * we'd still need to check the pref ourselves to find out if it's enabled.
    */
-  _loadPluginHandlers: function() {
+  _loadPluginHandlers() {
     for (let i = 0; i < navigator.plugins.length; ++i) {
       let plugin = navigator.plugins[i];
       for (let j = 0; j < plugin.length; ++j) {
         let type = plugin[j].type;
 
         let handlerInfoWrapper;
         if (type in this._handledTypes)
           handlerInfoWrapper = this._handledTypes[type];
@@ -992,40 +986,39 @@ var gApplicationsPane = {
         handlerInfoWrapper.plugin = plugin;
       }
     }
   },
 
   /**
    * Load the set of handlers defined by the application datastore.
    */
-  _loadApplicationHandlers: function() {
+  _loadApplicationHandlers() {
     var wrappedHandlerInfos = this._handlerSvc.enumerate();
     while (wrappedHandlerInfos.hasMoreElements()) {
       let wrappedHandlerInfo =
         wrappedHandlerInfos.getNext().QueryInterface(Ci.nsIHandlerInfo);
       let type = wrappedHandlerInfo.type;
 
       let handlerInfoWrapper;
       if (type in this._handledTypes) {
         handlerInfoWrapper = this._handledTypes[type];
-      }
-      else {
+      } else {
         handlerInfoWrapper = new HandlerInfoWrapper(type, wrappedHandlerInfo);
         this._handledTypes[type] = handlerInfoWrapper;
       }
 
       handlerInfoWrapper.handledOnlyByPlugin = false;
     }
   },
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // View Construction
 
-  _rebuildVisibleTypes: function() {
+  _rebuildVisibleTypes() {
     // Reset the list of visible types and the visible type description counts.
     this._visibleTypes.length = 0;
     this._visibleTypeDescriptionCount.clear();
 
     // Get the preferences that help determine what types to show.
     var showPlugins = Services.prefs.getBoolPref(PREF_SHOW_PLUGINS_IN_LIST);
     var hidePluginsWithoutExtensions =
       Services.prefs.getBoolPref(PREF_HIDE_PLUGINS_WITHOUT_EXTENSIONS);
@@ -1053,17 +1046,17 @@ var gApplicationsPane = {
       this._visibleTypes.push(handlerInfo);
 
       let descCount = this._visibleTypeDescriptionCount.has(handlerInfo.description) ?
         (this._visibleTypeDescriptionCount.get(handlerInfo.description) + 1) : 1;
       this._visibleTypeDescriptionCount.set(handlerInfo.description, descCount);
     }
   },
 
-  rebuildView: function() {
+  rebuildView() {
     // Clear the list of entries.
     while (this._list.childNodes.length > 1)
       this._list.lastChild.remove();
     var visibleTypes = this._visibleTypes;
 
     // If the user is filtering the list, then only show matching types.
     if (this._filter.value)
       visibleTypes = visibleTypes.filter(this._matchesFilter, this);
@@ -1085,55 +1078,55 @@ var gApplicationsPane = {
       }
 
       this._list.appendChild(item);
     }
 
     this._selectLastSelectedType();
   },
 
-  _matchesFilter: function(aType) {
+  _matchesFilter(aType) {
     var filterValue = this._filter.value.toLowerCase();
     return this._describeType(aType).toLowerCase().includes(filterValue) ||
            this._describePreferredAction(aType).toLowerCase().includes(filterValue);
   },
 
   /**
    * Describe, in a human-readable fashion, the type represented by the given
    * handler info object.  Normally this is just the description provided by
    * the info object, but if more than one object presents the same description,
    * then we annotate the duplicate descriptions with the type itself to help
    * users distinguish between those types.
    *
    * @param aHandlerInfo {nsIHandlerInfo} the type being described
    * @return {string} a description of the type
    */
-  _describeType: function(aHandlerInfo) {
+  _describeType(aHandlerInfo) {
     let details = this._typeDetails(aHandlerInfo);
 
     if (details)
       return this._prefsBundle.getFormattedString("typeDescriptionWithDetails",
                                                   [aHandlerInfo.description,
                                                    details]);
     return aHandlerInfo.description;
   },
 
   /**
    * Get the details for the type represented by the given handler info
    * object.
    *
    * @param aHandlerInfo {nsIHandlerInfo} the type to get the extensions for.
    * @return {string} the extensions for the type
    */
-  _typeDetails: function(aHandlerInfo) {
+  _typeDetails(aHandlerInfo) {
     let exts = [];
     if (aHandlerInfo.wrappedHandlerInfo instanceof Ci.nsIMIMEInfo) {
       let extIter = aHandlerInfo.wrappedHandlerInfo.getFileExtensions();
-      while(extIter.hasMore()) {
-        let ext = "."+extIter.getNext();
+      while (extIter.hasMore()) {
+        let ext = "." + extIter.getNext();
         if (!exts.includes(ext))
           exts.push(ext);
       }
     }
     exts.sort();
     exts = exts.join(", ");
     if (this._visibleTypeDescriptionCount.has(aHandlerInfo.description)) {
       if (exts)
@@ -1155,17 +1148,17 @@ var gApplicationsPane = {
    * XXX Should this be part of the HandlerInfoWrapper interface?  It would
    * violate the separation of model and view, but it might make more sense
    * nonetheless (f.e. it would make sortTypes easier).
    *
    * @param aHandlerInfo {nsIHandlerInfo} the type whose preferred action
    *                                      is being described
    * @return {string} a description of the action
    */
-  _describePreferredAction: function(aHandlerInfo) {
+  _describePreferredAction(aHandlerInfo) {
     // alwaysAskBeforeHandling overrides the preferred action, so if that flag
     // is set, then describe that behavior instead.  For most types, this is
     // the "alwaysAsk" string, but for the feed type we show something special.
     if (aHandlerInfo.alwaysAskBeforeHandling)
         return this._prefsBundle.getString("alwaysAsk");
 
     switch (aHandlerInfo.preferredAction) {
       case Ci.nsIHandlerInfo.saveToDisk:
@@ -1204,17 +1197,17 @@ var gApplicationsPane = {
                                                      this._brandShortName]);
       default:
         // Hopefully this never happens.
         Cu.reportError("No description for action " + aHandlerInfo.preferredAction + " found!");
         return "";
     }
   },
 
-  _selectLastSelectedType: function() {
+  _selectLastSelectedType() {
     // If the list is disabled by the pref.downloads.disable_button.edit_actions
     // preference being locked, then don't select the type, as that would cause
     // it to appear selected, with a different background and an actions menu
     // that makes it seem like you can choose an action for the type.
     if (this._list.disabled)
       return;
 
     var lastSelectedType = this._list.getAttribute("lastSelectedType");
@@ -1228,33 +1221,33 @@ var gApplicationsPane = {
     this._list.selectedItem = item;
   },
 
   /**
    * Whether or not the given handler app is valid.
    * @param aHandlerApp {nsIHandlerApp} the handler app in question
    * @return {boolean} whether or not it's valid
    */
-  isValidHandlerApp: function(aHandlerApp) {
+  isValidHandlerApp(aHandlerApp) {
     if (!aHandlerApp)
       return false;
 
     if (aHandlerApp instanceof Ci.nsILocalHandlerApp)
       return this._isValidHandlerExecutable(aHandlerApp.executable);
 
     if (aHandlerApp instanceof Ci.nsIWebHandlerApp)
       return aHandlerApp.uriTemplate;
 
     if (aHandlerApp instanceof Ci.nsIWebContentHandlerInfo)
       return aHandlerApp.uri;
 
     return false;
   },
 
-  _isValidHandlerExecutable: function(aExecutable) {
+  _isValidHandlerExecutable(aExecutable) {
     let isExecutable = aExecutable &&
                        aExecutable.exists() &&
                        aExecutable.isExecutable();
 // XXXben - we need to compare this with the running instance executable
 //          just don't know how to do that via script...
 // XXXmano TBD: can probably add this to nsIShellService
     if (AppConstants.platform == "win")
       return isExecutable && (aExecutable.leafName != (AppConstants.MOZ_APP_NAME + ".exe"));
@@ -1264,17 +1257,17 @@ var gApplicationsPane = {
 
     return isExecutable && (aExecutable.leafName != (AppConstants.MOZ_APP_NAME + "-bin"));
   },
 
   /**
    * Rebuild the actions menu for the selected entry.  Gets called by
    * the richlistitem constructor when an entry in the list gets selected.
    */
-  rebuildActionsMenu: function() {
+  rebuildActionsMenu() {
     var typeItem = this._list.selectedItem;
 
     if (!typeItem)
       return;
 
     var handlerInfo = this._handledTypes[typeItem.type];
     var menu =
       document.getAnonymousElementByAttribute(typeItem, "class", "actionsMenu");
@@ -1374,18 +1367,17 @@ var gApplicationsPane = {
       // would be meaningless so we special case executables.
       var executableType = Cc["@mozilla.org/mime;1"]
                              .getService(Ci.nsIMIMEService)
                              .getTypeFromExtension("exe");
       if (handlerInfo.type == executableType)
         createItem = false;
     }
 
-    if (createItem)
-    {
+    if (createItem) {
       let menuItem = document.createElement("menuitem");
       menuItem.setAttribute("oncommand", "gApplicationsPane.chooseApp(event)");
       let label = this._prefsBundle.getString("useOtherApp");
       menuItem.setAttribute("label", label);
       menuItem.setAttribute("tooltiptext", label);
       menuPopup.appendChild(menuItem);
     }
 
@@ -1433,25 +1425,25 @@ var gApplicationsPane = {
     }
     // menu.selectedItem may be null if the preferredAction is
     // useSystemDefault, but handlerInfo.hasDefaultHandler returns false.
     // For now, we'll just use the askMenuItem to avoid ugly exceptions.
     menu.previousSelectedItem = menu.selectedItem || askMenuItem;
   },
 
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // Sorting & Filtering
 
   _sortColumn: null,
 
   /**
    * Sort the list when the user clicks on a column header.
    */
-  sort: function (event) {
+  sort(event) {
     var column = event.target;
 
     // If the user clicked on a new sort column, remove the direction indicator
     // from the old column.
     if (this._sortColumn && this._sortColumn != column)
       this._sortColumn.removeAttribute("sortDirection");
 
     this._sortColumn = column;
@@ -1464,17 +1456,17 @@ var gApplicationsPane = {
 
     this._sortVisibleTypes();
     this.rebuildView();
   },
 
   /**
    * Sort the list of visible types by the current sort column/direction.
    */
-  _sortVisibleTypes: function() {
+  _sortVisibleTypes() {
     if (!this._sortColumn)
       return;
 
     var t = this;
 
     function sortByType(a, b) {
       return t._describeType(a).toLowerCase()
               .localeCompare(t._describeType(b).toLowerCase());
@@ -1493,47 +1485,45 @@ var gApplicationsPane = {
         this._visibleTypes.sort(sortByAction);
         break;
     }
 
     if (this._sortColumn.getAttribute("sortDirection") == "descending")
       this._visibleTypes.reverse();
   },
 
-  focusFilterBox: function() {
+  focusFilterBox() {
     this._filter.focus();
     this._filter.select();
   },
 
-  //**************************************************************************//
+  //* *************************************************************************//
   // Changes
 
-  onSelectAction: function(aActionItem) {
+  onSelectAction(aActionItem) {
     this._storingAction = true;
 
     let typeItem = this._list.selectedItem;
     let menu = document.getAnonymousElementByAttribute(typeItem, "class",
                                                        "actionsMenu");
     menu.previousSelectedItem = aActionItem;
     try {
       this._storeAction(aActionItem);
-    }
-    finally {
+    } finally {
       this._storingAction = false;
     }
   },
 
-  _storeAction: function(aActionItem) {
+  _storeAction(aActionItem) {
     var typeItem = this._list.selectedItem;
     var handlerInfo = this._handledTypes[typeItem.type];
 
     if (aActionItem.hasAttribute("alwaysAsk")) {
       handlerInfo.alwaysAskBeforeHandling = true;
-    }
-    else if (aActionItem.hasAttribute("action")) {
+    } else if (aActionItem.hasAttribute("action")) {
       let action = parseInt(aActionItem.getAttribute("action"));
 
       // Set the plugin state if we're enabling or disabling a plugin.
       if (action == kActionUsePlugin)
         handlerInfo.enablePluginType();
       else if (handlerInfo.plugin && !handlerInfo.isDisabledPluginType)
         handlerInfo.disablePluginType();
 
@@ -1563,17 +1553,17 @@ var gApplicationsPane = {
     typeItem.setAttribute("actionDescription",
                           this._describePreferredAction(handlerInfo));
     if (!this._setIconClassForPreferredAction(handlerInfo, typeItem)) {
       typeItem.setAttribute("actionIcon",
                             this._getIconURLForPreferredAction(handlerInfo));
     }
   },
 
-  manageApp: function(aEvent) {
+  manageApp(aEvent) {
     // Don't let the normal "on select action" handler get this event,
     // as we handle it specially ourselves.
     aEvent.stopPropagation();
 
     var typeItem = this._list.selectedItem;
     var handlerInfo = this._handledTypes[typeItem.type];
 
     let closingCallback = () => {
@@ -1590,17 +1580,17 @@ var gApplicationsPane = {
       }
     };
 
     gSubDialog.open(
       "chrome://messenger/content/preferences/applicationManager.xul",
       "resizable=no", handlerInfo, closingCallback);
   },
 
-  chooseApp: function(aEvent) {
+  chooseApp(aEvent) {
     // Don't let the normal "on select action" handler get this event,
     // as we handle it specially ourselves.
     aEvent.stopPropagation();
 
     var handlerApp;
     let onSelectionDone = function() {
       // Rebuild the actions menu whether the user picked an app or canceled.
       // If they picked an app, we want to add the app to the menu and select it.
@@ -1673,55 +1663,55 @@ var gApplicationsPane = {
         }
         onSelectionDone();
       });
     }
   },
 
   // Mark which item in the list was last selected so we can reselect it
   // when we rebuild the list or when the user returns to the prefpane.
-  onSelectionChanged: function() {
+  onSelectionChanged() {
     if (this._list.selectedItem)
       this._list.setAttribute("lastSelectedType",
                               this._list.selectedItem.getAttribute("type"));
   },
 
-  confirmDelete: function(aEvent) {
+  confirmDelete(aEvent) {
     aEvent.stopPropagation();
     if (Services.prompt.confirm(null,
                                 this._prefsBundle.getString("confirmDeleteTitle"),
                                 this._prefsBundle.getString("confirmDeleteText")))
       this.onDelete(aEvent);
     else {
       // They hit cancel, so return them to the previously selected item.
       let typeItem = this._list.selectedItem;
       let menu = document.getAnonymousElementByAttribute(this._list.selectedItem,
                                                          "class", "actionsMenu");
       menu.selectedItem = menu.previousSelectedItem;
     }
   },
 
-  onDelete: function(aEvent) {
+  onDelete(aEvent) {
     // We want to delete if either the request came from the confirmDelete
     // method (which is the only thing that populates the aEvent parameter),
     // or we've hit the delete/backspace key while the list has focus.
     if ((aEvent || document.commandDispatcher.focusedElement == this._list) &&
         this._list.selectedIndex != -1) {
       let typeItem = this._list.getItemAtIndex(this._list.selectedIndex);
       let handlerInfo = this._handledTypes[typeItem.type];
       let index = this._visibleTypes.indexOf(handlerInfo);
       if (index != -1)
         this._visibleTypes.splice(index, 1);
       handlerInfo.remove();
       delete this._handledTypes[typeItem.type];
       typeItem.remove();
     }
   },
 
-  _setIconClassForPreferredAction: function(aHandlerInfo, aElement) {
+  _setIconClassForPreferredAction(aHandlerInfo, aElement) {
     // If this returns true, the attribute that CSS sniffs for was set to something
     // so you shouldn't manually set an icon URI.
     // This removes the existing actionIcon attribute if any, even if returning false.
     aElement.removeAttribute("actionIcon");
 
     if (aHandlerInfo.alwaysAskBeforeHandling) {
       aElement.setAttribute(APP_ICON_ATTR_NAME, "ask");
       return true;
@@ -1738,85 +1728,84 @@ var gApplicationsPane = {
       case kActionUsePlugin:
         aElement.setAttribute(APP_ICON_ATTR_NAME, "plugin");
         return true;
     }
     aElement.removeAttribute(APP_ICON_ATTR_NAME);
     return false;
   },
 
-  _getIconURLForPreferredAction: function(aHandlerInfo) {
+  _getIconURLForPreferredAction(aHandlerInfo) {
     switch (aHandlerInfo.preferredAction) {
       case Ci.nsIHandlerInfo.useSystemDefault:
         return this._getIconURLForSystemDefault(aHandlerInfo);
 
       case Ci.nsIHandlerInfo.useHelperApp:
         let preferredApp = aHandlerInfo.preferredApplicationHandler;
         if (this.isValidHandlerApp(preferredApp))
           return this._getIconURLForHandlerApp(preferredApp);
     }
     // This should never happen, but if preferredAction is set to some weird
     // value, then fall back to the generic application icon.
     return ICON_URL_APP;
   },
 
-  _getIconURLForHandlerApp: function(aHandlerApp) {
+  _getIconURLForHandlerApp(aHandlerApp) {
     if (aHandlerApp instanceof Ci.nsILocalHandlerApp)
       return this._getIconURLForFile(aHandlerApp.executable);
 
     if (aHandlerApp instanceof Ci.nsIWebHandlerApp)
       return this._getIconURLForWebApp(aHandlerApp.uriTemplate);
 
     if (aHandlerApp instanceof Ci.nsIWebContentHandlerInfo)
-      return this._getIconURLForWebApp(aHandlerApp.uri)
+      return this._getIconURLForWebApp(aHandlerApp.uri);
 
     // We know nothing about other kinds of handler apps.
     return "";
   },
 
-  _getIconURLForFile: function(aFile) {
+  _getIconURLForFile(aFile) {
     let urlSpec = Services.io.getProtocolHandler("file")
       .QueryInterface(Ci.nsIFileProtocolHandler)
       .getURLSpecFromFile(aFile);
 
     return "moz-icon://" + urlSpec + "?size=16";
   },
 
-  _getIconURLForWebApp: function(aWebAppURITemplate) {
+  _getIconURLForWebApp(aWebAppURITemplate) {
     var uri = Services.io.newURI(aWebAppURITemplate);
 
     // Unfortunately we can't use the favicon service to get the favicon,
     // because the service looks in the annotations table for a record with
     // the exact URL we give it, and users won't have such records for URLs
     // they don't visit, and users won't visit the web app's URL template,
     // they'll only visit URLs derived from that template (i.e. with %s
     // in the template replaced by the URL of the content being handled).
 
     if (/^https?/.test(uri.scheme))
       return uri.prePath + "/favicon.ico";
 
     return /^https?/.test(uri.scheme) ? uri.resolve("/favicon.ico") : "";
   },
 
-  _getIconURLForSystemDefault: function(aHandlerInfo) {
+  _getIconURLForSystemDefault(aHandlerInfo) {
     // Handler info objects for MIME types on some OSes implement a property bag
     // interface from which we can get an icon for the default app, so if we're
     // dealing with a MIME type on one of those OSes, then try to get the icon.
     if ("wrappedHandlerInfo" in aHandlerInfo) {
       let wrappedHandlerInfo = aHandlerInfo.wrappedHandlerInfo;
 
       if (wrappedHandlerInfo instanceof Ci.nsIMIMEInfo &&
           wrappedHandlerInfo instanceof Ci.nsIPropertyBag) {
         try {
           let url = wrappedHandlerInfo.getProperty("defaultApplicationIconURL");
           if (url)
             return url + "?size=16";
-        }
-        catch(ex) { }
+        } catch (ex) { }
       }
     }
 
     // If this isn't a MIME type object on an OS that supports retrieving
     // the icon, or if we couldn't retrieve the icon for some other reason,
     // then use a generic icon.
     return ICON_URL_APP;
-  }
+  },
 };
--- a/mail/components/preferences/attachmentReminder.js
+++ b/mail/components/preferences/attachmentReminder.js
@@ -4,83 +4,76 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var gAttachmentReminderOptionsDialog = {
   keywordListBox: null,
   bundle: null,
 
-  init: function()
-  {
+  init() {
     this.keywordListBox = document.getElementById("keywordList");
     this.bundle = document.getElementById("bundlePreferences");
     this.buildKeywordList();
   },
 
-  buildKeywordList: function()
-  {
+  buildKeywordList() {
     var keywordsInCsv = Services.prefs
       .getComplexValue("mail.compose.attachment_reminder_keywords",
                        Ci.nsIPrefLocalizedString);
     if (!keywordsInCsv)
       return;
     var keywordsInCsv = keywordsInCsv.data;
     var keywordsInArr = keywordsInCsv.split(",");
-    for (var i = 0; i < keywordsInArr.length; i++)
-    {
+    for (var i = 0; i < keywordsInArr.length; i++) {
       if (keywordsInArr[i])
         this.keywordListBox.appendItem(keywordsInArr[i], keywordsInArr[i]);
     }
     if (keywordsInArr.length)
       this.keywordListBox.selectedIndex = 0;
   },
 
-  addKeyword: function()
-  {
+  addKeyword() {
     var input = {value: ""}; // Default to empty.
     var ok = Services.prompt.prompt(window,
                                     this.bundle.getString("attachmentReminderNewDialogTitle"),
                                     this.bundle.getString("attachmentReminderNewText"),
-                                    input, null, {value:0});
+                                    input, null, {value: 0});
     if (ok && input.value) {
       let newKey = this.keywordListBox.appendItem(input.value, input.value);
       this.keywordListBox.ensureElementIsVisible(newKey);
       this.keywordListBox.selectItem(newKey);
     }
   },
 
-  editKeyword: function()
-  {
+  editKeyword() {
     if (this.keywordListBox.selectedIndex < 0)
       return;
     var keywordToEdit = this.keywordListBox.selectedItem;
     var input = {value: keywordToEdit.getAttribute("value")};
     var ok = Services.prompt.prompt(window,
                                     this.bundle.getString("attachmentReminderEditDialogTitle"),
                                     this.bundle.getString("attachmentReminderEditText"),
-                                    input, null, {value:0});
+                                    input, null, {value: 0});
     if (ok && input.value) {
       this.keywordListBox.selectedItem.value = input.value;
       this.keywordListBox.selectedItem.label = input.value;
     }
   },
 
-  removeKeyword: function()
-  {
+  removeKeyword() {
     if (this.keywordListBox.selectedIndex < 0)
       return;
     this.keywordListBox.selectedItem.remove();
   },
 
-  saveKeywords: function()
-  {
+  saveKeywords() {
     var keywordList = "";
     for (var i = 0; i < this.keywordListBox.getRowCount(); i++) {
       keywordList += this.keywordListBox.getItemAtIndex(i).getAttribute("value");
       if (i != this.keywordListBox.getRowCount() - 1)
         keywordList += ",";
     }
 
     Services.prefs.setStringPref("mail.compose.attachment_reminder_keywords",
                                  keywordList);
-  }
+  },
 };
--- a/mail/components/preferences/chat.js
+++ b/mail/components/preferences/chat.js
@@ -1,65 +1,56 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var gChatPane = {
-  init: function ()
-  {
+  init() {
     previewObserver.load();
     this.updateDisabledState();
     this.updatePlaySound();
   },
 
-  updateDisabledState: function ()
-  {
+  updateDisabledState() {
     let broadcaster = document.getElementById("idleReportingEnabled");
     if (document.getElementById("messenger.status.reportIdle").value) {
       broadcaster.removeAttribute("disabled");
       this.updateMessageDisabledState();
-    }
-    else
+    } else
       broadcaster.setAttribute("disabled", "true");
   },
 
-  updateMessageDisabledState: function ()
-  {
+  updateMessageDisabledState() {
     let textbox = document.getElementById("defaultIdleAwayMessage");
     if (document.getElementById("messenger.status.awayWhenIdle").value)
       textbox.removeAttribute("disabled");
     else
       textbox.setAttribute("disabled", "true");
   },
 
-  convertURLToLocalFile: function(aFileURL)
-  {
+  convertURLToLocalFile(aFileURL) {
     // convert the file url into a nsIFile
-    if (aFileURL)
-    {
+    if (aFileURL) {
       return Services.io.getProtocolHandler("file")
                         .QueryInterface(Ci.nsIFileProtocolHandler)
                         .getFileFromURLSpec(aFileURL);
     }
     return null;
   },
 
-  readSoundLocation: function()
-  {
+  readSoundLocation() {
     let chatSoundUrlLocation = document.getElementById("chatSoundUrlLocation");
     chatSoundUrlLocation.value = document.getElementById("mail.chat.play_sound.url").value;
-    if (chatSoundUrlLocation.value)
-    {
+    if (chatSoundUrlLocation.value) {
       chatSoundUrlLocation.label = this.convertURLToLocalFile(chatSoundUrlLocation.value).leafName;
       chatSoundUrlLocation.style.backgroundImage = "url(moz-icon://" + chatSoundUrlLocation.label + "?size=16)";
     }
   },
 
-  previewSound: function ()
-  {
+  previewSound() {
     let sound = Cc["@mozilla.org/sound;1"].createInstance(Ci.nsISound);
 
     let soundLocation = document.getElementById("chatSoundType").value == 1 ?
                         document.getElementById("chatSoundUrlLocation").value :
                         "";
 
     // This should be in sync with the code in nsStatusBarBiffManager::PlayBiffSound.
     if (!soundLocation.startsWith("file://")) {
@@ -67,18 +58,17 @@ var gChatPane = {
         sound.beep();
       else
         sound.playEventSound(Ci.nsISound.EVENT_NEW_MAIL_RECEIVED);
     } else {
       sound.play(Services.io.newURI(soundLocation));
     }
   },
 
-  browseForSoundFile: function ()
-  {
+  browseForSoundFile() {
     const nsIFilePicker = Ci.nsIFilePicker;
     let fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
 
     // If we already have a sound file, then use the path for that sound file
     // as the initial path in the dialog.
     let localFile = this.convertURLToLocalFile(
       document.getElementById("chatSoundUrlLocation").value);
     if (localFile)
@@ -105,21 +95,20 @@ var gChatPane = {
 
       // convert the nsIFile into a nsIFile url
       document.getElementById("mail.chat.play_sound.url").value = fp.fileURL.spec;
       this.readSoundLocation(); // XXX We shouldn't have to be doing this by hand
       this.updatePlaySound();
     });
   },
 
-  updatePlaySound: function()
-  {
+  updatePlaySound() {
     // update the sound type radio buttons based on the state of the play sound checkbox
     let soundsDisabled = !document.getElementById("chatNotification").checked;
     let soundTypeEl = document.getElementById("chatSoundType");
     let chatSoundUrlLocation = document.getElementById("chatSoundUrlLocation").value;
     soundTypeEl.disabled = soundsDisabled;
     document.getElementById("chatSoundUrlLocation").disabled =
       soundsDisabled || (soundTypeEl.value != 1);
     document.getElementById("playChatSound").disabled =
       soundsDisabled || (!chatSoundUrlLocation && soundTypeEl.value != 0);
-  }
+  },
 };
--- a/mail/components/preferences/compose.js
+++ b/mail/components/preferences/compose.js
@@ -3,20 +3,19 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.import("resource://gre/modules/InlineSpellChecker.jsm");
 
 var gComposePane = {
   mInitialized: false,
   mSpellChecker: null,
-  mDictCount : 0,
+  mDictCount: 0,
 
-  init: function ()
-  {
+  init() {
     this.enableAutocomplete();
 
     this.initLanguageMenu();
 
     this.populateFonts();
 
     this.updateAutosave();
 
@@ -31,76 +30,66 @@ var gComposePane = {
       let preference = document.getElementById("mail.preferences.compose.selectedTabIndex");
       if (preference.value)
         document.getElementById("composePrefs").selectedIndex = preference.value;
     }
 
     this.mInitialized = true;
   },
 
-  tabSelectionChanged: function ()
-  {
-    if (this.mInitialized)
-    {
+  tabSelectionChanged() {
+    if (this.mInitialized) {
       var preference = document.getElementById("mail.preferences.compose.selectedTabIndex");
       preference.valueFromPreferences = document.getElementById("composePrefs").selectedIndex;
     }
   },
 
-  sendOptionsDialog: function()
-  {
+  sendOptionsDialog() {
     gSubDialog.open("chrome://messenger/content/preferences/sendoptions.xul");
   },
 
-  attachmentReminderOptionsDialog: function()
-  {
+  attachmentReminderOptionsDialog() {
     gSubDialog.open("chrome://messenger/content/preferences/attachmentReminder.xul",
                     "resizable=no");
   },
 
-  updateAutosave: function()
-  {
+  updateAutosave() {
     this.enableElement(document.getElementById("autoSaveInterval"),
       document.getElementById("autoSave").checked);
   },
 
-  updateAttachmentCheck: function()
-  {
+  updateAttachmentCheck() {
     this.enableElement(document.getElementById("attachment_reminder_button"),
       document.getElementById("attachment_reminder_label").checked);
   },
 
-  updateEmailCollection: function()
-  {
+  updateEmailCollection() {
     this.enableElement(document.getElementById("localDirectoriesList"),
       document.getElementById("emailCollectionOutgoing").checked);
   },
 
-  enableElement: function(aElement, aEnable)
-  {
+  enableElement(aElement, aEnable) {
     let pref = aElement.getAttribute("preference");
     let prefIsLocked = pref ? document.getElementById(pref).locked : false;
     aElement.disabled = !aEnable || prefIsLocked;
   },
 
-  enableAutocomplete: function()
-  {
+  enableAutocomplete() {
     var acLDAPPref = document.getElementById("ldap_2.autoComplete.useDirectory")
                              .value;
 
     this.enableElement(document.getElementById("directoriesList"), acLDAPPref);
     this.enableElement(document.getElementById("editButton"), acLDAPPref);
   },
 
-  editDirectories: function()
-  {
+  editDirectories() {
     gSubDialog.open("chrome://messenger/content/addressbook/pref-editdirectories.xul");
   },
 
-  initAbDefaultStartupDir: function() {
+  initAbDefaultStartupDir() {
     if (!this.startupDirListener.inited)
       this.startupDirListener.load();
 
     let dirList = document.getElementById("defaultStartupDirList");
     if (Services.prefs.getBoolPref("mail.addr_book.view.startupURIisDefault")) {
       // Some directory is the default.
       let startupURI = Services.prefs.getCharPref("mail.addr_book.view.startupURI");
       let dirItem = dirList.menupopup.querySelector('[value="' + startupURI + '"]');
@@ -112,32 +101,31 @@ var gComposePane = {
       else
         dirList.value = "";
     } else {
       // Choose item meaning there is no default startup directory any more.
       dirList.value = "";
     }
   },
 
-  setDefaultStartupDir: function(aDirURI) {
+  setDefaultStartupDir(aDirURI) {
     if (aDirURI) {
       // Some AB directory was selected. Set prefs to make this directory
       // the default view when starting up the main AB.
       Services.prefs.setCharPref("mail.addr_book.view.startupURI", aDirURI);
       Services.prefs.setBoolPref("mail.addr_book.view.startupURIisDefault", true);
     } else {
       // Set pref that there's no default startup view directory any more.
       Services.prefs.setBoolPref("mail.addr_book.view.startupURIisDefault", false);
     }
   },
 
-  initLanguageMenu: function ()
-  {
+  initLanguageMenu() {
     var languageMenuList = document.getElementById("languageMenuList");
-    this.mSpellChecker = Cc['@mozilla.org/spellchecker/engine;1'].getService(Ci.mozISpellCheckingEngine);
+    this.mSpellChecker = Cc["@mozilla.org/spellchecker/engine;1"].getService(Ci.mozISpellCheckingEngine);
     var o1 = {};
     var o2 = {};
 
     // Get the list of dictionaries from
     // the spellchecker.
 
     this.mSpellChecker.getDictionaryList(o1, o2);
 
@@ -162,77 +150,72 @@ var gComposePane = {
 
     // append the dictionaries to the menu list...
     for (var i = 0; i < count; i++)
       languageMenuList.appendItem(sortedList[i].label, sortedList[i].id);
 
     languageMenuList.setInitialSelection();
   },
 
-  populateFonts: function()
-  {
+  populateFonts() {
     var fontsList = document.getElementById("FontSelect");
-    try
-    {
+    try {
       var enumerator = Cc["@mozilla.org/gfx/fontenumerator;1"]
                          .getService(Ci.nsIFontEnumerator);
-      var localFontCount = { value: 0 }
+      var localFontCount = { value: 0 };
       var localFonts = enumerator.EnumerateAllFonts(localFontCount);
-      for (var i = 0; i < localFonts.length; ++i)
-      {
+      for (var i = 0; i < localFonts.length; ++i) {
         // Remove Linux system generic fonts that collide with CSS generic fonts.
         if (localFonts[i] != "" && localFonts[i] != "serif" &&
             localFonts[i] != "sans-serif" && localFonts[i] != "monospace")
           fontsList.appendItem(localFonts[i], localFonts[i]);
       }
-    }
-    catch(e) { }
+    } catch (e) { }
     // Choose the item after the list is completely generated.
     var preference = document.getElementById(fontsList.getAttribute("preference"));
     fontsList.value = preference.value;
   },
 
-   restoreHTMLDefaults: function()
-   {
+   restoreHTMLDefaults() {
      // reset throws an exception if the pref value is already the default so
      // work around that with some try/catch exception handling
      try {
-       document.getElementById('msgcompose.font_face').reset();
+       document.getElementById("msgcompose.font_face").reset();
      } catch (ex) {}
 
      try {
-       document.getElementById('msgcompose.font_size').reset();
+       document.getElementById("msgcompose.font_size").reset();
      } catch (ex) {}
 
      try {
-       document.getElementById('msgcompose.text_color').reset();
+       document.getElementById("msgcompose.text_color").reset();
      } catch (ex) {}
 
      try {
-       document.getElementById('msgcompose.background_color').reset();
+       document.getElementById("msgcompose.background_color").reset();
      } catch (ex) {}
   },
 
   startupDirListener: {
     inited: false,
     domain: "mail.addr_book.view.startupURI",
-    observe: function(subject, topic, prefName) {
+    observe(subject, topic, prefName) {
       if (topic != "nsPref:changed")
         return;
 
       // If the default startup directory prefs have changed,
       // reinitialize the default startup dir picker to show the new value.
       gComposePane.initAbDefaultStartupDir();
     },
-    load: function() {
+    load() {
       // Observe changes of our prefs.
       Services.prefs.addObserver(this.domain, this);
       // Unload the pref observer when preferences window is closed.
       window.addEventListener("unload", this.unload, true);
       this.inited = true;
     },
 
-    unload: function(event) {
+    unload(event) {
       Services.prefs.removeObserver(gComposePane.startupDirListener.domain,
                                     gComposePane.startupDirListener);
-    }
-  }
+    },
+  },
 };
--- a/mail/components/preferences/connection.js
+++ b/mail/components/preferences/connection.js
@@ -1,18 +1,17 @@
 /* -*- Mode: Javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var gConnectionsDialog = {
-  beforeAccept: function ()
-  {
+  beforeAccept() {
     var proxyTypePref = document.getElementById("network.proxy.type");
     if (proxyTypePref.value == 2) {
       this.doAutoconfigURLFixup();
       return true;
     }
 
     if (proxyTypePref.value != 1)
       return true;
@@ -30,29 +29,27 @@ var gConnectionsDialog = {
         backupServerURLPref.value = proxyServerURLPref.value;
         backupPortPref.value = proxyPortPref.value;
         proxyServerURLPref.value = httpProxyURLPref.value;
         proxyPortPref.value = httpProxyPortPref.value;
       }
     }
 
     var noProxiesPref = document.getElementById("network.proxy.no_proxies_on");
-    noProxiesPref.value = noProxiesPref.value.replace(/[;]/g,',');
+    noProxiesPref.value = noProxiesPref.value.replace(/[;]/g, ",");
 
     return true;
   },
 
-  checkForSystemProxy: function ()
-  {
+  checkForSystemProxy() {
     if ("@mozilla.org/system-proxy-settings;1" in Cc)
       document.getElementById("systemPref").removeAttribute("hidden");
   },
 
-  proxyTypeChanged: function ()
-  {
+  proxyTypeChanged() {
     var proxyTypePref = document.getElementById("network.proxy.type");
 
     // Update http
     var httpProxyURLPref = document.getElementById("network.proxy.http");
     httpProxyURLPref.disabled = proxyTypePref.value != 1;
     var httpProxyPortPref = document.getElementById("network.proxy.http_port");
     httpProxyPortPref.disabled = proxyTypePref.value != 1;
 
@@ -66,18 +63,17 @@ var gConnectionsDialog = {
     noProxiesPref.disabled = proxyTypePref.value != 1;
 
     var autoconfigURLPref = document.getElementById("network.proxy.autoconfig_url");
     autoconfigURLPref.disabled = proxyTypePref.value != 2;
 
     this.updateReloadButton();
   },
 
-  updateReloadButton: function ()
-  {
+  updateReloadButton() {
     // Disable the "Reload PAC" button if the selected proxy type is not PAC or
     // if the current value of the PAC textbox does not match the value stored
     // in prefs.  Likewise, disable the reload button if PAC is not configured
     // in prefs.
 
     var typedURL = document.getElementById("networkProxyAutoconfigURL").value;
     var proxyTypeCur = document.getElementById("network.proxy.type").value;
 
@@ -85,24 +81,22 @@ var gConnectionsDialog = {
     var proxyType = Services.prefs.getIntPref("network.proxy.type");
 
     var disableReloadPref =
         document.getElementById("pref.advanced.proxies.disable_button.reload");
     disableReloadPref.disabled =
         (proxyTypeCur != 2 || proxyType != 2 || typedURL != pacURL);
   },
 
-  readProxyType: function ()
-  {
+  readProxyType() {
     this.proxyTypeChanged();
     return undefined;
   },
 
-  updateProtocolPrefs: function ()
-  {
+  updateProtocolPrefs() {
     var proxyTypePref = document.getElementById("network.proxy.type");
     var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
     var proxyPrefs = ["ssl", "socks"];
     for (var i = 0; i < proxyPrefs.length; ++i) {
       var proxyServerURLPref = document.getElementById("network.proxy." + proxyPrefs[i]);
       var proxyPortPref = document.getElementById("network.proxy." + proxyPrefs[i] + "_port");
 
       // Restore previous per-proxy custom settings, if present.
@@ -125,53 +119,48 @@ var gConnectionsDialog = {
       proxyPortPref.disabled = proxyServerURLPref.disabled;
     }
     var socksVersionPref = document.getElementById("network.proxy.socks_version");
     socksVersionPref.disabled = proxyTypePref.value != 1 || shareProxiesPref.value;
 
     return undefined;
   },
 
-  readProxyProtocolPref: function (aProtocol, aIsPort)
-  {
+  readProxyProtocolPref(aProtocol, aIsPort) {
     var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
     if (shareProxiesPref.value) {
       var pref = document.getElementById("network.proxy.http" + (aIsPort ? "_port" : ""));
       return pref.value;
     }
 
     var backupPref = document.getElementById("network.proxy.backup." + aProtocol + (aIsPort ? "_port" : ""));
     return backupPref.hasUserValue ? backupPref.value : undefined;
   },
 
-  reloadPAC: function ()
-  {
+  reloadPAC() {
     Cc["@mozilla.org/network/protocol-proxy-service;1"].
         getService().reloadPAC();
   },
 
-  doAutoconfigURLFixup: function ()
-  {
+  doAutoconfigURLFixup() {
     var autoURL = document.getElementById("networkProxyAutoconfigURL");
     var autoURLPref = document.getElementById("network.proxy.autoconfig_url");
     try {
       autoURLPref.value = autoURL.value = Services.uriFixup.createFixupURI(autoURL.value, 0).spec;
-    } catch(ex) {}
+    } catch (ex) {}
   },
 
-  readHTTPProxyServer: function ()
-  {
+  readHTTPProxyServer() {
     var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
     if (shareProxiesPref.value)
       this.updateProtocolPrefs();
     return undefined;
   },
 
-  readHTTPProxyPort: function ()
-  {
+  readHTTPProxyPort() {
     var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
     if (shareProxiesPref.value)
       this.updateProtocolPrefs();
     return undefined;
   },
 
   isDnsOverHttpsEnabled() {
     // values outside 1:4 are considered falsey/disabled in this context
@@ -196,10 +185,10 @@ 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;
-  }
+  },
 };
--- a/mail/components/preferences/cookies.js
+++ b/mail/components/preferences/cookies.js
@@ -4,112 +4,100 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
 
 var nsICookie = Ci.nsICookie;
 
 var gCookiesWindow = {
-  _hosts            : {},
-  _hostOrder        : [],
-  _tree             : null,
-  _bundle           : null,
+  _hosts: {},
+  _hostOrder: [],
+  _tree: null,
+  _bundle: null,
 
-  init: function ()
-  {
+  init() {
     Services.obs.addObserver(this, "cookie-changed");
     Services.obs.addObserver(this, "perm-changed");
 
     this._bundle = document.getElementById("bundlePreferences");
     this._tree = document.getElementById("cookiesList");
 
     this._populateList(true);
 
     document.getElementById("filter").focus();
 
     if (!Services.prefs.getBoolPref("privacy.userContext.enabled")) {
       document.getElementById("userContextRow").hidden = true;
     }
   },
 
-  uninit: function ()
-  {
+  uninit() {
     Services.obs.removeObserver(this, "cookie-changed");
     Services.obs.removeObserver(this, "perm-changed");
   },
 
-  _populateList: function (aInitialLoad)
-  {
+  _populateList(aInitialLoad) {
     this._loadCookies();
     this._tree.treeBoxObject.view = this._view;
     if (aInitialLoad)
       this.sort("rawHost");
     if (this._view.rowCount > 0)
       this._tree.view.selection.select(0);
 
     if (aInitialLoad) {
       if (("arguments" in window) && window.arguments[2] &&
-          window.arguments[2].filterString)
-      {
+          window.arguments[2].filterString) {
         this.setFilter(window.arguments[2].filterString);
       }
-    }
-    else {
-      if (document.getElementById("filter").value != "")
+    } else if (document.getElementById("filter").value != "")
         this.filter();
-    }
 
     this._saveState();
   },
 
-  _cookieEquals: function (aCookieA, aCookieB, aStrippedHost)
-  {
+  _cookieEquals(aCookieA, aCookieB, aStrippedHost) {
     return aCookieA.rawHost == aStrippedHost &&
            aCookieA.name == aCookieB.name &&
            aCookieA.path == aCookieB.path &&
            !ChromeUtils.compareOriginAttributes(aCookieA.originAttributes,
                                                 aCookieB.originAttributes);
   },
 
-  observe: function (aCookie, aTopic, aData)
-  {
+  observe(aCookie, aTopic, aData) {
     if (aTopic != "cookie-changed")
       return;
 
     if (aCookie instanceof Ci.nsICookie) {
       var strippedHost = this._makeStrippedHost(aCookie.host);
       if (aData == "changed")
         this._handleCookieChanged(aCookie, strippedHost);
       else if (aData == "added")
         this._handleCookieAdded(aCookie, strippedHost);
-    }
-    else if (aData == "cleared") {
+    } else if (aData == "cleared") {
       this._hosts = {};
       this._hostOrder = [];
 
       var oldRowCount = this._view._rowCount;
       this._view._rowCount = 0;
       this._tree.treeBoxObject.rowCountChanged(0, -oldRowCount);
       this._view.selection.clearSelection();
-    }
-    else if (aData == "reload") {
+    } else if (aData == "reload") {
       // first, clear any existing entries
       this.observe(aCookie, aTopic, "cleared");
 
       // then, reload the list
       this._populateList(false);
     }
 
     // We don't yet handle aData == "deleted" - it's a less common case
     // and is rather complicated as selection tracking is difficult
   },
 
-  _handleCookieChanged: function (changedCookie, strippedHost)
-  {
+  _handleCookieChanged(changedCookie, strippedHost) {
     var rowIndex = 0;
     var cookieItem = null;
     if (!this._view._filtered) {
       for (var i = 0; i < this._hostOrder.length; ++i) { // (var host in this._hosts) {
         ++rowIndex;
         var hostItem = this._hosts[this._hostOrder[i]]; // var hostItem = this._hosts[host];
         if (this._hostOrder[i] == strippedHost) { // host == strippedHost) {
           // Host matches, look for the cookie within this Host collection
@@ -121,22 +109,20 @@ var gCookiesWindow = {
               currCookie.value    = changedCookie.value;
               currCookie.isSecure = changedCookie.isSecure;
               currCookie.isDomain = changedCookie.isDomain;
               currCookie.expires  = changedCookie.expires;
               cookieItem = currCookie;
               break;
             }
           }
-        }
-        else if (hostItem.open)
+        } else if (hostItem.open)
           rowIndex += hostItem.cookies.length;
       }
-    }
-    else {
+    } else {
       // Just walk the filter list to find the item. It doesn't matter that
       // we don't update the main Host collection when we do this, because
       // when the filter is reset the Host collection is rebuilt anyway.
       for (rowIndex = 0; rowIndex < this._view._filterSet.length; ++rowIndex) {
         currCookie = this._view._filterSet[rowIndex];
         if (this._cookieEquals(currCookie, changedCookie, strippedHost)) {
           currCookie.value    = changedCookie.value;
           currCookie.isSecure = changedCookie.isSecure;
@@ -150,29 +136,27 @@ var gCookiesWindow = {
 
     // Make sure the tree display is up to date...
     this._tree.treeBoxObject.invalidateRow(rowIndex);
     // ... and if the cookie is selected, update the displayed metadata too
     if (cookieItem != null && this._view.selection.currentIndex == rowIndex)
       this._updateCookieData(cookieItem);
   },
 
-  _handleCookieAdded: function (changedCookie, strippedHost)
-  {
+  _handleCookieAdded(changedCookie, strippedHost) {
     var rowCountImpact = 0;
     var addedHost = { value: 0 };
     this._addCookie(strippedHost, changedCookie, addedHost);
     if (!this._view._filtered) {
       // The Host collection for this cookie already exists, and it's not open,
       // so don't increment the rowCountImpact becaues the user is not going to
       // see the additional rows as they're hidden.
       if (addedHost.value || this._hosts[strippedHost].open)
         ++rowCountImpact;
-    }
-    else {
+    } else {
       // We're in search mode, and the cookie being added matches
       // the search condition, so add it to the list.
       var c = this._makeCookieObject(strippedHost, changedCookie);
       if (this._cookieMatchesFilter(c)) {
         this._view._filterSet.push(this._makeCookieObject(strippedHost, changedCookie));
         ++rowCountImpact;
       }
     }
@@ -181,86 +165,81 @@ var gCookiesWindow = {
     var oldRowCount = this._rowCount;
     this._view._rowCount += rowCountImpact;
     this._tree.treeBoxObject.rowCountChanged(oldRowCount - 1, rowCountImpact);
 
     document.getElementById("removeAllCookies").disabled = this._view._filtered;
   },
 
   _view: {
-    _filtered   : false,
-    _filterSet  : [],
+    _filtered: false,
+    _filterSet: [],
     _filterValue: "",
-    _rowCount   : 0,
-    _cacheValid : 0,
-    _cacheItems : [],
-    get rowCount()
-    {
+    _rowCount: 0,
+    _cacheValid: 0,
+    _cacheItems: [],
+    get rowCount() {
       return this._rowCount;
     },
 
-    _getItemAtIndex: function (aIndex)
-    {
+    _getItemAtIndex(aIndex) {
       if (this._filtered)
         return this._filterSet[aIndex];
 
       var start = 0;
       var count = 0, hostIndex = 0;
 
       var cacheIndex = Math.min(this._cacheValid, aIndex);
       if (cacheIndex > 0) {
         var cacheItem = this._cacheItems[cacheIndex];
-        start = cacheItem['start'];
-        count = hostIndex = cacheItem['count'];
+        start = cacheItem.start;
+        count = hostIndex = cacheItem.count;
       }
 
       for (var i = start; i < gCookiesWindow._hostOrder.length; ++i) { // var host in gCookiesWindow._hosts) {
         var currHost = gCookiesWindow._hosts[gCookiesWindow._hostOrder[i]]; // gCookiesWindow._hosts[host];
         if (!currHost) continue;
         if (count == aIndex)
           return currHost;
         hostIndex = count;
 
-        var cacheEntry = { 'start' : i, 'count' : count };
+        var cacheEntry = { "start": i, "count": count };
         var cacheStart = count;
 
         if (currHost.open) {
           if (count < aIndex && aIndex <= (count + currHost.cookies.length)) {
             // We are looking for an entry within this host's children,
             // enumerate them looking for the index.
             ++count;
             for (var i = 0; i < currHost.cookies.length; ++i) {
               if (count == aIndex) {
                 var cookie = currHost.cookies[i];
                 cookie.parentIndex = hostIndex;
                 return cookie;
               }
               ++count;
             }
-          }
-          else {
+          } else {
             // A host entry was open, but we weren't looking for an index
             // within that host entry's children, so skip forward over the
             // entry's children. We need to add one to increment for the
             // host value too.
             count += currHost.cookies.length + 1;
           }
-        }
-        else
+        } else
           ++count;
 
         for (var j = cacheStart; j < count; j++)
           this._cacheItems[j] = cacheEntry;
         this._cacheValid = count - 1;
       }
       return null;
     },
 
-    _removeItemAtIndex: function (aIndex, aCount)
-    {
+    _removeItemAtIndex(aIndex, aCount) {
       var removeCount = aCount === undefined ? 1 : aCount;
       if (this._filtered) {
         // remove the cookies from the unfiltered set so that they
         // don't reappear when the filter is changed. See bug 410863.
         for (var i = aIndex; i < aIndex + removeCount; ++i) {
           var item = this._filterSet[i];
           var parent = gCookiesWindow._hosts[item.rawHost];
           for (var j = 0; j < parent.cookies.length; ++j) {
@@ -289,93 +268,83 @@ var gCookiesWindow = {
               !ChromeUtils.compareOriginAttributes(item.originAttributes,
                                                    cookie.originAttributes)) {
             parent.cookies.splice(i, removeCount);
           }
         }
       }
     },
 
-    _invalidateCache: function (aIndex)
-    {
+    _invalidateCache(aIndex) {
       this._cacheValid = Math.min(this._cacheValid, aIndex);
     },
 
-    getCellText: function (aIndex, aColumn)
-    {
+    getCellText(aIndex, aColumn) {
       if (!this._filtered) {
         var item = this._getItemAtIndex(aIndex);
         if (!item)
           return "";
         if (aColumn.id == "domainCol")
           return item.rawHost;
         else if (aColumn.id == "nameCol")
           return ("name" in item) ? item.name : "";
-      }
-      else {
-        if (aColumn.id == "domainCol")
+      } else if (aColumn.id == "domainCol")
           return this._filterSet[aIndex].rawHost;
         else if (aColumn.id == "nameCol")
           return ("name" in this._filterSet[aIndex]) ? this._filterSet[aIndex].name : "";
-      }
       return "";
     },
 
     _selection: null,
-    get selection () { return this._selection; },
-    set selection (val) { this._selection = val; return val; },
-    getRowProperties: function (aRow) { return ""; },
-    getCellProperties: function (aRow, aColumn) { return ""; },
-    getColumnProperties: function (aColumn) { return ""; },
-    isContainer: function (aIndex)
-    {
+    get selection() { return this._selection; },
+    set selection(val) { this._selection = val; return val; },
+    getRowProperties(aRow) { return ""; },
+    getCellProperties(aRow, aColumn) { return ""; },
+    getColumnProperties(aColumn) { return ""; },
+    isContainer(aIndex) {
       if (!this._filtered) {
         var item = this._getItemAtIndex(aIndex);
         if (!item) return false;
         return item.container;
       }
       return false;
     },
-    isContainerOpen: function (aIndex)
-    {
+    isContainerOpen(aIndex) {
       if (!this._filtered) {
         var item = this._getItemAtIndex(aIndex);
         if (!item) return false;
         return item.open;
       }
       return false;
     },
-    isContainerEmpty: function (aIndex)
-    {
+    isContainerEmpty(aIndex) {
       if (!this._filtered) {
         var item = this._getItemAtIndex(aIndex);
         if (!item) return false;
         return item.cookies.length == 0;
       }
       return false;
     },
-    isSeparator: function (aIndex) { return false; },
-    isSorted: function (aIndex) { return false; },
-    canDrop: function (aIndex, aOrientation) { return false; },
-    drop: function (aIndex, aOrientation) {},
-    getParentIndex: function (aIndex)
-    {
+    isSeparator(aIndex) { return false; },
+    isSorted(aIndex) { return false; },
+    canDrop(aIndex, aOrientation) { return false; },
+    drop(aIndex, aOrientation) {},
+    getParentIndex(aIndex) {
       if (!this._filtered) {
         var item = this._getItemAtIndex(aIndex);
         // If an item has no parent index (i.e. it is at the top level) this
         // function MUST return -1 otherwise we will go into an infinite loop.
         // Containers are always top level items in the cookies tree, so make
         // sure to return the appropriate value here.
         if (!item || item.container) return -1;
         return item.parentIndex;
       }
       return -1;
     },
-    hasNextSibling: function (aParentIndex, aIndex)
-    {
+    hasNextSibling(aParentIndex, aIndex) {
       if (!this._filtered) {
         // |aParentIndex| appears to be bogus, but we can get the real
         // parent index by getting the entry for |aIndex| and reading the
         // parentIndex field.
         // The index of the last item in this host collection is the
         // index of the parent + the size of the host collection, and
         // aIndex has a next sibling if it is less than this value.
         var item = this._getItemAtIndex(aIndex);
@@ -383,189 +352,174 @@ var gCookiesWindow = {
           if (item.container) {
             for (var i = aIndex + 1; i < this.rowCount; ++i) {
               var subsequent = this._getItemAtIndex(i);
               if (subsequent.container)
                 return true;
             }
             return false;
           }
-          else {
             var parent = this._getItemAtIndex(item.parentIndex);
             if (parent && parent.container)
               return aIndex < item.parentIndex + parent.cookies.length;
-          }
+
         }
       }
       return aIndex < this.rowCount - 1;
     },
-    hasPreviousSibling: function (aIndex)
-    {
+    hasPreviousSibling(aIndex) {
       if (!this._filtered) {
         var item = this._getItemAtIndex(aIndex);
         if (!item) return false;
         var parent = this._getItemAtIndex(item.parentIndex);
         if (parent && parent.container)
           return aIndex > item.parentIndex + 1;
       }
       return aIndex > 0;
     },
-    getLevel: function (aIndex)
-    {
+    getLevel(aIndex) {
       if (!this._filtered) {
         var item = this._getItemAtIndex(aIndex);
         if (!item) return 0;
         return item.level;
       }
       return 0;
     },
-    getImageSrc: function (aIndex, aColumn) {},
-    getProgressMode: function (aIndex, aColumn) {},
-    getCellValue: function (aIndex, aColumn) {},
-    setTree: function (aTree) {},
-    toggleOpenState: function (aIndex)
-    {
+    getImageSrc(aIndex, aColumn) {},
+    getProgressMode(aIndex, aColumn) {},
+    getCellValue(aIndex, aColumn) {},
+    setTree(aTree) {},
+    toggleOpenState(aIndex) {
       if (!this._filtered) {
         var item = this._getItemAtIndex(aIndex);
         if (!item) return;
         this._invalidateCache(aIndex);
         var multiplier = item.open ? -1 : 1;
         var delta = multiplier * item.cookies.length;
         this._rowCount += delta;
         item.open = !item.open;
         gCookiesWindow._tree.treeBoxObject.rowCountChanged(aIndex + 1, delta);
         gCookiesWindow._tree.treeBoxObject.invalidateRow(aIndex);
       }
     },
-    cycleHeader: function (aColumn) {},
-    selectionChanged: function () {},
-    cycleCell: function (aIndex, aColumn) {},
-    isEditable: function (aIndex, aColumn)
-    {
+    cycleHeader(aColumn) {},
+    selectionChanged() {},
+    cycleCell(aIndex, aColumn) {},
+    isEditable(aIndex, aColumn) {
+      return false;
+    },
+    isSelectable(aIndex, aColumn) {
       return false;
     },
-    isSelectable: function (aIndex, aColumn)
-    {
-      return false;
-    },
-    setCellValue: function (aIndex, aColumn, aValue) {},
-    setCellText: function (aIndex, aColumn, aValue) {},
-    performAction: function (aAction) {},
-    performActionOnRow: function (aAction, aIndex) {},
-    performActionOnCell: function (aAction, aindex, aColumn) {}
+    setCellValue(aIndex, aColumn, aValue) {},
+    setCellText(aIndex, aColumn, aValue) {},
+    performAction(aAction) {},
+    performActionOnRow(aAction, aIndex) {},
+    performActionOnCell(aAction, aindex, aColumn) {},
   },
 
-  _makeStrippedHost: function (aHost)
-  {
+  _makeStrippedHost(aHost) {
     let formattedHost = aHost.startsWith(".") ? aHost.substring(1, aHost.length) : aHost;
     return formattedHost.startsWith("www.") ? formattedHost.substring(4, formattedHost.length) : formattedHost;
   },
 
-  _addCookie: function (aStrippedHost, aCookie, aHostCount)
-  {
+  _addCookie(aStrippedHost, aCookie, aHostCount) {
     if (!(aStrippedHost in this._hosts) || !this._hosts[aStrippedHost]) {
-      this._hosts[aStrippedHost] = { cookies   : [],
-                                     rawHost   : aStrippedHost,
-                                     level     : 0,
-                                     open      : false,
-                                     container : true };
+      this._hosts[aStrippedHost] = { cookies: [],
+                                     rawHost: aStrippedHost,
+                                     level: 0,
+                                     open: false,
+                                     container: true };
       this._hostOrder.push(aStrippedHost);
       ++aHostCount.value;
     }
 
     var c = this._makeCookieObject(aStrippedHost, aCookie);
     this._hosts[aStrippedHost].cookies.push(c);
   },
 
-  _makeCookieObject: function (aStrippedHost, aCookie)
-  {
+  _makeCookieObject(aStrippedHost, aCookie) {
     let host = aCookie.host;
     let formattedHost = host.startsWith(".") ? host.substring(1) : host;
-    let c = { name            : aCookie.name,
-              value           : aCookie.value,
-              isDomain        : aCookie.isDomain,
-              host            : aCookie.host,
-              rawHost         : aStrippedHost,
-              path            : aCookie.path,
-              isSecure        : aCookie.isSecure,
-              expires         : aCookie.expires,
-              level           : 1,
-              container       : false,
+    let c = { name: aCookie.name,
+              value: aCookie.value,
+              isDomain: aCookie.isDomain,
+              host: aCookie.host,
+              rawHost: aStrippedHost,
+              path: aCookie.path,
+              isSecure: aCookie.isSecure,
+              expires: aCookie.expires,
+              level: 1,
+              container: false,
               originAttributes: aCookie.originAttributes };
     return c;
   },
 
-  _loadCookies: function ()
-  {
+  _loadCookies() {
     var e = Services.cookies.enumerator;
     var hostCount = { value: 0 };
     this._hosts = {};
     this._hostOrder = [];
     while (e.hasMoreElements()) {
       var cookie = e.getNext();
       if (cookie && cookie instanceof Ci.nsICookie) {
         var strippedHost = this._makeStrippedHost(cookie.host);
         this._addCookie(strippedHost, cookie, hostCount);
-      }
-      else
+      } else
         break;
     }
     this._view._rowCount = hostCount.value;
   },
 
-  formatExpiresString: function (aExpires)
-  {
+  formatExpiresString(aExpires) {
     if (aExpires) {
       var date = new Date(1000 * aExpires);
       const dateTimeFormatter = new Services.intl.DateTimeFormat(undefined, {
-              dateStyle: "long", timeStyle: "long"
+              dateStyle: "long", timeStyle: "long",
       });
       return dateTimeFormatter.format(date);
     }
     return this._bundle.getString("expireAtEndOfSession");
   },
 
-  _getUserContextString: function(aUserContextId) {
+  _getUserContextString(aUserContextId) {
     // Thunderbird ignores the context for now.
     return this._bundle.getString("defaultUserContextLabel");
   },
 
-  _updateCookieData: function (aItem)
-  {
+  _updateCookieData(aItem) {
     var seln = this._view.selection;
     var ids = ["name", "value", "host", "path", "isSecure", "expires", "userContext"];
     var properties;
 
     if (aItem && !aItem.container && seln.count > 0) {
       properties = { name: aItem.name, value: aItem.value, host: aItem.host,
                      path: aItem.path, expires: this.formatExpiresString(aItem.expires),
                      isDomain: aItem.isDomain ? this._bundle.getString("domainColon")
                                               : this._bundle.getString("hostColon"),
                      isSecure: aItem.isSecure ? this._bundle.getString("forSecureOnly")
                                               : this._bundle.getString("forAnyConnection"),
                      userContext: this._getUserContextString(aItem.originAttributes.userContextId) };
       for (var i = 0; i < ids.length; ++i) {
         document.getElementById(ids[i]).disabled = false;
       }
-    }
-    else {
+    } else {
       var noneSelected = this._bundle.getString("noCookieSelected");
       properties = { name: noneSelected, value: noneSelected, host: noneSelected,
                      path: noneSelected, expires: noneSelected,
                      isSecure: noneSelected, userContext: noneSelected };
       for (i = 0; i < ids.length; ++i) {
         document.getElementById(ids[i]).disabled = true;
       }
     }
     for (var property in properties)
       document.getElementById(property).value = properties[property];
   },
 
-  onCookieSelected: function ()
-  {
+  onCookieSelected() {
     var item;
     var seln = this._tree.view.selection;
     if (!this._view._filtered)
       item = this._view._getItemAtIndex(seln.currentIndex);
     else
       item = this._view._filterSet[seln.currentIndex];
 
     this._updateCookieData(item);
@@ -592,18 +546,17 @@ var gCookiesWindow = {
     let removeSelectedCookies = document.getElementById("removeSelectedCookies");
     removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel)
                                             .replace("#1", selectedCookieCount);
 
     removeSelectedCookies.disabled = !(seln.count > 0);
     document.getElementById("removeAllCookies").disabled = this._view._filtered;
   },
 
-  deleteCookie: function ()
-  {
+  deleteCookie() {
     // Selection Notes
     // - Selection always moves to *NEXT* adjacent item unless item
     //   is last child at a given level in which case it moves to *PREVIOUS*
     //   item
     //
     // Selection Cases (Somewhat Complicated)
     //
     // 1) Single cookie selected, host has single child
@@ -661,43 +614,40 @@ var gCookiesWindow = {
       var invalidateRow = -1;
       var item = this._view._getItemAtIndex(ci);
       if (item.container) {
         rowCountImpact -= (item.open ? item.cookies.length : 0) + 1;
         deleteItems = deleteItems.concat(item.cookies);
         if (!this._view.hasNextSibling(-1, ci))
           --nextSelected;
         this._view._removeItemAtIndex(ci);
-      }
-      else {
+      } else {
         var parent = this._view._getItemAtIndex(item.parentIndex);
         --rowCountImpact;
         if (parent.cookies.length == 1) {
           --rowCountImpact;
           deleteItems.push(item);
           if (!this._view.hasNextSibling(-1, ci))
             --nextSelected;
           if (!this._view.hasNextSibling(-1, item.parentIndex))
             --nextSelected;
           this._view._removeItemAtIndex(item.parentIndex);
           invalidateRow = item.parentIndex;
-        }
-        else {
+        } else {
           deleteItems.push(item);
           if (!this._view.hasNextSibling(-1, ci))
             --nextSelected;
           this._view._removeItemAtIndex(ci);
         }
       }
       this._view._rowCount += rowCountImpact;
       tbo.rowCountChanged(ci, rowCountImpact);
       if (invalidateRow != -1)
         tbo.invalidateRow(invalidateRow);
-    }
-    else {
+    } else {
       var rangeCount = seln.getRangeCount();
       for (var i = 0; i < rangeCount; ++i) {
         var min = {}; var max = {};
         seln.getRangeAt(i, min, max);
         nextSelected = min.value;
         for (var j = min.value; j <= max.value; ++j) {
           deleteItems.push(this._view._getItemAtIndex(j));
           if (!this._view.hasNextSibling(-1, max.value))
@@ -724,48 +674,43 @@ var gCookiesWindow = {
     if (nextSelected < 0)
       seln.clearSelection();
     else {
       seln.select(nextSelected);
       this._tree.focus();
     }
   },
 
-  deleteAllCookies: function ()
-  {
+  deleteAllCookies() {
     Services.cookies.removeAll();
     this._tree.focus();
   },
 
-  onCookieKeyPress: function (aEvent)
-  {
+  onCookieKeyPress(aEvent) {
     if (aEvent.keyCode == 46)
       this.deleteCookie();
   },
 
-  _lastSortProperty : "",
+  _lastSortProperty: "",
   _lastSortAscending: false,
-  sort: function (aProperty)
-  {
+  sort(aProperty) {
     var ascending = (aProperty == this._lastSortProperty) ? !this._lastSortAscending : true;
 
-    function sortByHost(a, b)
-    {
+    function sortByHost(a, b) {
       return a.toLowerCase().localeCompare(b.toLowerCase());
     }
 
     // Sort the Non-Filtered Host Collections
     if (aProperty == "rawHost") {
       this._hostOrder.sort(sortByHost);
       if (!ascending)
         this._hostOrder.reverse();
     }
 
-    function sortByProperty(a, b)
-    {
+    function sortByProperty(a, b) {
       return a[aProperty].toLowerCase().localeCompare(b[aProperty].toLowerCase());
     }
     for (var host in this._hosts) {
       var cookies = this._hosts[host].cookies;
       cookies.sort(sortByProperty);
       if (!ascending)
         cookies.reverse();
     }
@@ -781,18 +726,17 @@ var gCookiesWindow = {
     this._view.selection.select(0);
     this._tree.treeBoxObject.invalidate();
     this._tree.treeBoxObject.ensureRowIsVisible(0);
 
     this._lastSortAscending = ascending;
     this._lastSortProperty = aProperty;
   },
 
-  clearFilter: function ()
-  {
+  clearFilter() {
     // Revert to single-select in the tree
     this._tree.setAttribute("seltype", "single");
 
     // Clear the Tree Display
     this._view._filtered = false;
     this._view._rowCount = 0;
     this._tree.treeBoxObject.rowCountChanged(0, -this._view._filterSet.length);
     this._view._filterSet = [];
@@ -801,18 +745,17 @@ var gCookiesWindow = {
     this._loadCookies();
     this._tree.treeBoxObject.view = this._view;
 
     // Restore sort order
     var sortby = this._lastSortProperty;
     if (sortby == "") {
       this._lastSortAscending = false;
       this.sort("rawHost");
-    }
-    else {
+    } else {
       this._lastSortAscending = !this._lastSortAscending;
       this.sort(sortby);
     }
 
     // Restore open state
     for (var i = 0; i < this._openIndices.length; ++i)
       this._view.toggleOpenState(this._openIndices[i]);
     this._openIndices = [];
@@ -823,43 +766,40 @@ var gCookiesWindow = {
       var range = this._lastSelectedRanges[i];
       this._view.selection.rangedSelect(range.min, range.max, true);
     }
     this._lastSelectedRanges = [];
 
     document.getElementById("cookiesIntro").value = this._bundle.getString("cookiesAll");
   },
 
-  _cookieMatchesFilter: function (aCookie)
-  {
+  _cookieMatchesFilter(aCookie) {
     return aCookie.rawHost.includes(this._view._filterValue) ||
            aCookie.name.includes(this._view._filterValue) ||
            aCookie.value.includes(this._view._filterValue);
   },
 
-  _filterCookies: function (aFilterValue)
-  {
+  _filterCookies(aFilterValue) {
     this._view._filterValue = aFilterValue;
     var cookies = [];
-    for (var i = 0; i < gCookiesWindow._hostOrder.length; ++i) { //var host in gCookiesWindow._hosts) {
+    for (var i = 0; i < gCookiesWindow._hostOrder.length; ++i) { // var host in gCookiesWindow._hosts) {
       var currHost = gCookiesWindow._hosts[gCookiesWindow._hostOrder[i]]; // gCookiesWindow._hosts[host];
       if (!currHost) continue;
       for (var j = 0; j < currHost.cookies.length; ++j) {
         var cookie = currHost.cookies[j];
         if (this._cookieMatchesFilter(cookie))
           cookies.push(cookie);
       }
     }
     return cookies;
   },
 
   _lastSelectedRanges: [],
   _openIndices: [],
-  _saveState: function ()
-  {
+  _saveState() {
     // Save selection
     var seln = this._view.selection;
     this._lastSelectedRanges = [];
     var rangeCount = seln.getRangeCount();
     for (var i = 0; i < rangeCount; ++i) {
       var min = {}; var max = {};
       seln.getRangeAt(i, min, max);
       this._lastSelectedRanges.push({ min: min.value, max: max.value });
@@ -869,18 +809,17 @@ var gCookiesWindow = {
     this._openIndices = [];
     for (i = 0; i < this._view.rowCount; ++i) {
       var item = this._view._getItemAtIndex(i);
       if (item && item.container && item.open)
         this._openIndices.push(i);
     }
   },
 
-  filter: function ()
-  {
+  filter() {
     var filter = document.getElementById("filter").value;
     if (filter == "") {
       gCookiesWindow.clearFilter();
       return;
     }
     var view = gCookiesWindow._view;
     view._filterSet = gCookiesWindow._filterCookies(filter);
     if (!view._filtered) {
@@ -902,20 +841,19 @@ var gCookiesWindow = {
 
     // if the view is not empty then select the first item
     if (view.rowCount > 0)
       view.selection.select(0);
 
     document.getElementById("cookiesIntro").value = gCookiesWindow._bundle.getString("cookiesFiltered");
   },
 
-  setFilter: function (aFilterString) {
+  setFilter(aFilterString) {
     document.getElementById("filter").value = aFilterString;
     this.filter();
   },
 
-  focusFilterBox: function ()
-  {
+  focusFilterBox() {
     var filter = document.getElementById("filter");
     filter.focus();
     filter.select();
-  }
+  },
 };
--- a/mail/components/preferences/display.js
+++ b/mail/components/preferences/display.js
@@ -2,18 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var gDisplayPane = {
   mInitialized: false,
   mTagListBox:  null,
 
-  init: function ()
-  {
+  init() {
     if (!(("arguments" in window) && window.arguments[1])) {
       // If no tab was specified, select the last used tab.
       let preference = document.getElementById("mail.preferences.display.selectedTabIndex");
       if (preference.value)
         document.getElementById("displayPrefs").selectedIndex = preference.value;
     }
     this._rebuildFonts();
     this.updateMarkAsReadOptions(document.getElementById("automaticallyMarkAsRead").checked);
@@ -33,18 +32,17 @@ var gDisplayPane = {
     this.buildTagList();
   },
 
   // FONTS
 
   /**
    * Populates the default font list in UI.
    */
-  _rebuildFonts: function ()
-  {
+  _rebuildFonts() {
     var langGroupPref = document.getElementById("font.language.group");
     var isSerif = this._readDefaultFontTypeForLanguage(langGroupPref.value) == "serif";
     this._selectDefaultLanguageGroup(langGroupPref.value, isSerif);
   },
 
   /**
    * Select the default language group.
    */
@@ -114,18 +112,17 @@ var gDisplayPane = {
       }
     })().catch(Cu.reportError);
   },
 
   /**
    * Returns the type of the current default font for the language denoted by
    * aLanguageGroup.
    */
-  _readDefaultFontTypeForLanguage: function (aLanguageGroup)
-  {
+  _readDefaultFontTypeForLanguage(aLanguageGroup) {
     const kDefaultFontType = "font.default.%LANG%";
     var defaultFontTypePref = kDefaultFontType.replace(/%LANG%/, aLanguageGroup);
     var preference = document.getElementById(defaultFontTypePref);
     if (!preference) {
       preference = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "preference");
       preference.id = defaultFontTypePref;
       preference.type = "string";
       preference.name = defaultFontTypePref;
@@ -137,18 +134,17 @@ var gDisplayPane = {
 
   /**
    * Determine the appropriate value to select for defaultFont, for the
    * following cases:
    * - there is no setting
    * - the font selected by the user is no longer present (e.g. deleted from
    *   fonts folder)
    */
-  readFontSelection: function gDisplayPane_readFontSelection()
-  {
+  readFontSelection: function gDisplayPane_readFontSelection() {
     let element = document.getElementById("defaultFont");
     let preference = document.getElementById(element.getAttribute("preference"));
     if (preference.value) {
       let fontItem = element.querySelector('[value="' + preference.value + '"]');
 
       // There is a setting that actually is in the list. Respect it.
       if (fontItem)
         return undefined;
@@ -167,98 +163,86 @@ var gDisplayPane = {
     for (let fontName of fontNames) {
       let fontItem = element.querySelector('[value="' + fontName.trim() + '"]');
       if (fontItem)
         return fontItem.getAttribute("value");
     }
     return defaultValue;
   },
 
-  tabSelectionChanged: function ()
-  {
+  tabSelectionChanged() {
     if (this.mInitialized)
       document.getElementById("mail.preferences.display.selectedTabIndex")
               .valueFromPreferences = document.getElementById("displayPrefs").selectedIndex;
   },
 
   /**
    * Displays the fonts dialog, where web page font names and sizes can be
    * configured.
    */
-  configureFonts: function ()
-  {
+  configureFonts() {
     gSubDialog.open("chrome://messenger/content/preferences/fonts.xul");
   },
 
   /**
    * Displays the colors dialog, where default web page/link/etc. colors can be
    * configured.
    */
-  configureColors: function ()
-  {
+  configureColors() {
     gSubDialog.open("chrome://messenger/content/preferences/colors.xul",
                     "resizable=no");
   },
 
 
   // appends the tag to the tag list box
-  appendTagItem: function(aTagName, aKey, aColor)
-  {
+  appendTagItem(aTagName, aKey, aColor) {
     let item = this.mTagListBox.appendItem(aTagName, aKey);
     item.style.color = aColor;
     return item;
   },
 
-  buildTagList: function()
-  {
+  buildTagList() {
     let tagArray = MailServices.tags.getAllTags({});
-    for (let i = 0; i < tagArray.length; ++i)
-    {
+    for (let i = 0; i < tagArray.length; ++i) {
       let taginfo = tagArray[i];
       this.appendTagItem(taginfo.tag, taginfo.key, taginfo.color);
     }
   },
 
-  removeTag: function()
-  {
+  removeTag() {
     var index = this.mTagListBox.selectedIndex;
-    if (index >= 0)
-    {
+    if (index >= 0) {
       var itemToRemove = this.mTagListBox.getItemAtIndex(index);
       MailServices.tags.deleteKey(itemToRemove.getAttribute("value"));
       itemToRemove.remove();
       var numItemsInListBox = this.mTagListBox.getRowCount();
       this.mTagListBox.selectedIndex = index < numItemsInListBox ? index : numItemsInListBox - 1;
     }
   },
 
   /**
    * Open the edit tag dialog
    */
-  editTag: function()
-  {
+  editTag() {
     var index = this.mTagListBox.selectedIndex;
-    if (index >= 0)
-    {
+    if (index >= 0) {
       var tagElToEdit = this.mTagListBox.getItemAtIndex(index);
       var args = {result: "", keyToEdit: tagElToEdit.getAttribute("value"), okCallback: editTagCallback};
       let dialog = gSubDialog.open("chrome://messenger/content/newTagDialog.xul",
                                    "resizable=no", args);
     }
   },
 
-  addTag: function()
-  {
+  addTag() {
     var args = {result: "", okCallback: addTagCallback};
     let dialog = gSubDialog.open("chrome://messenger/content/newTagDialog.xul",
                                  "resizable=no", args);
   },
 
-  onSelect: function()
-  {
+  onSelect() {
     let btnEdit = document.getElementById("editTagButton");
     let listBox = document.getElementById("tagList");
 
     if (listBox.selectedCount > 0)
       btnEdit.disabled = false;
     else
       btnEdit.disabled = true;
 
@@ -266,62 +250,57 @@ var gDisplayPane = {
   },
 
   /**
    * Enable/disable the options of automatic marking as read depending on the
    * state of the automatic marking feature.
    *
    * @param aEnableRadioGroup  Boolean value indicating whether the feature is enabled.
    */
-  updateMarkAsReadOptions: function(aEnableRadioGroup)
-  {
+  updateMarkAsReadOptions(aEnableRadioGroup) {
     let autoMarkAsPref = document.getElementById("mailnews.mark_message_read.delay");
     let autoMarkDisabled = !aEnableRadioGroup || autoMarkAsPref.locked;
     document.getElementById("markAsReadAutoPreferences").disabled = autoMarkDisabled;
     document.getElementById("secondsLabel").disabled = autoMarkDisabled;
     this.updateMarkAsReadTextbox();
   },
 
   /**
    * Automatically enable/disable delay textbox depending on state of the
    * Mark As Read On Delay feature.
    *
    * @param aFocusTextBox  Boolean value whether Mark As Read On Delay
    *                       option was selected and the textbox should be focused.
    */
-  updateMarkAsReadTextbox: function(aFocusTextBox)
-  {
+  updateMarkAsReadTextbox(aFocusTextBox) {
     let globalCheckbox = document.getElementById("automaticallyMarkAsRead");
     let delayRadioOption = document.getElementById("markAsReadAfterDelay");
     let delayTextbox = document.getElementById("markAsReadDelay");
     let intervalPref = document.getElementById("mailnews.mark_message_read.delay.interval");
     delayTextbox.disabled = !globalCheckbox.checked ||
                             !delayRadioOption.selected || intervalPref.locked;
     if (!delayTextbox.disabled && aFocusTextBox)
       delayTextbox.focus();
-  }
+  },
 };
 
-function addTagCallback(aName, aColor)
-{
+function addTagCallback(aName, aColor) {
   MailServices.tags.addTag(aName, aColor, "");
 
   var item = gDisplayPane.appendTagItem(aName, MailServices.tags.getKeyForTag(aName), aColor);
   var tagListBox = document.getElementById("tagList");
   tagListBox.ensureElementIsVisible(item);
   tagListBox.selectItem(item);
   tagListBox.focus();
 }
 
-function editTagCallback()
-{
+function editTagCallback() {
   // update the values of the selected item
   var tagListEl = document.getElementById("tagList");
   var index = tagListEl.selectedIndex;
-  if (index >= 0)
-  {
+  if (index >= 0) {
     var tagElToEdit = tagListEl.getItemAtIndex(index);
     var key = tagElToEdit.getAttribute("value");
     // update the color and label elements
     tagElToEdit.setAttribute("label", MailServices.tags.getTagForKey(key));
     tagElToEdit.style.color = MailServices.tags.getColorForKey(key);
   }
 }
--- a/mail/components/preferences/downloads.js
+++ b/mail/components/preferences/downloads.js
@@ -1,16 +1,15 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var gDownloadDirSection = {
-  chooseFolder: function ()
-  {
+  chooseFolder() {
     const nsIFilePicker = Ci.nsIFilePicker;
     var fp = Cc["@mozilla.org/filepicker;1"]
                .createInstance(nsIFilePicker);
     var bundlePreferences = document.getElementById("bundlePreferences");
     var title = bundlePreferences.getString("chooseAttachmentsFolderTitle");
     fp.init(window, title, nsIFilePicker.modeGetFolder);
 
     const nsIFile = Ci.nsIFile;
@@ -26,77 +25,71 @@ var gDownloadDirSection = {
       let file = fp.file.QueryInterface(nsIFile);
       let currentDirPref = document.getElementById("browser.download.downloadDir");
       customDirPref.value = currentDirPref.value = file;
       let folderListPref = document.getElementById("browser.download.folderList");
       folderListPref.value = this._fileToIndex(file);
     });
   },
 
-  onReadUseDownloadDir: function ()
-  {
+  onReadUseDownloadDir() {
     this.readDownloadDirPref();
     var downloadFolder = document.getElementById("downloadFolder");
     var chooseFolder = document.getElementById("chooseFolder");
     var preference = document.getElementById("browser.download.useDownloadDir");
     downloadFolder.disabled = !preference.value;
     chooseFolder.disabled = !preference.value;
     return undefined;
   },
 
-  _fileToIndex: function (aFile)
-  {
+  _fileToIndex(aFile) {
     if (!aFile || aFile.equals(this._getDownloadsFolder("Desktop")))
       return 0;
     else if (aFile.equals(this._getDownloadsFolder("Downloads")))
       return 1;
     return 2;
   },
 
-  _indexToFile: function (aIndex)
-  {
+  _indexToFile(aIndex) {
     switch (aIndex) {
     case 0:
       return this._getDownloadsFolder("Desktop");
     case 1:
       return this._getDownloadsFolder("Downloads");
     }
     var customDirPref = document.getElementById("browser.download.dir");
     return customDirPref.value;
   },
 
-  _getSpecialFolderKey: function (aFolderType)
-  {
+  _getSpecialFolderKey(aFolderType) {
     if (aFolderType == "Desktop")
       return "Desk";
 
     if (aFolderType != "Downloads")
       throw "ASSERTION FAILED: folder type should be 'Desktop' or 'Downloads'";
 
     if (AppConstants.platform == "win")
       return "Pers";
 
     if (AppConstants.platform == "macosx")
       return "UsrDocs";
 
     return "Home";
   },
 
-  _getDownloadsFolder: function (aFolder)
-  {
+  _getDownloadsFolder(aFolder) {
     let dir = Services.dirsvc.get(this._getSpecialFolderKey(aFolder),
                                   Ci.nsIFile);
     if (aFolder != "Desktop")
       dir.append("My Downloads");
 
     return dir;
   },
 
-  readDownloadDirPref: function ()
-  {
+  readDownloadDirPref() {
     var folderListPref = document.getElementById("browser.download.folderList");
     var bundlePreferences = document.getElementById("bundlePreferences");
     var downloadFolder = document.getElementById("downloadFolder");
 
     var customDirPref = document.getElementById("browser.download.dir");
     var customIndex = customDirPref.value ? this._fileToIndex(customDirPref.value) : 0;
     if (customIndex == 0)
       downloadFolder.value = bundlePreferences.getString("desktopFolderName");
@@ -111,14 +104,13 @@ var gDownloadDirSection = {
       .QueryInterface(Ci.nsIFileProtocolHandler)
       .getURLSpecFromFile(downloadDir);
 
     downloadFolder.style.backgroundImage = "url(moz-icon://" + urlSpec + "?size=16)";
 
     return undefined;
   },
 
-  writeFolderList: function ()
-  {
+  writeFolderList() {
     var currentDirPref = document.getElementById("browser.download.downloadDir");
     return this._fileToIndex(currentDirPref.value);
-  }
+  },
 };
--- a/mail/components/preferences/fonts.js
+++ b/mail/components/preferences/fonts.js
@@ -67,54 +67,48 @@ var gFontsDialog = {
           await FontBuilder.buildFontList(aLanguageGroup, prefs[i].fonttype, element);
         preference.setElementValue(element);
       }
     }
    })()
     .catch(Cu.reportError);
   },
 
-  readFontLanguageGroup()
-  {
+  readFontLanguageGroup() {
     var languagePref = Preferences.get("font.language.group");
     this._selectLanguageGroup(languagePref.value);
     return undefined;
   },
 
-  readUseDocumentFonts: function ()
-  {
+  readUseDocumentFonts() {
     var preference = Preferences.get("browser.display.use_document_fonts");
     return preference.value == 1;
   },
 
-  writeUseDocumentFonts: function ()
-  {
+  writeUseDocumentFonts() {
     var useDocumentFonts = document.getElementById("useDocumentFonts");
     return useDocumentFonts.checked ? 1 : 0;
   },
 
-  readFixedWidthForPlainText: function ()
-  {
+  readFixedWidthForPlainText() {
     var preference = Preferences.get("mail.fixed_width_messages");
     return preference.value == 1;
   },
 
-  writeFixedWidthForPlainText: function ()
-  {
+  writeFixedWidthForPlainText() {
     var mailFixedWidthMessages = document.getElementById("mailFixedWidthMessages");
     return mailFixedWidthMessages.checked;
   },
 
   /**
    * Both mailnews.send_default_charset and mailnews.view_default_charset
    * are nsIPrefLocalizedString. Its default value is different depending
    * on the user locale (see bug 48842).
    */
-  ondialogaccept: function()
-  {
+  ondialogaccept() {
     var sendCharsetStr = Services.prefs.getComplexValue(
       "mailnews.send_default_charset", Ci.nsIPrefLocalizedString).data;
 
     var viewCharsetStr = Services.prefs.getComplexValue(
       "mailnews.view_default_charset", Ci.nsIPrefLocalizedString).data;
 
     var defaultPrefs = Services.prefs.getDefaultBranch("mailnews.");
 
@@ -124,10 +118,10 @@ var gFontsDialog = {
           "send_default_charset", Ci.nsIPrefLocalizedString).data)
       Services.prefs.clearUserPref("mailnews.send_default_charset");
 
     if (viewCharsetStr === defaultPrefs.getComplexValue(
           "view_default_charset", Ci.nsIPrefLocalizedString).data)
       Services.prefs.clearUserPref("mailnews.view_default_charset");
 
     return true;
-  }
+  },
 };
--- a/mail/components/preferences/general.js
+++ b/mail/components/preferences/general.js
@@ -2,124 +2,111 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var gGeneralPane = {
   mPane: null,
   mStartPageUrl: "",
 
-  init: function ()
-  {
+  init() {
     this.mPane = document.getElementById("paneGeneral");
 
     this.updateStartPage();
     this.updatePlaySound();
     this.updateCustomizeAlert();
     this.updateWebSearch();
   },
 
   /**
    * Restores the default start page as the user's start page
    */
-  restoreDefaultStartPage: function()
-  {
+  restoreDefaultStartPage() {
     var startPage = document.getElementById("mailnews.start_page.url");
     startPage.value = startPage.defaultValue;
   },
 
   /**
    * Returns a formatted url corresponding to the value of mailnews.start_page.url
    * Stores the original value of mailnews.start_page.url
    */
-  readStartPageUrl: function()
-  {
+  readStartPageUrl() {
     var pref = document.getElementById("mailnews.start_page.url");
     this.mStartPageUrl = pref.value;
     return Services.urlFormatter.formatURL(this.mStartPageUrl);
   },
 
   /**
    * Returns the value of the mailnews start page url represented by the UI.
    * If the url matches the formatted version of our stored value, then
    * return the unformatted url.
    */
-  writeStartPageUrl: function()
-  {
-    var startPage = document.getElementById('mailnewsStartPageUrl');
+  writeStartPageUrl() {
+    var startPage = document.getElementById("mailnewsStartPageUrl");
     return Services.urlFormatter.formatURL(this.mStartPageUrl) == startPage.value ? this.mStartPageUrl : startPage.value;
   },
 
-  customizeMailAlert: function()
-  {
+  customizeMailAlert() {
     gSubDialog.open("chrome://messenger/content/preferences/notifications.xul",
                     "resizable=no");
   },
 
-  configureDockOptions: function()
-  {
+  configureDockOptions() {
     gSubDialog.open("chrome://messenger/content/preferences/dockoptions.xul",
                     "resizable=no");
   },
 
-  convertURLToLocalFile: function(aFileURL)
-  {
+  convertURLToLocalFile(aFileURL) {
     // convert the file url into a nsIFile
-    if (aFileURL)
-    {
+    if (aFileURL) {
       return Services.io
                      .getProtocolHandler("file")
                      .QueryInterface(Ci.nsIFileProtocolHandler)
                      .getFileFromURLSpec(aFileURL);
     }
-    else
-      return null;
+    return null;
   },
 
-  readSoundLocation: function()
-  {
+  readSoundLocation() {
     var soundUrlLocation = document.getElementById("soundUrlLocation");
     soundUrlLocation.value = document.getElementById("mail.biff.play_sound.url").value;
-    if (soundUrlLocation.value)
-    {
+    if (soundUrlLocation.value) {
       soundUrlLocation.label = this.convertURLToLocalFile(soundUrlLocation.value).leafName;
       soundUrlLocation.style.backgroundImage = "url(moz-icon://" + soundUrlLocation.label + "?size=16)";
     }
     return undefined;
   },
 
-  previewSound: function ()
-  {
+  previewSound() {
     let sound = Cc["@mozilla.org/sound;1"]
                   .createInstance(Ci.nsISound);
 
     let soundLocation;
     // soundType radio-group isn't used for macOS so it is not in the XUL file
     // for the platform.
     soundLocation = (AppConstants.platform == "macosx" ||
-                     document.getElementById('soundType').value == 1) ?
-                       document.getElementById('soundUrlLocation').value : "";
+                     document.getElementById("soundType").value == 1) ?
+                       document.getElementById("soundUrlLocation").value : "";
 
     if (!soundLocation.includes("file://")) {
       // User has not set any custom sound file to be played
       sound.playEventSound(Ci.nsISound.EVENT_NEW_MAIL_RECEIVED);
     } else {
       // User has set a custom audio file to be played along the alert.
       sound.play(Services.io.newURI(soundLocation));
     }
   },
 
-  browseForSoundFile: function ()
-  {
+  browseForSoundFile() {
     const nsIFilePicker = Ci.nsIFilePicker;
     var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
 
     // if we already have a sound file, then use the path for that sound file
     // as the initial path in the dialog.
-    var localFile = this.convertURLToLocalFile(document.getElementById('soundUrlLocation').value);
+    var localFile = this.convertURLToLocalFile(document.getElementById("soundUrlLocation").value);
     if (localFile)
       fp.displayDirectory = localFile.parent;
 
     // XXX todo, persist the last sound directory and pass it in
     fp.init(window, document.getElementById("bundlePreferences").getString("soundFilePickerTitle"), nsIFilePicker.modeOpen);
 
     // On Mac, allow AIFF and CAF files too
     var bundlePrefs = document.getElementById("bundlePreferences");
@@ -137,77 +124,74 @@ var gGeneralPane = {
       }
       // convert the nsIFile into a nsIFile url
       document.getElementById("mail.biff.play_sound.url").value = fp.fileURL.spec;
       this.readSoundLocation(); // XXX We shouldn't have to be doing this by hand
       this.updatePlaySound();
     });
   },
 
-  updatePlaySound: function()
-  {
+  updatePlaySound() {
     // Update the sound type radio buttons based on the state of the
     // play sound checkbox.
-    var soundsDisabled = !document.getElementById('newMailNotification').checked;
-    var soundUrlLocation = document.getElementById('soundUrlLocation').value;
+    var soundsDisabled = !document.getElementById("newMailNotification").checked;
+    var soundUrlLocation = document.getElementById("soundUrlLocation").value;
 
     // The UI is different on OS X as the user can only choose between letting
     // the system play a default sound or setting a custom one. Therefore,
     // "soundTypeEl" does not exist on OS X.
     if (AppConstants.platform != "macosx") {
-      var soundTypeEl = document.getElementById('soundType');
+      var soundTypeEl = document.getElementById("soundType");
       soundTypeEl.disabled = soundsDisabled;
       document.getElementById("soundUrlLocation").disabled =
         soundsDisabled || soundTypeEl.value != 1;
-      document.getElementById('playSound').disabled =
+      document.getElementById("playSound").disabled =
         soundsDisabled || (!soundUrlLocation && soundTypeEl.value != 0);
     } else {
       // On OS X, if there is no selected custom sound then default one will
       // be played. We keep consistency by disabling the "Play sound" checkbox
       // if the user hasn't selected a custom sound file yet.
-      document.getElementById('newMailNotification').disabled = !soundUrlLocation;
-      document.getElementById('playSound').disabled = !soundUrlLocation;
+      document.getElementById("newMailNotification").disabled = !soundUrlLocation;
+      document.getElementById("playSound").disabled = !soundUrlLocation;
       // The sound type radiogroup is hidden, but we have to keep the
       // play_sound.type pref set appropriately.
       document.getElementById("mail.biff.play_sound.type").value =
         (!soundsDisabled && soundUrlLocation) ? 1 : 0;
     }
   },
 
-  updateStartPage: function()
-  {
+  updateStartPage() {
     document.getElementById("mailnewsStartPageUrl").disabled =
       !document.getElementById("mailnewsStartPageEnabled").checked;
   },
 
-  updateCustomizeAlert: function()
-  {
+  updateCustomizeAlert() {
     // The button does not exist on all platforms.
     let customizeAlertButton = document.getElementById("customizeMailAlert");
     if (customizeAlertButton) {
       customizeAlertButton.disabled =
         !document.getElementById("newMailNotificationAlert").checked;
     }
   },
 
-  updateWebSearch: function() {
+  updateWebSearch() {
     Services.search.init({
-      onInitComplete: function() {
+      onInitComplete() {
         let engineList = document.getElementById("defaultWebSearch");
         for (let engine of Services.search.getVisibleEngines()) {
           let item = engineList.appendItem(engine.name);
           item.engine = engine;
           item.className = "menuitem-iconic";
           item.setAttribute(
             "image", engine.iconURI ? engine.iconURI.spec :
                      "resource://gre-resources/broken-image.png"
           );
           if (engine == Services.search.currentEngine)
             engineList.selectedItem = item;
         }
 
         engineList.addEventListener("command", function() {
           Services.search.currentEngine = engineList.selectedItem.engine;
         });
-      }
+      },
     });
   },
 };
--- a/mail/components/preferences/messagestyle.js
+++ b/mail/components/preferences/messagestyle.js
@@ -12,101 +12,100 @@ function Conversation(aName) {
   let now = new Date();
   this._date = new Date(now.getFullYear(), now.getMonth(), now.getDate(),
                         10, 42, 22) * 1000;
 }
 Conversation.prototype = {
   __proto__: jsProtoHelper.GenericConvIMPrototype,
   account: {protocol: {name: "Fake Protocol"},
             alias: "", name: "Fake Account",
-            statusInfo: Services.core.globalUserStatus}
+            statusInfo: Services.core.globalUserStatus},
 };
 
 function Message(aWho, aMessage, aObject) {
   this._init(aWho, aMessage, aObject);
 }
 Message.prototype = {
   __proto__: jsProtoHelper.GenericMessagePrototype,
-  get displayMessage() { return this.originalMessage; }
+  get displayMessage() { return this.originalMessage; },
 };
 
 // Message style tooltips use this.
 function getBrowser() { return document.getElementById("previewbrowser"); }
 
 var previewObserver = {
   _loaded: false,
-  load: function() {
+  load() {
     let makeDate = function(aDateString) {
       let array = aDateString.split(":");
       let now = new Date();
       return (new Date(now.getFullYear(), now.getMonth(), now.getDate(),
                        array[0], array[1], array[2])) / 1000;
     };
     let bundle = document.getElementById("themesBundle");
     let msg = {};
     ["nick1", "buddy1", "nick2", "buddy2",
      "message1", "message2", "message3"].forEach(function(aText) {
       msg[aText] = bundle.getString(aText);
     });
     let conv = new Conversation(msg.nick2);
     conv.messages = [
       new Message(msg.buddy1, msg.message1, {outgoing: true, _alias: msg.nick1, time: makeDate("10:42:22"), _conversation: conv}),
       new Message(msg.buddy1, msg.message2, {outgoing: true, _alias: msg.nick1, time: makeDate("10:42:25"), _conversation: conv}),
-      new Message(msg.buddy2, msg.message3, {incoming: true, _alias: msg.nick2, time: makeDate("10:43:01"), _conversation: conv})
+      new Message(msg.buddy2, msg.message3, {incoming: true, _alias: msg.nick2, time: makeDate("10:43:01"), _conversation: conv}),
     ];
     previewObserver.conv = conv;
 
     let themeName = document.getElementById("messagestyle-themename");
     if (themeName.value && !themeName.selectedItem)
       themeName.value = themeName.value;
     previewObserver.browser = document.getElementById("previewbrowser");
     document.getElementById("showHeaderCheckbox")
             .addEventListener("CheckboxStateChange",
                               previewObserver.showHeaderChanged);
     previewObserver.displayTheme(themeName.value);
     this._loaded = true;
   },
 
-  showHeaderChanged: function() {
+  showHeaderChanged() {
     if (!previewObserver._loaded)
       return;
 
     previewObserver.theme.showHeader = this.checked;
     previewObserver.reloadPreview();
   },
 
-  currentThemeChanged: function() {
+  currentThemeChanged() {
     if (!this._loaded)
       return;
 
     let currentTheme = document.getElementById("messagestyle-themename").value;
     if (!currentTheme)
       return;
 
     this.displayTheme(currentTheme);
   },
 
   _ignoreVariantChange: false,
-  currentVariantChanged: function() {
+  currentVariantChanged() {
     if (!this._loaded || this._ignoreVariantChange)
       return;
 
     let variant = document.getElementById("themevariant").value;
     if (!variant)
       return;
 
     this.theme.variant = variant;
     this.reloadPreview();
   },
 
-  displayTheme: function(aTheme) {
+  displayTheme(aTheme) {
     try {
       this.theme = getThemeByName(aTheme);
-    }
-    catch(e) {
+    } catch (e) {
       document.getElementById("previewDeck").selectedIndex = 0;
       return;
     }
 
     let menulist = document.getElementById("themevariant");
     if (menulist.firstChild)
       menulist.firstChild.remove();
     let popup = menulist.appendChild(document.createElement("menupopup"));
@@ -155,23 +154,23 @@ var previewObserver = {
 
     document.getElementById("showHeaderCheckbox").disabled =
       !this.theme.html.hasOwnProperty("header");
 
     this.reloadPreview();
     document.getElementById("previewDeck").selectedIndex = 1;
   },
 
-  reloadPreview: function() {
+  reloadPreview() {
     this.browser.init(this.conv);
     this.browser._theme = this.theme;
     Services.obs.addObserver(this, "conversation-loaded");
   },
 
-  observe: function(aSubject, aTopic, aData) {
+  observe(aSubject, aTopic, aData) {
     if (aTopic != "conversation-loaded" || aSubject != this.browser)
       return;
 
     // We want to avoid the convbrowser trying to scroll to the last
     // added message, as that causes the entire pref pane to jump up
     // (bug 1179943). Therefore, we override the method convbrowser
     // uses to determine if it should scroll, as well as its
     // mirror in the contentWindow (that messagestyle JS can call).
@@ -181,10 +180,10 @@ var previewObserver = {
     // Display all queued messages. Use a timeout so that message text
     // modifiers can be added with observers for this notification.
     setTimeout(function() {
       for (let message of previewObserver.conv.messages)
         aSubject.appendMessage(message, false);
     }, 0);
 
     Services.obs.removeObserver(this, "conversation-loaded");
-  }
+  },
 };
--- a/mail/components/preferences/offline.js
+++ b/mail/components/preferences/offline.js
@@ -1,21 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var kAutomatic         = 4;
 var kRememberLastState = 0;
 
 var gOfflineDialog = {
-  dialogSetup: function() {
+  dialogSetup() {
     let offlineAutoDetection = document.getElementById("offline.autoDetect");
     let offlineStartupStatePref = document.getElementById("offline.startup_state");
 
     offlineStartupStatePref.disabled = offlineAutoDetection.value;
     if (offlineStartupStatePref.disabled) {
       offlineStartupStatePref.value = kAutomatic;
-    } else {
-      if (offlineStartupStatePref.value == kAutomatic)
+    } else if (offlineStartupStatePref.value == kAutomatic)
         offlineStartupStatePref.value = kRememberLastState;
-    }
-  }
+  },
 };
--- a/mail/components/preferences/permissions.js
+++ b/mail/components/preferences/permissions.js
@@ -11,68 +11,64 @@ var nsICookiePermission = Ci.nsICookiePe
 var NOTIFICATION_FLUSH_PERMISSIONS = "flush-pending-permissions";
 
 /**
  * Magic URI base used so the permission manager can store
  * remote content permissions for a given email address.
  */
 var MAILURI_BASE = "chrome://messenger/content/email=";
 
-function Permission(principal, type, capability)
-{
+function Permission(principal, type, capability) {
   this.principal = principal;
   this.origin = principal.origin;
   this.type = type;
   this.capability = capability;
 }
 
 var gPermissionManager = {
-  _type                 : "",
-  _permissions          : [],
-  _permissionsToAdd     : new Map(),
-  _permissionsToDelete  : new Map(),
-  _bundle               : null,
-  _tree                 : null,
-  _observerRemoved      : false,
+  _type: "",
+  _permissions: [],
+  _permissionsToAdd: new Map(),
+  _permissionsToDelete: new Map(),
+  _bundle: null,
+  _tree: null,
+  _observerRemoved: false,
 
   _view: {
     _rowCount: 0,
-    get rowCount()
-    {
+    get rowCount() {
       return this._rowCount;
     },
-    getCellText: function (aRow, aColumn)
-    {
+    getCellText(aRow, aColumn) {
       if (aColumn.id == "siteCol")
         return gPermissionManager._permissions[aRow].origin
           .replace(MAILURI_BASE, "");
       else if (aColumn.id == "statusCol")
         return gPermissionManager._permissions[aRow].capability;
       return "";
     },
 
-    isSeparator: function(aIndex) { return false; },
-    isSorted: function() { return false; },
-    isContainer: function(aIndex) { return false; },
-    setTree: function(aTree){},
-    getImageSrc: function(aRow, aColumn) {},
-    getProgressMode: function(aRow, aColumn) {},
-    getCellValue: function(aRow, aColumn) {},
-    cycleHeader: function(column) {},
-    getRowProperties: function(row){ return ""; },
-    getColumnProperties: function(column){ return ""; },
-    getCellProperties: function(row,column){
+    isSeparator(aIndex) { return false; },
+    isSorted() { return false; },
+    isContainer(aIndex) { return false; },
+    setTree(aTree) {},
+    getImageSrc(aRow, aColumn) {},
+    getProgressMode(aRow, aColumn) {},
+    getCellValue(aRow, aColumn) {},
+    cycleHeader(column) {},
+    getRowProperties(row) { return ""; },
+    getColumnProperties(column) { return ""; },
+    getCellProperties(row, column) {
       if (column.element.getAttribute("id") == "siteCol")
         return "ltr";
       return "";
-    }
+    },
   },
 
-  _getCapabilityString: function (aCapability)
-  {
+  _getCapabilityString(aCapability) {
     var stringKey = null;
     switch (aCapability) {
     case nsIPermissionManager.ALLOW_ACTION:
       stringKey = "can";
       break;
     case nsIPermissionManager.DENY_ACTION:
       stringKey = "cannot";
       break;
@@ -81,18 +77,17 @@ var gPermissionManager = {
       break;
     case nsICookiePermission.ACCESS_SESSION:
       stringKey = "canSession";
       break;
     }
     return this._bundle.getString(stringKey);
   },
 
-  addPermission: function (aCapability)
-  {
+  addPermission(aCapability) {
     var textbox = document.getElementById("url");
     var input_url = textbox.value.trim();
     let principal;
     try {
       // The origin accessor on the principal object will throw if the
       // principal doesn't have a canonical origin representation. This will
       // help catch cases where the URI parser parsed something like
       // `localhost:8080` as having the scheme `localhost`, rather than being
@@ -100,25 +95,25 @@ var gPermissionManager = {
       // permission manager for storage, so this won't prevent any valid
       // permissions from being entered by the user.
       let uri;
       try {
         uri = Services.io.newURI(input_url);
         principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
         // If we have ended up with an unknown scheme, the following will throw.
         principal.origin;
-      } catch(ex) {
+      } catch (ex) {
         let scheme = (this._type != "image" || !input_url.includes("@")) ?
           "http://" : MAILURI_BASE;
         uri = Services.io.newURI(scheme + input_url);
         principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
         // If we have ended up with an unknown scheme, the following will throw.
         principal.origin;
       }
-    } catch(ex) {
+    } catch (ex) {
       var message = this._bundle.getString("invalidURI");
       var title = this._bundle.getString("invalidURITitle");
       Services.prompt.alert(window, title, message);
       return;
     }
 
     var capabilityString = this._getCapabilityString(aCapability);
 
@@ -132,108 +127,98 @@ var gPermissionManager = {
         capabilityExists = this._permissions[i].capability == capabilityString;
         if (!capabilityExists) {
           this._permissions[i].capability = capabilityString;
         }
         break;
       }
     }
 
-    let permissionParams = {principal: principal, type: this._type, capability: aCapability};
+    let permissionParams = {principal, type: this._type, capability: aCapability};
     if (!permissionExists) {
       this._permissionsToAdd.set(principal.origin, permissionParams);
       this._addPermission(permissionParams);
-    }
-    else if (!capabilityExists) {
+    } else if (!capabilityExists) {
       this._permissionsToAdd.set(principal.origin, permissionParams);
       this._handleCapabilityChange();
     }
 
     textbox.value = "";
     textbox.focus();
 
     // covers a case where the site exists already, so the buttons don't disable
     this.onHostInput(textbox);
 
     // enable "remove all" button as needed
     document.getElementById("removeAllPermissions").disabled = this._permissions.length == 0;
   },
 
-  _removePermission: function(aPermission)
-  {
+  _removePermission(aPermission) {
     this._removePermissionFromList(aPermission.principal);
 
     // If this permission was added during this session, let's remove
     // it from the pending adds list to prevent calls to the
     // permission manager.
     let isNewPermission = this._permissionsToAdd.delete(aPermission.principal.origin);
 
     if (!isNewPermission) {
       this._permissionsToDelete.set(aPermission.principal.origin, aPermission);
     }
 
   },
 
-  _handleCapabilityChange: function ()
-  {
+  _handleCapabilityChange() {
     // Re-do the sort, if the status changed from Block to Allow
     // or vice versa, since if we're sorted on status, we may no
     // longer be in order.
     if (this._lastPermissionSortColumn == "statusCol") {
       this._resortPermissions();
     }
     this._tree.treeBoxObject.invalidate();
   },
 
-  _addPermission: function(aPermission)
-  {
+  _addPermission(aPermission) {
     this._addPermissionToList(aPermission);
     ++this._view._rowCount;
     this._tree.treeBoxObject.rowCountChanged(this._view.rowCount - 1, 1);
     // Re-do the sort, since we inserted this new item at the end.
     this._resortPermissions();
   },
 
-  _resortPermissions: function()
-  {
+  _resortPermissions() {
     gTreeUtils.sort(this._tree, this._view, this._permissions,
                     this._lastPermissionSortColumn,
                     this._permissionsComparator,
                     this._lastPermissionSortColumn,
                     !this._lastPermissionSortAscending); // keep sort direction
   },
 
-  onHostInput: function (aSiteField)
-  {
+  onHostInput(aSiteField) {
     document.getElementById("btnSession").disabled = !aSiteField.value;
     document.getElementById("btnBlock").disabled = !aSiteField.value;
     document.getElementById("btnAllow").disabled = !aSiteField.value;
   },
 
-  onWindowKeyPress: function (aEvent)
-  {
+  onWindowKeyPress(aEvent) {
     if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE)
       window.close();
   },
 
-  onHostKeyPress: function (aEvent)
-  {
+  onHostKeyPress(aEvent) {
     if (aEvent.keyCode == KeyEvent.DOM_VK_RETURN)
       document.getElementById("btnAllow").click();
   },
 
-  onLoad: function ()
-  {
+  onLoad() {
     this._bundle = document.getElementById("bundlePreferences");
     var params = window.arguments[0];
     this.init(params);
   },
 
-  init: function (aParams)
-  {
+  init(aParams) {
     if (this._type) {
       // reusing an open dialog, clear the old observer
       this.uninit();
     }
 
     this._type = aParams.permissionType;
     this._manageCapability = aParams.manageCapability;
 
@@ -276,136 +261,124 @@ var gPermissionManager = {
     Services.obs.notifyObservers(null, NOTIFICATION_FLUSH_PERMISSIONS, this._type);
     Services.obs.addObserver(this, "perm-changed");
 
     this._loadPermissions();
 
     urlField.focus();
   },
 
-  uninit: function ()
-  {
+  uninit() {
     if (!this._observerRemoved) {
       Services.obs.removeObserver(this, "perm-changed");
 
       this._observerRemoved = true;
     }
   },
 
-  observe: function (aSubject, aTopic, aData)
-  {
+  observe(aSubject, aTopic, aData) {
     if (aTopic == "perm-changed") {
       var permission = aSubject.QueryInterface(Ci.nsIPermission);
 
       // Ignore unrelated permission types.
       if (permission.type != this._type)
         return;
 
       if (aData == "added") {
         this._addPermission(permission);
-      }
-      else if (aData == "changed") {
+      } else if (aData == "changed") {
         for (var i = 0; i < this._permissions.length; ++i) {
           if (permission.matches(this._permissions[i].principal, true)) {
             this._permissions[i].capability = this._getCapabilityString(permission.capability);
             break;
           }
         }
         this._handleCapabilityChange();
-      }
-      else if (aData == "deleted") {
+      } else if (aData == "deleted") {
         this._removePermissionFromList(permission);
       }
     }
   },
 
-  onPermissionSelected: function ()
-  {
+  onPermissionSelected() {
     var hasSelection = this._tree.view.selection.count > 0;
     var hasRows = this._tree.view.rowCount > 0;
     document.getElementById("removePermission").disabled = !hasRows || !hasSelection;
     document.getElementById("removeAllPermissions").disabled = !hasRows;
   },
 
-  onPermissionDeleted: function ()
-  {
+  onPermissionDeleted() {
     if (!this._view.rowCount)
       return;
     var removedPermissions = [];
     gTreeUtils.deleteSelectedItems(this._tree, this._view, this._permissions, removedPermissions);
     for (var i = 0; i < removedPermissions.length; ++i) {
       var p = removedPermissions[i];
       this._removePermission(p);
     }
     document.getElementById("removePermission").disabled = !this._permissions.length;
     document.getElementById("removeAllPermissions").disabled = !this._permissions.length;
   },
 
-  onAllPermissionsDeleted: function ()
-  {
+  onAllPermissionsDeleted() {
     if (!this._view.rowCount)
       return;
     var removedPermissions = [];
     gTreeUtils.deleteAll(this._tree, this._view, this._permissions, removedPermissions);
     for (var i = 0; i < removedPermissions.length; ++i) {
       var p = removedPermissions[i];
       this._removePermission(p);
     }
     document.getElementById("removePermission").disabled = true;
     document.getElementById("removeAllPermissions").disabled = true;
   },
 
-  onPermissionKeyPress: function (aEvent)
-  {
+  onPermissionKeyPress(aEvent) {
     if (aEvent.keyCode == KeyEvent.DOM_VK_DELETE ||
         ((AppConstants.platform == "macosx") &&
          aEvent.keyCode == KeyEvent.DOM_VK_BACK_SPACE))
       this.onPermissionDeleted();
   },
 
   _lastPermissionSortColumn: "",
   _lastPermissionSortAscending: false,
-  _permissionsComparator : function (a, b)
-  {
+  _permissionsComparator(a, b) {
     return a.toLowerCase().localeCompare(b.toLowerCase());
   },
 
 
-  onPermissionSort: function (aColumn)
-  {
+  onPermissionSort(aColumn) {
     this._lastPermissionSortAscending = gTreeUtils.sort(this._tree,
                                                         this._view,
                                                         this._permissions,
                                                         aColumn,
                                                         this._permissionsComparator,
                                                         this._lastPermissionSortColumn,
                                                         this._lastPermissionSortAscending);
     this._lastPermissionSortColumn = aColumn;
   },
 
-  onApplyChanges: function()
-  {
+  onApplyChanges() {
     // Stop observing permission changes since we are about
     // to write out the pending adds/deletes and don't need
     // to update the UI
     this.uninit();
 
     for (let permissionParams of this._permissionsToAdd.values()) {
       Services.perms.addFromPrincipal(permissionParams.principal, permissionParams.type, permissionParams.capability);
     }
 
     for (let p of this._permissionsToDelete.values()) {
       Services.perms.removeFromPrincipal(p.principal, p.type);
     }
 
     window.close();
   },
 
-  _loadPermissions: function ()
-  {
+  _loadPermissions() {
     this._tree = document.getElementById("permissionsTree");
     this._permissions = [];
 
     // load permissions into a table
     var count = 0;
     var enumerator = Services.perms.enumerator;
     while (enumerator.hasMoreElements()) {
       var nextPermission = enumerator.getNext().QueryInterface(Ci.nsIPermission);
@@ -417,53 +390,48 @@ var gPermissionManager = {
     // sort and display the table
     this._tree.view = this._view;
     this.onPermissionSort("origin");
 
     // disable "remove all" button if there are none
     document.getElementById("removeAllPermissions").disabled = this._permissions.length == 0;
   },
 
-  _addPermissionToList: function (aPermission)
-  {
+  _addPermissionToList(aPermission) {
 
     if (aPermission.type == this._type &&
         (!this._manageCapability ||
          (aPermission.capability == this._manageCapability))) {
 
       var principal = aPermission.principal;
       var capabilityString = this._getCapabilityString(aPermission.capability);
       var p = new Permission(principal,
                              aPermission.type,
                              capabilityString);
       this._permissions.push(p);
     }
   },
 
-  _removePermissionFromList: function (aPrincipal)
-  {
+  _removePermissionFromList(aPrincipal) {
     for (let i = 0; i < this._permissions.length; ++i) {
       // Thunderbird compares origins, not principals here.
       if (this._permissions[i].principal.origin == aPrincipal.origin) {
         this._permissions.splice(i, 1);
         this._view._rowCount--;
         this._tree.treeBoxObject.rowCountChanged(this._view.rowCount - 1, -1);
         this._tree.treeBoxObject.invalidate();
         break;
       }
     }
   },
 
-  setOrigin: function (aOrigin)
-  {
+  setOrigin(aOrigin) {
     document.getElementById("url").value = aOrigin;
-  }
+  },
 };
 
-function setOrigin(aOrigin)
-{
+function setOrigin(aOrigin) {
   gPermissionManager.setOrigin(aOrigin);
 }
 
-function initWithParams(aParams)
-{
+function initWithParams(aParams) {
   gPermissionManager.init(aParams);
 }
--- a/mail/components/preferences/preferences.js
+++ b/mail/components/preferences/preferences.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 ChromeUtils.import("resource:///modules/MailServices.jsm");
 
-window.addEventListener("load", function () {
+window.addEventListener("load", function() {
   let prefWindow = document.getElementById("MailPreferences");
   if (!Services.prefs.getBoolPref("mail.chat.enabled")) {
     let radio =
       document.getAnonymousElementByAttribute(prefWindow, "pane", "paneChat");
     if (radio.selected)
       prefWindow.showPane(document.getElementById("paneGeneral"));
     radio.hidden = true;
   }
--- a/mail/components/preferences/preferencesTab.js
+++ b/mail/components/preferences/preferencesTab.js
@@ -25,40 +25,40 @@ var preferencesTabType = {
     delete this.loadingTabString;
     return this.loadingTabString = document.getElementById("bundle_messenger")
                                            .getString("loadingTab");
   },
 
   modes: {
     preferencesTab: {
       type: "preferencesTab",
-    }
+    },
   },
 
-  initialize: function() {
+  initialize() {
     let tabmail = document.getElementById("tabmail");
     tabmail.registerTabType(this);
   },
 
   shouldSwitchTo: function shouldSwitchTo(aArgs) {
     if (!gPrefTab) {
       return -1;
     }
     let prefWindow = gPrefTab.browser.contentDocument.getElementById("MailPreferences");
     gPrefTab.browser.contentWindow.selectPaneAndTab(prefWindow, aArgs.paneID, aArgs.tabID, aArgs.otherArgs);
     return document.getElementById("tabmail").tabInfo.indexOf(gPrefTab);
   },
 
-  closeTab: function(aTab) {
+  closeTab(aTab) {
     gPrefTab = null;
   },
 
   openTab: function onTabOpened(aTab, aArgs) {
-    if (!"contentPage" in aArgs) {
-      throw("contentPage must be specified");
+    if (!("contentPage" in aArgs)) {
+      throw ("contentPage must be specified");
     }
 
     // First clone the page and set up the basics.
     let clone = document.getElementById("preferencesTab").firstChild
                         .cloneNode(true);
 
     clone.setAttribute("id", "preferencesTab" + this.lastBrowserId);
     clone.setAttribute("collapsed", false);
--- a/mail/components/preferences/privacy.js
+++ b/mail/components/preferences/privacy.js
@@ -1,37 +1,34 @@
 /* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var gPrivacyPane = {
 
-  init: function()
-  {
+  init() {
   },
 
   /**
    * Reload the current message after a preference affecting the view
    * has been changed and we are in instantApply mode.
    */
-  reloadMessageInOpener: function()
-  {
+  reloadMessageInOpener() {
     if (Services.prefs.getBoolPref("browser.preferences.instantApply") &&
         window.opener && typeof(window.opener.ReloadMessage) == "function")
       window.opener.ReloadMessage();
   },
 
   /**
    * Reads the network.cookie.cookieBehavior preference value and
    * enables/disables the rest of the cookie UI accordingly, returning true
    * if cookies are enabled.
    */
-  readAcceptCookies: function()
-  {
+  readAcceptCookies() {
     let pref = document.getElementById("network.cookie.cookieBehavior");
     let acceptThirdPartyLabel = document.getElementById("acceptThirdPartyLabel");
     let acceptThirdPartyMenu = document.getElementById("acceptThirdPartyMenu");
     let keepUntil = document.getElementById("keepUntil");
     let menu = document.getElementById("keepCookiesUntil");
 
     // enable the rest of the UI for anything other than "disable all cookies"
     let acceptCookies = (pref.value != 2);
@@ -43,100 +40,92 @@ var gPrivacyPane = {
   },
 
   /**
    * Enables/disables the "keep until" label and menulist in response to the
    * "accept cookies" checkbox being checked or unchecked.
    * @return 0 if cookies are accepted, 2 if they are not;
    *         the value network.cookie.cookieBehavior should get
    */
-  writeAcceptCookies: function()
-  {
+  writeAcceptCookies() {
     let accept = document.getElementById("acceptCookies");
     let acceptThirdPartyMenu = document.getElementById("acceptThirdPartyMenu");
     // if we're enabling cookies, automatically select 'accept third party always'
     if (accept.checked)
       acceptThirdPartyMenu.selectedIndex = 0;
 
     return accept.checked ? 0 : 2;
   },
 
   /**
    * Displays fine-grained, per-site preferences for cookies.
    */
-  showCookieExceptions: function()
-  {
+  showCookieExceptions() {
     let bundle = document.getElementById("bundlePreferences");
-    let params = { blockVisible   : true,
-                   sessionVisible : true,
-                   allowVisible   : true,
-                   prefilledHost  : "",
-                   permissionType : "cookie",
-                   windowTitle    : bundle.getString("cookiepermissionstitle"),
-                   introText      : bundle.getString("cookiepermissionstext") };
+    let params = { blockVisible: true,
+                   sessionVisible: true,
+                   allowVisible: true,
+                   prefilledHost: "",
+                   permissionType: "cookie",
+                   windowTitle: bundle.getString("cookiepermissionstitle"),
+                   introText: bundle.getString("cookiepermissionstext") };
     gSubDialog.open("chrome://messenger/content/preferences/permissions.xul",
                     null, params);
   },
 
   /**
    * Displays all the user's cookies in a dialog.
    */
-  showCookies: function(aCategory)
-  {
+  showCookies(aCategory) {
     gSubDialog.open("chrome://messenger/content/preferences/cookies.xul");
   },
 
   /**
    * Converts between network.cookie.cookieBehavior and the third-party cookie UI
    */
-  readAcceptThirdPartyCookies: function()
-  {
+  readAcceptThirdPartyCookies() {
     let pref = document.getElementById("network.cookie.cookieBehavior");
-    switch (pref.value)
-    {
+    switch (pref.value) {
       case 0:
         return "always";
       case 1:
         return "never";
       case 2:
         return "never";
       case 3:
         return "visited";
       default:
         return undefined;
     }
   },
 
-  writeAcceptThirdPartyCookies: function()
-  {
+  writeAcceptThirdPartyCookies() {
     let accept = document.getElementById("acceptThirdPartyMenu").selectedItem;
-    switch (accept.value)
-    {
+    switch (accept.value) {
       case "always":
         return 0;
       case "visited":
         return 3;
       case "never":
         return 1;
       default:
         return undefined;
     }
   },
 
   /**
    * Displays fine-grained, per-site preferences for remote content.
    * We use the "image" type for that, but it can also be stylesheets or
    * iframes.
    */
-  showRemoteContentExceptions: function()
-  {
+  showRemoteContentExceptions() {
     let bundle = document.getElementById("bundlePreferences");
-    let params = { blockVisible   : true,
-                   sessionVisible : false,
-                   allowVisible   : true,
-                   prefilledHost  : "",
-                   permissionType : "image",
-                   windowTitle    : bundle.getString("imagepermissionstitle"),
-                   introText      : bundle.getString("imagepermissionstext") };
+    let params = { blockVisible: true,
+                   sessionVisible: false,
+                   allowVisible: true,
+                   prefilledHost: "",
+                   permissionType: "image",
+                   windowTitle: bundle.getString("imagepermissionstitle"),
+                   introText: bundle.getString("imagepermissionstext") };
     gSubDialog.open("chrome://messenger/content/preferences/permissions.xul",
                     null, params);
   },
 };
--- a/mail/components/preferences/security.js
+++ b/mail/components/preferences/security.js
@@ -4,62 +4,56 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.defineModuleGetter(this, "LoginHelper", "resource://gre/modules/LoginHelper.jsm");
 
 var gSecurityPane = {
   mPane: null,
   mInitialized: false,
 
-  init: function ()
-  {
+  init() {
     this.mPane = document.getElementById("paneSecurity");
 
-    this.updateManualMarkMode(document.getElementById('manualMark').checked);
-    this.updateJunkLogButton(document.getElementById('enableJunkLogging').checked);
+    this.updateManualMarkMode(document.getElementById("manualMark").checked);
+    this.updateJunkLogButton(document.getElementById("enableJunkLogging").checked);
 
     this._initMasterPasswordUI();
 
     // update the checkbox for downloading phishing url tables
     // this.updateDownloadedPhishingListState();
 
     if (!(("arguments" in window) && window.arguments[1])) {
       // If no tab was specified, select the last used tab.
       let preference = document.getElementById("mail.preferences.security.selectedTabIndex");
       if (preference.value)
         document.getElementById("securityPrefs").selectedIndex = preference.value;
     }
 
     this.mInitialized = true;
   },
 
-  tabSelectionChanged: function ()
-  {
+  tabSelectionChanged() {
     if (this.mInitialized)
       document.getElementById("mail.preferences.security.selectedTabIndex")
               .valueFromPreferences = document.getElementById("securityPrefs").selectedIndex;
   },
 
-  updateManualMarkMode: function(aEnableRadioGroup)
-  {
-    document.getElementById('manualMarkMode').disabled = !aEnableRadioGroup;
+  updateManualMarkMode(aEnableRadioGroup) {
+    document.getElementById("manualMarkMode").disabled = !aEnableRadioGroup;
   },
 
-  updateJunkLogButton: function(aEnableButton)
-  {
-    document.getElementById('openJunkLogButton').disabled = !aEnableButton;
+  updateJunkLogButton(aEnableButton) {
+    document.getElementById("openJunkLogButton").disabled = !aEnableButton;
   },
 
-  openJunkLog: function()
-  {
+  openJunkLog() {
     gSubDialog.open("chrome://messenger/content/junkLog.xul");
   },
 
-  resetTrainingData: function()
-  {
+  resetTrainingData() {
     // make sure the user really wants to do this
     var bundle = document.getElementById("bundlePreferences");
     var title = bundle.getString("confirmResetJunkTrainingTitle");
     var text = bundle.getString("confirmResetJunkTrainingText");
 
     // if the user says no, then just fall out
     if (!Services.prompt.confirm(window, title, text))
       return;
@@ -68,45 +62,42 @@ var gSecurityPane = {
     MailServices.junk.resetTrainingData();
   },
 
 
   /**
    * Reload the current message after a preference affecting the view
    * has been changed and we are in instantApply mode.
    */
-  reloadMessageInOpener: function()
-  {
-    if(Services.prefs.getBoolPref("browser.preferences.instantApply") &&
+  reloadMessageInOpener() {
+    if (Services.prefs.getBoolPref("browser.preferences.instantApply") &&
        window.opener && typeof(window.opener.ReloadMessage) == "function")
       window.opener.ReloadMessage();
   },
 
   /**
    * Initializes master password UI: the "use master password" checkbox, selects
    * the master password button to show, and enables/disables it as necessary.
    * The master password is controlled by various bits of NSS functionality,
    * so the UI for it can't be controlled by the normal preference bindings.
    */
-  _initMasterPasswordUI: function ()
-  {
+  _initMasterPasswordUI() {
     var noMP = !LoginHelper.isMasterPasswordSet();
 
     document.getElementById("changeMasterPassword").disabled = noMP;
 
     document.getElementById("useMasterPassword").checked = !noMP;
   },
 
   /**
    * Enables/disables the master password button depending on the state of the
    * "use master password" checkbox, and prompts for master password removal
    * if one is set.
    */
-  updateMasterPasswordButton: function ()
-  {
+  updateMasterPasswordButton() {
     var checkbox = document.getElementById("useMasterPassword");
     var button = document.getElementById("changeMasterPassword");
     button.disabled = !checkbox.checked;
 
     // unchecking the checkbox should try to immediately remove the master
     // password, because it's impossible to non-destructively remove the master
     // password used to encrypt all the passwords without providing it (by
     // design), and it would be extremely odd to pop up that dialog when the
@@ -119,49 +110,44 @@ var gSecurityPane = {
     this._initMasterPasswordUI();
   },
 
   /**
    * Displays the "remove master password" dialog to allow the user to remove
    * the current master password.  When the dialog is dismissed, master password
    * UI is automatically updated.
    */
-  _removeMasterPassword: function ()
-  {
+  _removeMasterPassword() {
     var secmodDB = Cc["@mozilla.org/security/pkcs11moduledb;1"].
                    getService(Ci.nsIPKCS11ModuleDB);
     if (secmodDB.isFIPSEnabled) {
       let bundle = document.getElementById("bundleMasterPwPreferences");
       Services.prompt.alert(window,
                             bundle.getString("pw_change_failed_title"),
                             bundle.getString("pw_change2empty_in_fips_mode"));
-    }
-    else {
+    } else {
       gSubDialog.open("chrome://mozapps/content/preferences/removemp.xul",
                       null, null, this._initMasterPasswordUI.bind(this));
     }
     this._initMasterPasswordUI();
   },
 
   /**
    * Displays a dialog in which the master password may be changed.
    */
-  changeMasterPassword: function ()
-  {
+  changeMasterPassword() {
     gSubDialog.open("chrome://mozapps/content/preferences/changemp.xul",
                     null, null, this._initMasterPasswordUI.bind(this));
   },
 
   /**
    * Shows the sites where the user has saved passwords and the associated
    * login information.
    */
-  showPasswords: function ()
-  {
+  showPasswords() {
     gSubDialog.open("chrome://passwordmgr/content/passwordManager.xul");
   },
 
-  updateDownloadedPhishingListState: function()
-  {
-    document.getElementById('useDownloadedList').disabled = !document.getElementById('enablePhishingDetector').checked;
+  updateDownloadedPhishingListState() {
+    document.getElementById("useDownloadedList").disabled = !document.getElementById("enablePhishingDetector").checked;
   },
 
 };
--- a/mail/components/preferences/sendoptions.js
+++ b/mail/components/preferences/sendoptions.js
@@ -5,111 +5,99 @@
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var gSendOptionsDialog = {
   mPrefsBundle: null,
   mHTMLListBox: null,
   mPlainTextListBox: null,
 
-  init: function ()
-  {
-    this.mPrefsBundle = document.getElementById('bundlePreferences');
-    this.mHTMLListBox = document.getElementById('html_domains');
-    this.mPlainTextListBox = document.getElementById('plaintext_domains');
+  init() {
+    this.mPrefsBundle = document.getElementById("bundlePreferences");
+    this.mHTMLListBox = document.getElementById("html_domains");
+    this.mPlainTextListBox = document.getElementById("plaintext_domains");
 
-    var htmlDomainPrefString = document.getElementById('mailnews.html_domains').value;
-    this.loadDomains(document.getElementById('mailnews.html_domains').value,
+    var htmlDomainPrefString = document.getElementById("mailnews.html_domains").value;
+    this.loadDomains(document.getElementById("mailnews.html_domains").value,
                      this.mHTMLListBox);
-    this.loadDomains(document.getElementById('mailnews.plaintext_domains').value,
+    this.loadDomains(document.getElementById("mailnews.plaintext_domains").value,
                      this.mPlainTextListBox);
   },
 
-  saveDomainPref: function(aHTML)
-  {
+  saveDomainPref(aHTML) {
     var listbox = aHTML ? this.mHTMLListBox : this.mPlainTextListBox;
     var num_domains = 0;
     var pref_string = "";
 
-    for (var item = listbox.firstChild; item != null; item = item.nextSibling)
-    {
+    for (var item = listbox.firstChild; item != null; item = item.nextSibling) {
       var domainid = item.firstChild.getAttribute("value");
-      if (domainid.length > 1)
-      {
+      if (domainid.length > 1) {
         num_domains++;
 
         // Separate >1 domains by commas.
         if (num_domains > 1)
           pref_string = pref_string + "," + domainid;
         else
           pref_string = domainid;
       }
     }
 
     return pref_string;
   },
 
-  loadDomains: function (aPrefString, aListBox)
-  {
-    var arrayOfPrefs = aPrefString.split(',');
+  loadDomains(aPrefString, aListBox) {
+    var arrayOfPrefs = aPrefString.split(",");
     if (arrayOfPrefs)
-      for (var i = 0; i < arrayOfPrefs.length; i++)
-      {
-        var str = arrayOfPrefs[i].replace(/ /g,"");
+      for (var i = 0; i < arrayOfPrefs.length; i++) {
+        var str = arrayOfPrefs[i].replace(/ /g, "");
         if (str)
           this.addItemToDomainList(aListBox, str);
       }
   },
 
-  removeDomains: function(aHTML)
-  {
+  removeDomains(aHTML) {
     let listbox = aHTML ? this.mHTMLListBox : this.mPlainTextListBox;
 
     let selectedCount = listbox.selectedItems.length;
     for (let i = selectedCount - 1; i >= 0; i--)
       listbox.selectedItems[i].remove();
 
-    document.getElementById('SendOptionsDialogPane').userChangedValue(listbox);
+    document.getElementById("SendOptionsDialogPane").userChangedValue(listbox);
   },
 
-  addDomain: function (aHTML)
-  {
+  addDomain(aHTML) {
     var listbox = aHTML ? this.mHTMLListBox : this.mPlainTextListBox;
 
     var domainName;
-    var result = {value:null};
-    if (Services.prompt.prompt(window, this.mPrefsBundle.getString(listbox.id + 'AddDomainTitle'),
-                               this.mPrefsBundle.getString(listbox.id + 'AddDomain'), result, null, {value:0}))
-      domainName = result.value.replace(/ /g,"");
+    var result = {value: null};
+    if (Services.prompt.prompt(window, this.mPrefsBundle.getString(listbox.id + "AddDomainTitle"),
+                               this.mPrefsBundle.getString(listbox.id + "AddDomain"), result, null, {value: 0}))
+      domainName = result.value.replace(/ /g, "");
 
-    if (domainName && !this.domainAlreadyPresent(domainName))
-    {
+    if (domainName && !this.domainAlreadyPresent(domainName)) {
       this.addItemToDomainList(listbox, domainName);
-      document.getElementById('SendOptionsDialogPane').userChangedValue(listbox);
+      document.getElementById("SendOptionsDialogPane").userChangedValue(listbox);
     }
 
   },
 
-  domainAlreadyPresent: function(aDomainName)
-  {
+  domainAlreadyPresent(aDomainName) {
     let matchingDomains = this.mHTMLListBox.querySelectorAll('[value="' + aDomainName + '"]');
 
     if (!matchingDomains.length)
       matchingDomains = this.mPlainTextListBox.querySelectorAll('[value="' + aDomainName + '"]');
 
-    if (matchingDomains.length)
-    {
-      Services.prompt.alert(window, this.mPrefsBundle.getString('domainNameErrorTitle'),
+    if (matchingDomains.length) {
+      Services.prompt.alert(window, this.mPrefsBundle.getString("domainNameErrorTitle"),
                             this.mPrefsBundle.getFormattedString("domainDuplicationError", [aDomainName]));
     }
 
     return matchingDomains.length;
   },
 
-  addItemToDomainList: function (aListBox, aDomainTitle)
-  {
+  addItemToDomainList(aListBox, aDomainTitle) {
     let label = document.createElement("label");
     label.setAttribute("value", aDomainTitle);
     let item = document.createElement("richlistitem");
     item.appendChild(label);
     aListBox.appendChild(item);
-  }
+  },
 };