Bug 1577835 - Reformat mail/ code with eslint and Prettier. r=mkmelin
authorPaul Morris <paul@thunderbird.net>
Fri, 30 Aug 2019 16:19:44 -0400
changeset 36571 883449e17f9dc912d4f5487faac540db61850ca1
parent 36570 81f2db384ad958a0a98b3a1398fc359670dc6016
child 36572 c9b6c0d8e2d2663afb3ef0492a581916e7a8b094
push id394
push userclokep@gmail.com
push dateMon, 21 Oct 2019 20:22:01 +0000
reviewersmkmelin
bugs1577835
Bug 1577835 - Reformat mail/ code with eslint and Prettier. r=mkmelin # ignore-this-changeset These changes were achieved by: 1. Using eslint to add curly brackets to control statements that did not have them (if, else, etc.), thanks to the eslint rule: "curly": ["error", "all"] Done by running |mach eslint mail/ --fix| 2. Reformatting the code using Prettier. Done by deleting the mail/ line from the .prettierignore file and running: |mach eslint mail/ --fix|
.prettierignore
mail/base/content/ABSearchDialog.js
mail/base/content/FilterListDialog.js
mail/base/content/SearchDialog.js
mail/base/content/aboutAddonsExtra.js
mail/base/content/aboutDialog-appUpdater.js
mail/base/content/aboutDialog.js
mail/base/content/browserRequest.js
mail/base/content/button-menu-button.js
mail/base/content/commandglue.js
mail/base/content/contentAreaClick.js
mail/base/content/customElements.js
mail/base/content/editContactPanel.js
mail/base/content/folderDisplay.js
mail/base/content/folderPane.js
mail/base/content/foldersummary.js
mail/base/content/glodaFacet.js
mail/base/content/glodaFacetTab.js
mail/base/content/glodaFacetView.js
mail/base/content/glodaFacetVis.js
mail/base/content/hiddenWindow.js
mail/base/content/macMessengerMenu.js
mail/base/content/mail-offline.js
mail/base/content/mail3PaneWindowCommands.js
mail/base/content/mailCommands.js
mail/base/content/mailContextMenus.js
mail/base/content/mailCore.js
mail/base/content/mailTabs.js
mail/base/content/mailWidgets.js
mail/base/content/mailWindow.js
mail/base/content/mailWindowOverlay.js
mail/base/content/messageDisplay.js
mail/base/content/messageWindow.js
mail/base/content/messenger-customization.js
mail/base/content/msgHdrView.js
mail/base/content/msgMail3PaneWindow.js
mail/base/content/msgViewNavigation.js
mail/base/content/multimessageview.js
mail/base/content/newTagDialog.js
mail/base/content/nsContextMenu.js
mail/base/content/nsDragAndDrop.js
mail/base/content/phishingDetector.js
mail/base/content/profileDowngrade.js
mail/base/content/quickFilterBar.js
mail/base/content/safeMode.js
mail/base/content/sanitize.js
mail/base/content/sanitizeDialog.js
mail/base/content/searchBar.js
mail/base/content/selectionsummaries.js
mail/base/content/specialTabs.js
mail/base/content/statuspanel.js
mail/base/content/systemIntegrationDialog.js
mail/base/content/tabbrowser-tab.js
mail/base/content/tabmail-tabs.js
mail/base/content/tabmail.js
mail/base/content/threadPane.js
mail/base/content/toolbarIconColor.js
mail/base/content/toolbarbutton-menu-button.js
mail/base/content/utilityOverlay.js
mail/base/modules/AppUpdateUI.jsm
mail/base/modules/AttachmentChecker.jsm
mail/base/modules/DBViewWrapper.jsm
mail/base/modules/DNS.jsm
mail/base/modules/DisplayNameUtils.jsm
mail/base/modules/ExtensionsUI.jsm
mail/base/modules/GlobalPopupNotifications.jsm
mail/base/modules/MailInstrumentation.jsm
mail/base/modules/MailMigrator.jsm
mail/base/modules/MailUtils.jsm
mail/base/modules/MailViewManager.jsm
mail/base/modules/MessageArchiver.jsm
mail/base/modules/MsgHdrSyntheticView.jsm
mail/base/modules/QuickFilterManager.jsm
mail/base/modules/SearchSpec.jsm
mail/base/modules/SessionStoreManager.jsm
mail/base/modules/SummaryFrameManager.jsm
mail/base/modules/TBDistCustomizer.jsm
mail/base/modules/TagUtils.jsm
mail/base/modules/ThemeVariableMap.jsm
mail/base/modules/Windows8WindowFrameColor.jsm
mail/base/test/browser/browser_menulist.js
mail/base/test/unit/head_mailbase.js
mail/base/test/unit/head_mailbase_maildir.js
mail/base/test/unit/resources/viewWrapperTestUtils.js
mail/base/test/unit/test_alertHook.js
mail/base/test/unit/test_attachmentChecker.js
mail/base/test/unit/test_emptyTrash_dbViewWrapper.js
mail/base/test/unit/test_mailGlue_distribution.js
mail/base/test/unit/test_viewWrapper_imapFolder.js
mail/base/test/unit/test_viewWrapper_logic.js
mail/base/test/unit/test_viewWrapper_realFolder.js
mail/base/test/unit/test_viewWrapper_virtualFolder.js
mail/base/test/unit/test_viewWrapper_virtualFolderCustomTerm.js
mail/base/test/unit/test_windows_font_migration.js
mail/components/about-support/aboutSupportUnix.js
mail/components/about-support/aboutSupportWin32.js
mail/components/about-support/content/aboutSupport.js
mail/components/about-support/content/accounts.js
mail/components/about-support/content/export.js
mail/components/aboutRedirector.js
mail/components/accountcreation/content/MyBadCertHandler.js
mail/components/accountcreation/content/accountConfig.js
mail/components/accountcreation/content/createInBackend.js
mail/components/accountcreation/content/emailWizard.js
mail/components/accountcreation/content/exchangeAutoDiscover.js
mail/components/accountcreation/content/fetchConfig.js
mail/components/accountcreation/content/fetchhttp.js
mail/components/accountcreation/content/guessConfig.js
mail/components/accountcreation/content/readFromXML.js
mail/components/accountcreation/content/sanitizeDatatypes.js
mail/components/accountcreation/content/util.js
mail/components/accountcreation/content/verifyConfig.js
mail/components/activity/content/activity-widgets.js
mail/components/activity/content/activity.js
mail/components/activity/modules/activityModules.jsm
mail/components/activity/modules/alertHook.jsm
mail/components/activity/modules/autosync.jsm
mail/components/activity/modules/glodaIndexer.jsm
mail/components/activity/modules/moveCopy.jsm
mail/components/activity/modules/pop3Download.jsm
mail/components/activity/modules/sendLater.jsm
mail/components/activity/nsActivity.js
mail/components/activity/nsActivityManager.js
mail/components/activity/nsActivityManagerUI.js
mail/components/addrbook/content/abCard.js
mail/components/addrbook/content/abCardView.js
mail/components/addrbook/content/abCommon.js
mail/components/addrbook/content/abContactsPanel.js
mail/components/addrbook/content/abTrees.js
mail/components/addrbook/content/addressbook.js
mail/components/addrbook/content/menulist-addrbooks.js
mail/components/appIdleManager.js
mail/components/cloudfile/cloudFileAccounts.jsm
mail/components/cloudfile/content/selectDialog.js
mail/components/cloudfile/test/browser/browser_repeat_upload.js
mail/components/cloudfile/test/browser/head.js
mail/components/cloudfile/wetransfer/background/background.js
mail/components/compose/content/MsgComposeCommands.js
mail/components/compose/content/addressingWidgetOverlay.js
mail/components/compose/content/bigFileObserver.js
mail/components/compose/content/cloudAttachmentLinkManager.js
mail/components/customizableui/CustomizableUI.jsm
mail/components/customizableui/CustomizableWidgets.jsm
mail/components/customizableui/CustomizeMode.jsm
mail/components/customizableui/DragPositionManager.jsm
mail/components/customizableui/PanelMultiView.jsm
mail/components/customizableui/SearchWidgetTracker.jsm
mail/components/customizableui/content/panelUI.js
mail/components/devtools/devtools-loader.js
mail/components/devtools/tb-root-actor.js
mail/components/downloads/content/aboutDownloads.js
mail/components/enterprisepolicies/Policies.jsm
mail/components/enterprisepolicies/content/aboutPolicies.js
mail/components/enterprisepolicies/helpers/ProxyPolicies.jsm
mail/components/enterprisepolicies/tests/browser/browser_policies_setAndLockPref_API.js
mail/components/enterprisepolicies/tests/browser/browser_policy_app_update.js
mail/components/enterprisepolicies/tests/browser/browser_policy_block_about_addons.js
mail/components/enterprisepolicies/tests/browser/browser_policy_block_about_config.js
mail/components/enterprisepolicies/tests/browser/browser_policy_block_about_profiles.js
mail/components/enterprisepolicies/tests/browser/browser_policy_block_about_support.js
mail/components/enterprisepolicies/tests/browser/browser_policy_disable_masterpassword.js
mail/components/enterprisepolicies/tests/browser/browser_policy_extensionsettings.js
mail/components/enterprisepolicies/tests/browser/disable_app_update/browser_policy_disable_app_update.js
mail/components/enterprisepolicies/tests/browser/disable_developer_tools/browser_policy_disable_developer_tools.js
mail/components/enterprisepolicies/tests/browser/head.js
mail/components/enterprisepolicies/tests/xpcshell/head.js
mail/components/enterprisepolicies/tests/xpcshell/test_appupdateurl.js
mail/components/enterprisepolicies/tests/xpcshell/test_macosparser_unflatten.js
mail/components/enterprisepolicies/tests/xpcshell/test_preferences.js
mail/components/enterprisepolicies/tests/xpcshell/test_proxy.js
mail/components/enterprisepolicies/tests/xpcshell/test_requestedlocales.js
mail/components/enterprisepolicies/tests/xpcshell/test_runOnce_helper.js
mail/components/enterprisepolicies/tests/xpcshell/test_simple_pref_policies.js
mail/components/enterprisepolicies/tests/xpcshell/test_sorted_alphabetically.js
mail/components/extensions/ExtensionPopups.jsm
mail/components/extensions/ExtensionToolbarButtons.jsm
mail/components/extensions/child/ext-mail.js
mail/components/extensions/child/ext-menus-child.js
mail/components/extensions/child/ext-menus.js
mail/components/extensions/child/ext-tabs.js
mail/components/extensions/parent/ext-accounts.js
mail/components/extensions/parent/ext-addressBook.js
mail/components/extensions/parent/ext-browserAction.js
mail/components/extensions/parent/ext-chrome-settings-overrides.js
mail/components/extensions/parent/ext-cloudFile.js
mail/components/extensions/parent/ext-compose.js
mail/components/extensions/parent/ext-composeAction.js
mail/components/extensions/parent/ext-folders.js
mail/components/extensions/parent/ext-legacy.js
mail/components/extensions/parent/ext-mail.js
mail/components/extensions/parent/ext-mailTabs.js
mail/components/extensions/parent/ext-menus.js
mail/components/extensions/parent/ext-messages.js
mail/components/extensions/parent/ext-tabs.js
mail/components/extensions/parent/ext-windows.js
mail/components/extensions/test/browser/browser_ext_addressBooksUI.js
mail/components/extensions/test/browser/browser_ext_browserAction.js
mail/components/extensions/test/browser/browser_ext_commands_execute_browser_action.js
mail/components/extensions/test/browser/browser_ext_commands_getAll.js
mail/components/extensions/test/browser/browser_ext_commands_onCommand.js
mail/components/extensions/test/browser/browser_ext_commands_update.js
mail/components/extensions/test/browser/browser_ext_composeAction.js
mail/components/extensions/test/browser/browser_ext_mailTabs.js
mail/components/extensions/test/browser/browser_ext_menus.js
mail/components/extensions/test/browser/browser_ext_quickFilter.js
mail/components/extensions/test/browser/browser_ext_windows.js
mail/components/extensions/test/browser/head.js
mail/components/extensions/test/xpcshell/head.js
mail/components/extensions/test/xpcshell/test_ext_accounts.js
mail/components/extensions/test/xpcshell/test_ext_addressBook.js
mail/components/extensions/test/xpcshell/test_ext_alias.js
mail/components/extensions/test/xpcshell/test_ext_cloudFile.js
mail/components/extensions/test/xpcshell/test_ext_experiments.js
mail/components/extensions/test/xpcshell/test_ext_folders.js
mail/components/extensions/test/xpcshell/test_ext_messages.js
mail/components/extensions/test/xpcshell/test_ext_messages_query.js
mail/components/im/content/addbuddy.js
mail/components/im/content/am-im.js
mail/components/im/content/chat-contact.js
mail/components/im/content/chat-conversation-info.js
mail/components/im/content/chat-conversation.js
mail/components/im/content/chat-group.js
mail/components/im/content/chat-imconv.js
mail/components/im/content/chat-messenger.js
mail/components/im/content/imAccountWizard.js
mail/components/im/content/imAccounts.js
mail/components/im/content/imContextMenu.js
mail/components/im/content/imStatusSelector.js
mail/components/im/content/joinchat.js
mail/components/im/content/toolbarbutton-badge-button.js
mail/components/im/imIncomingServer.js
mail/components/im/imProtocolInfo.js
mail/components/im/messages/bubbles/Footer.html
mail/components/im/messages/dark/Footer.html
mail/components/im/messages/mail/Footer.html
mail/components/im/messages/papersheets/Footer.html
mail/components/im/modules/chatHandler.jsm
mail/components/im/modules/chatNotifications.jsm
mail/components/im/modules/index_im.jsm
mail/components/im/modules/search_im.jsm
mail/components/mailContentHandler.js
mail/components/mailGlue.js
mail/components/migration/content/migration.js
mail/components/newmailaccount/content/accountProvisioner.js
mail/components/newmailaccount/content/accountProvisionerTab.js
mail/components/newmailaccount/content/uriListener.js
mail/components/nsMailDefaultHandler.js
mail/components/preferences/actionsshared.js
mail/components/preferences/applicationManager.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/downloads.js
mail/components/preferences/fonts.js
mail/components/preferences/general.js
mail/components/preferences/messagestyle.js
mail/components/preferences/messengerLanguages.js
mail/components/preferences/notifications.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/receipts.js
mail/components/preferences/sendoptions.js
mail/components/preferences/subdialogs.js
mail/components/preferences/test/browser/browser_chat.js
mail/components/preferences/test/browser/browser_cloudfile.js
mail/components/preferences/test/browser/browser_compose.js
mail/components/preferences/test/browser/browser_general.js
mail/components/preferences/test/browser/browser_openPreferences.js
mail/components/preferences/test/browser/browser_privacy.js
mail/components/preferences/test/browser/browser_security.js
mail/components/preferences/test/browser/head.js
mail/components/search/SearchIntegration.jsm
mail/components/search/content/SpotlightIntegration.js
mail/components/search/content/WinSearchIntegration.js
mail/components/shell/nsSetDefaultMail.js
mail/components/test/unit/head_mailcomponents.js
mail/components/test/unit/test_about_support.js
mail/components/test/unit/test_autoconfigFetchDisk.js
mail/components/test/unit/test_autoconfigUtils.js
mail/components/test/unit/test_autoconfigXML.js
mail/components/wintaskbar/windowsJumpLists.js
mail/extensions/mailviews/content/mailViewList.js
mail/extensions/mailviews/content/mailViewSetup.js
mail/extensions/mailviews/content/msgViewPickerOverlay.js
mail/extensions/smime/content/msgCompSMIMEOverlay.js
mail/extensions/smime/content/msgHdrViewSMIMEOverlay.js
mail/test/mozmill/account/test-ab-whitelist.js
mail/test/mozmill/account/test-account-actions.js
mail/test/mozmill/account/test-account-deletion.js
mail/test/mozmill/account/test-account-port-setting.js
mail/test/mozmill/account/test-account-settings-infrastructure.js
mail/test/mozmill/account/test-account-tree.js
mail/test/mozmill/account/test-account-values.js
mail/test/mozmill/account/test-archive-options.js
mail/test/mozmill/account/test-mail-account-setup-wizard.js
mail/test/mozmill/account/test-retest-config.js
mail/test/mozmill/addrbook/test-address-book-panes.js
mail/test/mozmill/addrbook/test-address-book.js
mail/test/mozmill/addrbook/test-update-mailing-list.js
mail/test/mozmill/attachment/test-attachment-events.js
mail/test/mozmill/attachment/test-attachment-in-plain-msg.js
mail/test/mozmill/attachment/test-attachment-menus.js
mail/test/mozmill/attachment/test-attachment-size.js
mail/test/mozmill/attachment/test-attachment.js
mail/test/mozmill/cloudfile/test-cloudfile-attachment-item.js
mail/test/mozmill/cloudfile/test-cloudfile-attachment-urls.js
mail/test/mozmill/cloudfile/test-cloudfile-manager.js
mail/test/mozmill/cloudfile/test-cloudfile-notifications.js
mail/test/mozmill/composition/test-address-widgets.js
mail/test/mozmill/composition/test-attachment-reminder.js
mail/test/mozmill/composition/test-attachment.js
mail/test/mozmill/composition/test-base64-display.js
mail/test/mozmill/composition/test-blocked-content.js
mail/test/mozmill/composition/test-charset-edit.js
mail/test/mozmill/composition/test-charset-upgrade.js
mail/test/mozmill/composition/test-cp932-display.js
mail/test/mozmill/composition/test-draft-identity.js
mail/test/mozmill/composition/test-drafts.js
mail/test/mozmill/composition/test-eml-actions.js
mail/test/mozmill/composition/test-focus.js
mail/test/mozmill/composition/test-forward-headers.js
mail/test/mozmill/composition/test-forward-rfc822-attach.js
mail/test/mozmill/composition/test-forward-utf8.js
mail/test/mozmill/composition/test-forwarded-content.js
mail/test/mozmill/composition/test-forwarded-eml-actions.js
mail/test/mozmill/composition/test-image-display.js
mail/test/mozmill/composition/test-image-insertion-dialog.js
mail/test/mozmill/composition/test-multipart-related.js
mail/test/mozmill/composition/test-newmsg-compose-identity.js
mail/test/mozmill/composition/test-reply-addresses.js
mail/test/mozmill/composition/test-reply-format-flowed.js
mail/test/mozmill/composition/test-reply-multipart-charset.js
mail/test/mozmill/composition/test-reply-signature.js
mail/test/mozmill/composition/test-save-changes-on-quit.js
mail/test/mozmill/composition/test-send-button.js
mail/test/mozmill/composition/test-send-format.js
mail/test/mozmill/composition/test-signature-init.js
mail/test/mozmill/composition/test-signature-updating.js
mail/test/mozmill/content-policy/test-compose-mailto.js
mail/test/mozmill/content-policy/test-dns-prefetch.js
mail/test/mozmill/content-policy/test-exposed-in-content-tabs.js
mail/test/mozmill/content-policy/test-general-content-policy.js
mail/test/mozmill/content-policy/test-js-content-policy.js
mail/test/mozmill/content-policy/test-plugins-policy.js
mail/test/mozmill/content-policy/test-view-source.js
mail/test/mozmill/content-tabs/test-about-support.js
mail/test/mozmill/content-tabs/test-addons-mgr.js
mail/test/mozmill/content-tabs/test-content-tab.js
mail/test/mozmill/content-tabs/test-install-xpi.js
mail/test/mozmill/cookies/test-cookies.js
mail/test/mozmill/downloads/test-about-downloads.js
mail/test/mozmill/folder-display/test-close-window-on-delete.js
mail/test/mozmill/folder-display/test-columns.js
mail/test/mozmill/folder-display/test-deletion-from-virtual-folders.js
mail/test/mozmill/folder-display/test-deletion-with-multiple-displays.js
mail/test/mozmill/folder-display/test-display-name.js
mail/test/mozmill/folder-display/test-displaying-messages-in-folder-tabs.js
mail/test/mozmill/folder-display/test-folder-pane-visibility.js
mail/test/mozmill/folder-display/test-folder-toolbar.js
mail/test/mozmill/folder-display/test-invalid-db-folder-load.js
mail/test/mozmill/folder-display/test-mail-views.js
mail/test/mozmill/folder-display/test-message-commands-on-msgstore.js
mail/test/mozmill/folder-display/test-message-commands.js
mail/test/mozmill/folder-display/test-message-pane-visibility.js
mail/test/mozmill/folder-display/test-message-reloads.js
mail/test/mozmill/folder-display/test-message-size.js
mail/test/mozmill/folder-display/test-message-window.js
mail/test/mozmill/folder-display/test-opening-messages-without-a-backing-view.js
mail/test/mozmill/folder-display/test-opening-messages.js
mail/test/mozmill/folder-display/test-pane-focus.js
mail/test/mozmill/folder-display/test-recent-menu.js
mail/test/mozmill/folder-display/test-right-click-middle-click-folders.js
mail/test/mozmill/folder-display/test-right-click-middle-click-messages.js
mail/test/mozmill/folder-display/test-savedsearch-reload-after-compact.js
mail/test/mozmill/folder-display/test-selection.js
mail/test/mozmill/folder-display/test-summarization.js
mail/test/mozmill/folder-display/test-virtual-folder-commands.js
mail/test/mozmill/folder-display/test-watch-ignore-thread.js
mail/test/mozmill/folder-pane/test-display-message-with-folder-modes.js
mail/test/mozmill/folder-pane/test-folder-names-in-recent-mode.js
mail/test/mozmill/folder-pane/test-folder-pane-consumers.js
mail/test/mozmill/folder-pane/test-folder-pane.js
mail/test/mozmill/folder-tree-modes/test-custom-folder-tree-mode.js
mail/test/mozmill/folder-tree-modes/test-custom-smart-folder.js
mail/test/mozmill/folder-tree-modes/test-extension/bootstrap.js
mail/test/mozmill/folder-tree-modes/test-mode-switching.js
mail/test/mozmill/folder-tree-modes/test-smart-folders.js
mail/test/mozmill/folder-tree-modes/test-unread-folders.js
mail/test/mozmill/folder-widget/test-message-filters.js
mail/test/mozmill/im/test-chat-tab-restore.js
mail/test/mozmill/im/test-toolbar-buttons.js
mail/test/mozmill/instrumentation/test-instrument-setup.js
mail/test/mozmill/junk-commands/test-junk-commands.js
mail/test/mozmill/keyboard/test-spacehit.js
mail/test/mozmill/message-header/test-message-header.js
mail/test/mozmill/message-header/test-phishing-bar.js
mail/test/mozmill/message-header/test-reply-identity.js
mail/test/mozmill/message-header/test-reply-to-list-from-address-selection.js
mail/test/mozmill/message-header/test-return-receipt.js
mail/test/mozmill/message-reader/test-bug594646.js
mail/test/mozmill/message-window/test-autohide-menubar.js
mail/test/mozmill/message-window/test-commands.js
mail/test/mozmill/message-window/test-eml-subject.js
mail/test/mozmill/message-window/test-message-sidebar.js
mail/test/mozmill/message-window/test-vcard-actions.js
mail/test/mozmill/message-window/test-view-plaintext.js
mail/test/mozmill/multiple-identities/test-display-names.js
mail/test/mozmill/newmailaccount/test-newmailaccount.js
mail/test/mozmill/notification/test-notification.js
mail/test/mozmill/override-main-menu-collapse/test-override-mainmenu-collapse.js
mail/test/mozmill/pref-window/test-font-chooser.js
mail/test/mozmill/quick-filter-bar/test-display-issues.js
mail/test/mozmill/quick-filter-bar/test-filter-logic.js
mail/test/mozmill/quick-filter-bar/test-keyboard-interface.js
mail/test/mozmill/quick-filter-bar/test-sticky-filter-logic.js
mail/test/mozmill/quick-filter-bar/test-toggle-bar.js
mail/test/mozmill/search-window/test-search-window.js
mail/test/mozmill/session-store/test-session-store.js
mail/test/mozmill/shared-modules/test-account-manager-helpers.js
mail/test/mozmill/shared-modules/test-address-book-helpers.js
mail/test/mozmill/shared-modules/test-attachment-helpers.js
mail/test/mozmill/shared-modules/test-cloudfile-backend-helpers.js
mail/test/mozmill/shared-modules/test-cloudfile-helpers.js
mail/test/mozmill/shared-modules/test-compose-helpers.js
mail/test/mozmill/shared-modules/test-content-tab-helpers.js
mail/test/mozmill/shared-modules/test-customization-helpers.js
mail/test/mozmill/shared-modules/test-dom-helpers.js
mail/test/mozmill/shared-modules/test-folder-display-helpers.js
mail/test/mozmill/shared-modules/test-junk-helpers.js
mail/test/mozmill/shared-modules/test-keyboard-helpers.js
mail/test/mozmill/shared-modules/test-message-helpers.js
mail/test/mozmill/shared-modules/test-mock-object-helpers.js
mail/test/mozmill/shared-modules/test-mouse-event-helpers.js
mail/test/mozmill/shared-modules/test-newmailaccount-helpers.js
mail/test/mozmill/shared-modules/test-nntp-helpers.js
mail/test/mozmill/shared-modules/test-notificationbox-helpers.js
mail/test/mozmill/shared-modules/test-observer-helpers.js
mail/test/mozmill/shared-modules/test-pref-window-helpers.js
mail/test/mozmill/shared-modules/test-prompt-helpers.js
mail/test/mozmill/shared-modules/test-quick-filter-bar-helpers.js
mail/test/mozmill/shared-modules/test-search-window-helpers.js
mail/test/mozmill/shared-modules/test-subscribe-window-helpers.js
mail/test/mozmill/shared-modules/test-window-helpers.js
mail/test/mozmill/startup-firstrun/test-menubar-collapsed.js
mail/test/mozmill/subscribe/test-subscribe-news-filter.js
mail/test/mozmill/tabmail/test-tabmail-closing.js
mail/test/mozmill/tabmail/test-tabmail-customize.js
mail/test/mozmill/tabmail/test-tabmail-dragndrop.js
mail/test/mozmill/utils/html/collections.html
mail/test/mozmill/utils/test-extensionSupport.js
mail/test/mozmill/utils/test-iteratorUtils.js
mail/test/resources/jsbridge/jsbridge/extension/bootstrap.js
mail/test/resources/jsbridge/jsbridge/extension/chrome/content/modules/server.js
mail/test/resources/jsbridge/jsbridge/extension/chrome/content/overlay.js
mail/test/resources/jsbridge/jsbridge/extension/components/cmdarg.js
mail/test/resources/mozmill/mozmill/extension/bootstrap.js
mail/test/resources/mozmill/mozmill/extension/content/modules/controller.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/elementslib.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/events.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/frame.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/init.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/jum.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/mozmill.jsm
mail/test/resources/mozmill/mozmill/extension/content/modules/utils.jsm
mail/test/resources/mozmill/mozmill/extension/content/overlay.js
mail/test/resources/mozmill/mozmill/extension/content/stdlib/EventUtils.jsm
mail/test/resources/mozmill/mozmill/extension/content/stdlib/dom.jsm
mail/test/resources/mozmill/mozmill/extension/content/stdlib/httpd.jsm
mail/test/resources/mozmill/mozmill/extension/content/stdlib/os.jsm
mail/test/resources/mozmill/mozmill/extension/content/stdlib/securable-module.jsm
--- a/.prettierignore
+++ b/.prettierignore
@@ -6,11 +6,10 @@
 *.xhtml
 *.xul
 *.xml
 
 # Ignore .eslintrc.js for now.
 .eslintrc.js
 
 # Ignore all top-level directories that contain JS files (for now).
-mail/**
 mailnews/**
 suite/**
--- a/mail/base/content/ABSearchDialog.js
+++ b/mail/base/content/ABSearchDialog.js
@@ -7,20 +7,26 @@
 /* import-globals-from ../../../mailnews/base/content/dateFormat.js */
 /* import-globals-from ../../../mailnews/base/search/content/searchTerm.js */
 /* import-globals-from ../../components/addrbook/content/abCommon.js */
 /* import-globals-from commandglue.js */
 /* import-globals-from mailWindow.js */
 /* import-globals-from msgMail3PaneWindow.js */
 /* import-globals-from nsDragAndDrop.js */
 
-var { encodeABTermValue } = ChromeUtils.import("resource:///modules/ABQueryUtils.jsm");
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
-var {PluralForm} = ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
+var { encodeABTermValue } = ChromeUtils.import(
+  "resource:///modules/ABQueryUtils.jsm"
+);
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
+var { PluralForm } = ChromeUtils.import(
+  "resource://gre/modules/PluralForm.jsm"
+);
 
 var searchSessionContractID = "@mozilla.org/messenger/searchSession;1";
 var gSearchSession;
 
 var nsMsgSearchScope = Ci.nsMsgSearchScope;
 var nsIMsgSearchTerm = Ci.nsIMsgSearchTerm;
 var nsMsgSearchOp = Ci.nsMsgSearchOp;
 var nsMsgSearchAttrib = Ci.nsMsgSearchAttrib;
@@ -40,48 +46,60 @@ var gSearchAbViewListener = {
   onSelectionChanged() {
     UpdateCardView();
   },
   onCountChanged(aTotal) {
     let statusText;
     if (aTotal == 0) {
       statusText = gAddressBookBundle.getString("noMatchFound");
     } else {
-      statusText = PluralForm
-        .get(aTotal, gAddressBookBundle.getString("matchesFound1"))
-        .replace("#1", aTotal);
+      statusText = PluralForm.get(
+        aTotal,
+        gAddressBookBundle.getString("matchesFound1")
+      ).replace("#1", aTotal);
     }
 
     gStatusText.setAttribute("label", statusText);
   },
 };
 
 function searchOnLoad() {
   initializeSearchWidgets();
   initializeSearchWindowWidgets();
 
   gSearchBundle = document.getElementById("bundle_search");
-  gSearchStopButton.setAttribute("label", gSearchBundle.getString("labelForSearchButton"));
-  gSearchStopButton.setAttribute("accesskey", gSearchBundle.getString("labelForSearchButton.accesskey"));
+  gSearchStopButton.setAttribute(
+    "label",
+    gSearchBundle.getString("labelForSearchButton")
+  );
+  gSearchStopButton.setAttribute(
+    "accesskey",
+    gSearchBundle.getString("labelForSearchButton.accesskey")
+  );
   gAddressBookBundle = document.getElementById("bundle_addressBook");
-  gSearchSession = Cc[searchSessionContractID].createInstance(Ci.nsIMsgSearchSession);
+  gSearchSession = Cc[searchSessionContractID].createInstance(
+    Ci.nsIMsgSearchSession
+  );
 
   // initialize a flag for phonetic name search
-  gSearchPhoneticName =
-        Services.prefs.getComplexValue("mail.addr_book.show_phonetic_fields",
-                                       Ci.nsIPrefLocalizedString).data;
+  gSearchPhoneticName = Services.prefs.getComplexValue(
+    "mail.addr_book.show_phonetic_fields",
+    Ci.nsIPrefLocalizedString
+  ).data;
 
   // Initialize globals, see abCommon.js , InitCommonJS()
   abList = document.getElementById("abPopup");
 
-  if (window.arguments && window.arguments[0])
+  if (window.arguments && window.arguments[0]) {
     SelectDirectory(window.arguments[0].directory);
-  else
-    SelectDirectory(document.getElementById("abPopup-menupopup")
-                            .firstChild.value);
+  } else {
+    SelectDirectory(
+      document.getElementById("abPopup-menupopup").firstChild.value
+    );
+  }
 
   onMore(null);
 }
 
 function searchOnUnload() {
   CloseAbView();
 }
 
@@ -97,159 +115,188 @@ function initializeSearchWindowWidgets()
   gComposeCmd = document.getElementById("cmd_compose");
   gDeleteCmd = document.getElementById("cmd_deleteCard");
   gStatusText = document.getElementById("statusText");
   disableCommands();
   // matchAll doesn't make sense for address book search
   hideMatchAllItem();
 }
 
-function onSearchStop() {
-}
+function onSearchStop() {}
 
 function onAbSearchReset(event) {
   disableCommands();
   CloseAbView();
 
   onReset(event);
   gStatusText.setAttribute("label", "");
 }
 
 function SelectDirectory(aURI) {
   var selectedAB = aURI;
 
-  if (!selectedAB)
+  if (!selectedAB) {
     selectedAB = kPersonalAddressbookURI;
+  }
 
   // set popup with address book names
   var abPopup = document.getElementById("abPopup");
-  if (abPopup)
+  if (abPopup) {
     abPopup.value = selectedAB;
+  }
 
   setSearchScope(GetScopeForDirectoryURI(selectedAB));
 }
 
 function GetScopeForDirectoryURI(aURI) {
   var directory = MailServices.ab.getDirectory(aURI);
   var booleanAnd = gSearchBooleanRadiogroup.selectedItem.value == "and";
 
   if (directory.isRemote) {
-    if (booleanAnd)
+    if (booleanAnd) {
       return nsMsgSearchScope.LDAPAnd;
+    }
     return nsMsgSearchScope.LDAP;
   }
 
   if (booleanAnd) {
     return nsMsgSearchScope.LocalABAnd;
   }
   return nsMsgSearchScope.LocalAB;
 }
 
 function onEnterInSearchTerm() {
   // on enter
   // if not searching, start the search
   // if searching, stop and then start again
-  if (gSearchStopButton.getAttribute("label") == gSearchBundle.getString("labelForSearchButton")) {
-     onSearch();
+  if (
+    gSearchStopButton.getAttribute("label") ==
+    gSearchBundle.getString("labelForSearchButton")
+  ) {
+    onSearch();
   } else {
-     onSearchStop();
-     onSearch();
+    onSearchStop();
+    onSearch();
   }
 }
 
 function onSearch() {
-    gStatusText.setAttribute("label", "");
-    disableCommands();
+  gStatusText.setAttribute("label", "");
+  disableCommands();
 
-    gSearchSession.clearScopes();
+  gSearchSession.clearScopes();
 
-    var currentAbURI = document.getElementById("abPopup").getAttribute("value");
+  var currentAbURI = document.getElementById("abPopup").getAttribute("value");
 
-    gSearchSession.addDirectoryScopeTerm(GetScopeForDirectoryURI(currentAbURI));
-    saveSearchTerms(gSearchSession.searchTerms, gSearchSession);
+  gSearchSession.addDirectoryScopeTerm(GetScopeForDirectoryURI(currentAbURI));
+  saveSearchTerms(gSearchSession.searchTerms, gSearchSession);
 
-    var searchUri = currentAbURI + "?(";
-    for (let i = 0; i < gSearchSession.searchTerms.length; i++) {
-      let searchTerm = gSearchSession.searchTerms.queryElementAt(i, nsIMsgSearchTerm);
+  var searchUri = currentAbURI + "?(";
+  for (let i = 0; i < gSearchSession.searchTerms.length; i++) {
+    let searchTerm = gSearchSession.searchTerms.queryElementAt(
+      i,
+      nsIMsgSearchTerm
+    );
 
-      // get the "and" / "or" value from the first term
-      if (i == 0) {
-       if (searchTerm.booleanAnd)
-         searchUri += "and";
-       else
-         searchUri += "or";
+    // get the "and" / "or" value from the first term
+    if (i == 0) {
+      if (searchTerm.booleanAnd) {
+        searchUri += "and";
+      } else {
+        searchUri += "or";
       }
+    }
 
-      var attrs;
+    var attrs;
 
-      switch (searchTerm.attrib) {
-       case nsMsgSearchAttrib.Name:
-         if (gSearchPhoneticName != "true")
-           attrs = ["DisplayName", "FirstName", "LastName", "NickName", "_AimScreenName"];
-         else
-           attrs = ["DisplayName", "FirstName", "LastName", "NickName",
-                    "_AimScreenName", "PhoneticFirstName", "PhoneticLastName"];
-         break;
-       case nsMsgSearchAttrib.DisplayName:
-         attrs = ["DisplayName"];
-         break;
-       case nsMsgSearchAttrib.Email:
-         attrs = ["PrimaryEmail"];
-         break;
-       case nsMsgSearchAttrib.PhoneNumber:
-         attrs = ["HomePhone", "WorkPhone", "FaxNumber", "PagerNumber", "CellularNumber"];
-         break;
-       case nsMsgSearchAttrib.Organization:
-         attrs = ["Company"];
-         break;
-       case nsMsgSearchAttrib.Department:
-         attrs = ["Department"];
-         break;
-       case nsMsgSearchAttrib.City:
-         attrs = ["WorkCity"];
-         break;
-       case nsMsgSearchAttrib.Street:
-         attrs = ["WorkAddress"];
-         break;
-       case nsMsgSearchAttrib.Nickname:
-         attrs = ["NickName"];
-         break;
-       case nsMsgSearchAttrib.WorkPhone:
-         attrs = ["WorkPhone"];
-         break;
-       case nsMsgSearchAttrib.HomePhone:
-         attrs = ["HomePhone"];
-         break;
-       case nsMsgSearchAttrib.Fax:
-         attrs = ["FaxNumber"];
-         break;
-       case nsMsgSearchAttrib.Pager:
-         attrs = ["PagerNumber"];
-         break;
-       case nsMsgSearchAttrib.Mobile:
-         attrs = ["CellularNumber"];
-         break;
-       case nsMsgSearchAttrib.Title:
-         attrs = ["JobTitle"];
-         break;
-       case nsMsgSearchAttrib.AdditionalEmail:
-         attrs = ["SecondEmail"];
-         break;
-       case nsMsgSearchAttrib.ScreenName:
-         attrs = ["_AimScreenName"];
-         break;
-       default:
-         dump("XXX " + searchTerm.attrib + " not a supported search attr!\n");
-         attrs = ["DisplayName"];
-         break;
-      }
+    switch (searchTerm.attrib) {
+      case nsMsgSearchAttrib.Name:
+        if (gSearchPhoneticName != "true") {
+          attrs = [
+            "DisplayName",
+            "FirstName",
+            "LastName",
+            "NickName",
+            "_AimScreenName",
+          ];
+        } else {
+          attrs = [
+            "DisplayName",
+            "FirstName",
+            "LastName",
+            "NickName",
+            "_AimScreenName",
+            "PhoneticFirstName",
+            "PhoneticLastName",
+          ];
+        }
+        break;
+      case nsMsgSearchAttrib.DisplayName:
+        attrs = ["DisplayName"];
+        break;
+      case nsMsgSearchAttrib.Email:
+        attrs = ["PrimaryEmail"];
+        break;
+      case nsMsgSearchAttrib.PhoneNumber:
+        attrs = [
+          "HomePhone",
+          "WorkPhone",
+          "FaxNumber",
+          "PagerNumber",
+          "CellularNumber",
+        ];
+        break;
+      case nsMsgSearchAttrib.Organization:
+        attrs = ["Company"];
+        break;
+      case nsMsgSearchAttrib.Department:
+        attrs = ["Department"];
+        break;
+      case nsMsgSearchAttrib.City:
+        attrs = ["WorkCity"];
+        break;
+      case nsMsgSearchAttrib.Street:
+        attrs = ["WorkAddress"];
+        break;
+      case nsMsgSearchAttrib.Nickname:
+        attrs = ["NickName"];
+        break;
+      case nsMsgSearchAttrib.WorkPhone:
+        attrs = ["WorkPhone"];
+        break;
+      case nsMsgSearchAttrib.HomePhone:
+        attrs = ["HomePhone"];
+        break;
+      case nsMsgSearchAttrib.Fax:
+        attrs = ["FaxNumber"];
+        break;
+      case nsMsgSearchAttrib.Pager:
+        attrs = ["PagerNumber"];
+        break;
+      case nsMsgSearchAttrib.Mobile:
+        attrs = ["CellularNumber"];
+        break;
+      case nsMsgSearchAttrib.Title:
+        attrs = ["JobTitle"];
+        break;
+      case nsMsgSearchAttrib.AdditionalEmail:
+        attrs = ["SecondEmail"];
+        break;
+      case nsMsgSearchAttrib.ScreenName:
+        attrs = ["_AimScreenName"];
+        break;
+      default:
+        dump("XXX " + searchTerm.attrib + " not a supported search attr!\n");
+        attrs = ["DisplayName"];
+        break;
+    }
 
-      var opStr;
+    var opStr;
 
-      switch (searchTerm.op) {
+    switch (searchTerm.op) {
       case nsMsgSearchOp.Contains:
         opStr = "c";
         break;
       case nsMsgSearchOp.DoesntContain:
         opStr = "!c";
         break;
       case nsMsgSearchOp.Is:
         opStr = "=";
@@ -264,80 +311,94 @@ function onSearch() {
         opStr = "ew";
         break;
       case nsMsgSearchOp.SoundsLike:
         opStr = "~=";
         break;
       default:
         opStr = "c";
         break;
-      }
-
-      // currently, we can't do "and" and "or" searches at the same time
-      // (it's either all "and"s or all "or"s)
-      var max_attrs = attrs.length;
-
-      for (var j = 0; j < max_attrs; j++) {
-       // append the term(s) to the searchUri
-       searchUri += "(" + attrs[j] + "," + opStr + "," + encodeABTermValue(searchTerm.value.str) + ")";
-      }
     }
 
-    searchUri += ")";
-    SetAbView(searchUri);
+    // currently, we can't do "and" and "or" searches at the same time
+    // (it's either all "and"s or all "or"s)
+    var max_attrs = attrs.length;
+
+    for (var j = 0; j < max_attrs; j++) {
+      // append the term(s) to the searchUri
+      searchUri +=
+        "(" +
+        attrs[j] +
+        "," +
+        opStr +
+        "," +
+        encodeABTermValue(searchTerm.value.str) +
+        ")";
+    }
+  }
+
+  searchUri += ")";
+  SetAbView(searchUri);
 }
 
 // used to toggle functionality for Search/Stop button.
 function onSearchButton(event) {
-    if (event.target.label == gSearchBundle.getString("labelForSearchButton"))
-        onSearch();
-    else
-        onSearchStop();
+  if (event.target.label == gSearchBundle.getString("labelForSearchButton")) {
+    onSearch();
+  } else {
+    onSearchStop();
+  }
 }
 
 function GetAbViewListener() {
   return gSearchAbViewListener;
 }
 
 function onProperties() {
-  if (!gPropertiesCmd.hasAttribute("disabled"))
+  if (!gPropertiesCmd.hasAttribute("disabled")) {
     AbEditSelectedCard();
+  }
 }
 
 function onCompose() {
-  if (!gComposeCmd.hasAttribute("disabled"))
+  if (!gComposeCmd.hasAttribute("disabled")) {
     AbNewMessage();
+  }
 }
 
 function onDelete() {
-  if (!gDeleteCmd.hasAttribute("disabled"))
+  if (!gDeleteCmd.hasAttribute("disabled")) {
     AbDelete();
+  }
 }
 
 function AbResultsPaneKeyPress(event) {
   switch (event.keyCode) {
-  case KeyEvent.DOM_VK_RETURN:
-    onProperties();
-    break;
-  case KeyEvent.DOM_VK_DELETE:
-  case KeyEvent.DOM_VK_BACK_SPACE:
-    onDelete();
+    case KeyEvent.DOM_VK_RETURN:
+      onProperties();
+      break;
+    case KeyEvent.DOM_VK_DELETE:
+    case KeyEvent.DOM_VK_BACK_SPACE:
+      onDelete();
   }
 }
 
 function AbResultsPaneDoubleClick(card) {
   AbEditCard(card);
 }
 
 function UpdateCardView() {
   disableCommands();
   let numSelected = GetNumSelectedCards();
 
-  if (!numSelected)
+  if (!numSelected) {
     return;
+  }
 
-  if (MailServices.accounts.allIdentities.length > 0)
+  if (MailServices.accounts.allIdentities.length > 0) {
     gComposeCmd.removeAttribute("disabled");
+  }
 
   gDeleteCmd.removeAttribute("disabled");
-  if (numSelected == 1)
+  if (numSelected == 1) {
     gPropertiesCmd.removeAttribute("disabled");
+  }
 }
--- a/mail/base/content/FilterListDialog.js
+++ b/mail/base/content/FilterListDialog.js
@@ -1,17 +1,23 @@
 /* -*- Mode: C++; 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 {PluralForm} = ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
-var { fixIterator } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
+var { PluralForm } = ChromeUtils.import(
+  "resource://gre/modules/PluralForm.jsm"
+);
+var { fixIterator } = ChromeUtils.import(
+  "resource:///modules/iteratorUtils.jsm"
+);
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
 
 var gFilterListMsgWindow = null;
 var gCurrentFilterList;
 var gServerMenu = null;
 var gFilterListbox = null;
 var gEditButton = null;
 var gDeleteButton = null;
 var gCopyToNewButton = null;
@@ -35,127 +41,152 @@ var msgMoveMotion = {
 var gStatusFeedback = {
   progressMeterVisible: false,
 
   showStatusString(status) {
     document.getElementById("statusText").setAttribute("value", status);
   },
   startMeteors() {
     // change run button to be a stop button
-    gRunFiltersButton.setAttribute("label", gRunFiltersButton.getAttribute("stoplabel"));
-    gRunFiltersButton.setAttribute("accesskey", gRunFiltersButton.getAttribute("stopaccesskey"));
+    gRunFiltersButton.setAttribute(
+      "label",
+      gRunFiltersButton.getAttribute("stoplabel")
+    );
+    gRunFiltersButton.setAttribute(
+      "accesskey",
+      gRunFiltersButton.getAttribute("stopaccesskey")
+    );
 
     if (!this.progressMeterVisible) {
-      document.getElementById("statusbar-progresspanel").removeAttribute("collapsed");
+      document
+        .getElementById("statusbar-progresspanel")
+        .removeAttribute("collapsed");
       this.progressMeterVisible = true;
     }
 
     document.getElementById("statusbar-icon").removeAttribute("value");
   },
   stopMeteors() {
     try {
       // change run button to be a stop button
-      gRunFiltersButton.setAttribute("label", gRunFiltersButton.getAttribute("runlabel"));
-      gRunFiltersButton.setAttribute("accesskey", gRunFiltersButton.getAttribute("runaccesskey"));
+      gRunFiltersButton.setAttribute(
+        "label",
+        gRunFiltersButton.getAttribute("runlabel")
+      );
+      gRunFiltersButton.setAttribute(
+        "accesskey",
+        gRunFiltersButton.getAttribute("runaccesskey")
+      );
 
       if (this.progressMeterVisible) {
         document.getElementById("statusbar-progresspanel").collapsed = true;
         this.progressMeterVisible = true;
       }
     } catch (ex) {
       // can get here if closing window when running filters
     }
   },
-  showProgress(percentage) {
-  },
-  closeWindow() {
-  },
+  showProgress(percentage) {},
+  closeWindow() {},
 };
 
 var filterEditorQuitObserver = {
   observe(aSubject, aTopic, aData) {
     // Check whether or not we want to veto the quit request (unless another
     // observer already did.
-    if (aTopic == "quit-application-requested" &&
-        (aSubject instanceof Ci.nsISupportsPRBool) &&
-        !aSubject.data)
+    if (
+      aTopic == "quit-application-requested" &&
+      aSubject instanceof Ci.nsISupportsPRBool &&
+      !aSubject.data
+    ) {
       aSubject.data = !onFilterClose();
+    }
   },
 };
 
 function onLoad() {
-    gFilterListMsgWindow = Cc["@mozilla.org/messenger/msgwindow;1"]
-                             .createInstance(Ci.nsIMsgWindow);
-    gFilterListMsgWindow.domWindow = window;
-    gFilterListMsgWindow.rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_MAIL;
-    gFilterListMsgWindow.statusFeedback = gStatusFeedback;
+  gFilterListMsgWindow = Cc[
+    "@mozilla.org/messenger/msgwindow;1"
+  ].createInstance(Ci.nsIMsgWindow);
+  gFilterListMsgWindow.domWindow = window;
+  gFilterListMsgWindow.rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_MAIL;
+  gFilterListMsgWindow.statusFeedback = gStatusFeedback;
 
-    gServerMenu       = document.getElementById("serverMenu");
-    gFilterListbox    = document.getElementById("filterList");
-    gEditButton       = document.getElementById("editButton");
-    gDeleteButton     = document.getElementById("deleteButton");
-    gCopyToNewButton  = document.getElementById("copyToNewButton");
-    gTopButton        = document.getElementById("reorderTopButton");
-    gUpButton         = document.getElementById("reorderUpButton");
-    gDownButton       = document.getElementById("reorderDownButton");
-    gBottomButton     = document.getElementById("reorderBottomButton");
-    gSearchBox        = document.getElementById("searchBox");
-    gRunFiltersFolder = document.getElementById("runFiltersFolder");
-    gRunFiltersButton = document.getElementById("runFiltersButton");
-    gFilterBundle     = document.getElementById("bundle_filter");
+  gServerMenu = document.getElementById("serverMenu");
+  gFilterListbox = document.getElementById("filterList");
+  gEditButton = document.getElementById("editButton");
+  gDeleteButton = document.getElementById("deleteButton");
+  gCopyToNewButton = document.getElementById("copyToNewButton");
+  gTopButton = document.getElementById("reorderTopButton");
+  gUpButton = document.getElementById("reorderUpButton");
+  gDownButton = document.getElementById("reorderDownButton");
+  gBottomButton = document.getElementById("reorderBottomButton");
+  gSearchBox = document.getElementById("searchBox");
+  gRunFiltersFolder = document.getElementById("runFiltersFolder");
+  gRunFiltersButton = document.getElementById("runFiltersButton");
+  gFilterBundle = document.getElementById("bundle_filter");
 
-    updateButtons();
+  updateButtons();
+
+  processWindowArguments(window.arguments[0]);
 
-    processWindowArguments(window.arguments[0]);
-
-    Services.obs.addObserver(filterEditorQuitObserver,
-                             "quit-application-requested");
+  Services.obs.addObserver(
+    filterEditorQuitObserver,
+    "quit-application-requested"
+  );
 }
 
 /**
  * Processes arguments sent to this dialog when opened or refreshed.
  *
  * @param aArguments  An object having members representing the arguments.
  *                    { arg1: value1, arg2: value2, ... }
  */
 function processWindowArguments(aArguments) {
   // If a specific folder was requested, try to select it
   // if we don't already show its server.
-  if (!gServerMenu._folder ||
-      (("folder" in aArguments) &&
-      (aArguments.folder != gServerMenu._folder) &&
-      (aArguments.folder.rootFolder != gServerMenu._folder))) {
+  if (
+    !gServerMenu._folder ||
+    ("folder" in aArguments &&
+      aArguments.folder != gServerMenu._folder &&
+      aArguments.folder.rootFolder != gServerMenu._folder)
+  ) {
     let wantedFolder;
-    if ("folder" in aArguments)
+    if ("folder" in aArguments) {
       wantedFolder = aArguments.folder;
+    }
 
     // Get the folder where filters should be defined, if that server
     // can accept filters.
     let firstItem = getFilterFolderForSelection(wantedFolder);
 
     // If the selected server cannot have filters, get the default server
     // If the default server cannot have filters, check all accounts
     // and get a server that can have filters.
-    if (!firstItem)
+    if (!firstItem) {
       firstItem = getServerThatCanHaveFilters().rootFolder;
+    }
 
-    if (firstItem)
+    if (firstItem) {
       setFilterFolder(firstItem);
+    }
 
-    if (wantedFolder)
+    if (wantedFolder) {
       setRunFolder(wantedFolder);
+    }
   } else {
     // If we didn't change folder still redraw the list
     // to show potential new filters if we were called for refresh.
     rebuildFilterList();
   }
 
   // If a specific filter was requested, try to select it.
-  if ("filter" in aArguments)
+  if ("filter" in aArguments) {
     selectFilter(aArguments.filter);
+  }
 }
 
 /**
  * This is called from OpenOrFocusWindow() if the dialog is already open.
  * New filters could have been created by operations outside the dialog.
  *
  * @param aArguments  An object of arguments having the same format
  *                    as window.arguments[0].
@@ -176,37 +207,40 @@ function CanRunFiltersAfterTheFact(aServ
 
 /**
  * Change the root server for which we are managing filters.
  *
  * @param msgFolder The nsIMsgFolder server containing filters
  *                  (or a folder for NNTP server).
  */
 function setFilterFolder(msgFolder) {
-  if (!msgFolder || msgFolder == gServerMenu._folder)
+  if (!msgFolder || msgFolder == gServerMenu._folder) {
     return;
+  }
 
   // Save the current filters to disk before switching because
   // the dialog may be closed and we'll lose current filters.
-  if (gCurrentFilterList)
+  if (gCurrentFilterList) {
     gCurrentFilterList.saveToDefaultFile();
+  }
 
   // Setting this attribute should go away in bug 473009.
   gServerMenu._folder = msgFolder;
   // Calling this should go away in bug 802609.
   gServerMenu.menupopup.selectFolder(msgFolder);
 
   // Calling getEditableFilterList will detect any errors in msgFilterRules.dat,
   // backup the file, and alert the user.
   gCurrentFilterList = msgFolder.getEditableFilterList(gFilterListMsgWindow);
   rebuildFilterList();
 
   // Select the first item in the list, if there is one.
-  if (gFilterListbox.itemCount > 0)
+  if (gFilterListbox.itemCount > 0) {
     gFilterListbox.selectItem(gFilterListbox.getItemAtIndex(0));
+  }
 
   // This will get the deferred to account root folder, if server is deferred.
   // We intentionally do this after setting the current server, as we want
   // that to refer to the rootFolder for the actual server, not the
   // deferred-to server, as current server is really a proxy for the
   // server whose filters we are editing. But below here we are managing
   // where the filters will get applied, which is on the deferred-to server.
   msgFolder = msgFolder.server.rootMsgFolder;
@@ -226,38 +260,42 @@ function setFilterFolder(msgFolder) {
     let wantedFolder = null;
     // For a given server folder, get the default run target folder or show
     // "Choose Folder".
     if (!msgFolder.isServer) {
       wantedFolder = msgFolder;
     } else {
       try {
         switch (msgFolder.server.type) {
-        case "nntp":
-          // For NNTP select the subscribed newsgroup.
-          wantedFolder = gServerMenu._folder;
-          break;
-        case "rss":
-          // Show "Choose Folder" for feeds.
-          wantedFolder = null;
-          break;
-        case "imap":
-        case "pop3":
-        case "none":
-          // Find Inbox for IMAP and POP or Local Folders,
-          // show "Choose Folder" if not found.
-          wantedFolder = msgFolder.rootFolder.getFolderWithFlags(Ci.nsMsgFolderFlags.Inbox);
-          break;
-        default:
-          // For other account types we don't know what's good to select,
-          // so show "Choose Folder".
-          wantedFolder = null;
+          case "nntp":
+            // For NNTP select the subscribed newsgroup.
+            wantedFolder = gServerMenu._folder;
+            break;
+          case "rss":
+            // Show "Choose Folder" for feeds.
+            wantedFolder = null;
+            break;
+          case "imap":
+          case "pop3":
+          case "none":
+            // Find Inbox for IMAP and POP or Local Folders,
+            // show "Choose Folder" if not found.
+            wantedFolder = msgFolder.rootFolder.getFolderWithFlags(
+              Ci.nsMsgFolderFlags.Inbox
+            );
+            break;
+          default:
+            // For other account types we don't know what's good to select,
+            // so show "Choose Folder".
+            wantedFolder = null;
         }
       } catch (e) {
-        Cu.reportError("Failed to select a suitable folder to run filters on: " + e);
+        Cu.reportError(
+          "Failed to select a suitable folder to run filters on: " + e
+        );
         wantedFolder = null;
       }
     }
 
     // Select a useful first folder for the server.
     setRunFolder(wantedFolder);
   }
 }
@@ -278,19 +316,23 @@ function setRunFolder(aFolder) {
 /**
  * Toggle enabled state of a filter, in both the filter properties and the UI.
  *
  * @param aFilterItem  an item (row) of the filter list to be toggled
  */
 function toggleFilter(aFilterItem, aSetForEvent) {
   let filter = aFilterItem._filter;
   if (filter.unparseable && !filter.enabled) {
-    Services.prompt.alert(window, null,
-                          gFilterBundle.getFormattedString("cannotEnableIncompatFilter",
-                          [document.getElementById("bundle_brand").getString("brandShortName")]));
+    Services.prompt.alert(
+      window,
+      null,
+      gFilterBundle.getFormattedString("cannotEnableIncompatFilter", [
+        document.getElementById("bundle_brand").getString("brandShortName"),
+      ])
+    );
     return;
   }
   filter.enabled = aSetForEvent === undefined ? !filter.enabled : aSetForEvent;
 
   // Now update the checkbox
   if (aSetForEvent === undefined) {
     aFilterItem.firstChild.nextSibling.checked = filter.enabled;
   }
@@ -302,18 +344,19 @@ function toggleFilter(aFilterItem, aSetF
  * Selects a specific filter in the filter list.
  * The listbox view is scrolled to the corresponding item.
  *
  * @param aFilter  The nsIMsgFilter to select.
  *
  * @return  true/false indicating whether the filter was found and selected.
  */
 function selectFilter(aFilter) {
-  if (currentFilter() == aFilter)
+  if (currentFilter() == aFilter) {
     return true;
+  }
 
   resetSearchBox(aFilter);
 
   let filterCount = gCurrentFilterList.filterCount;
   for (let i = 0; i < filterCount; i++) {
     if (gCurrentFilterList.getFilterAt(i) == aFilter) {
       gFilterListbox.ensureIndexIsVisible(i);
       gFilterListbox.selectedIndex = i;
@@ -328,26 +371,33 @@ function selectFilter(aFilter) {
  * returns the first one. If none are selected, returns null.
  */
 function currentFilter() {
   let currentItem = gFilterListbox.selectedItem;
   return currentItem ? currentItem._filter : null;
 }
 
 function onEditFilter() {
-  if (gEditButton.disabled)
+  if (gEditButton.disabled) {
     return;
+  }
 
   let selectedFilter = currentFilter();
-  if (!selectedFilter)
+  if (!selectedFilter) {
     return;
+  }
+
+  let args = { filter: selectedFilter, filterList: gCurrentFilterList };
 
-  let args = {filter: selectedFilter, filterList: gCurrentFilterList};
-
-  window.openDialog("chrome://messenger/content/FilterEditor.xul", "FilterEditor", "chrome,modal,titlebar,resizable,centerscreen", args);
+  window.openDialog(
+    "chrome://messenger/content/FilterEditor.xul",
+    "FilterEditor",
+    "chrome,modal,titlebar,resizable,centerscreen",
+    args
+  );
 
   if ("refresh" in args && args.refresh) {
     // reset search if edit was okay (name change might lead to hidden entry!)
     resetSearchBox(selectedFilter);
     rebuildFilterList();
   }
 }
 
@@ -359,24 +409,26 @@ function onNewFilter() {
   calculatePositionAndShowCreateFilterDialog({});
 }
 
 /**
  * Handler function for the 'Copy...' button.
  * Opens the filter dialog for copying the selected filter.
  */
 function onCopyToNewFilter() {
-  if (gCopyToNewButton.disabled)
+  if (gCopyToNewButton.disabled) {
     return;
+  }
 
   let selectedFilter = currentFilter();
-  if (!selectedFilter)
+  if (!selectedFilter) {
     return;
+  }
 
-  let args = {copiedFilter: selectedFilter};
+  let args = { copiedFilter: selectedFilter };
 
   calculatePositionAndShowCreateFilterDialog(args);
 }
 
 /**
  * Calculates the position for inserting the new filter,
  * and then displays the create dialog.
  *
@@ -399,70 +451,87 @@ function calculatePositionAndShowCreateF
         break;
       }
     }
   }
   args.filterPosition = position;
 
   args.filterList = gCurrentFilterList;
 
-  window.openDialog("chrome://messenger/content/FilterEditor.xul", "FilterEditor",
-    "chrome,modal,titlebar,resizable,centerscreen", args);
+  window.openDialog(
+    "chrome://messenger/content/FilterEditor.xul",
+    "FilterEditor",
+    "chrome,modal,titlebar,resizable,centerscreen",
+    args
+  );
 
   if ("refresh" in args && args.refresh) {
     // On success: reset the search box if necessary!
     resetSearchBox(args.newFilter);
     rebuildFilterList();
 
     // Select the new filter, it is at the position of previous selection.
     gFilterListbox.selectItem(gFilterListbox.getItemAtIndex(position));
-    if (currentFilter() != args.newFilter)
+    if (currentFilter() != args.newFilter) {
       Cu.reportError("Filter created at an unexpected position!");
+    }
   }
 }
 
 /**
  * Delete selected filters.
  *  'Selected' is not to be confused with active (checkbox checked)
  */
 function onDeleteFilter() {
-  if (gDeleteButton.disabled)
+  if (gDeleteButton.disabled) {
     return;
+  }
 
   let items = gFilterListbox.selectedItems;
-  if (!items.length)
+  if (!items.length) {
     return;
+  }
 
-  let checkValue = {value: false};
-  if ((Services.prefs.getBoolPref("mailnews.filters.confirm_delete")) &&
-      (Services.prompt.confirmEx(window, null,
-                                 gFilterBundle.getString("deleteFilterConfirmation"),
-                                 Services.prompt.STD_YES_NO_BUTTONS,
-                                 "", "", "",
-                                 gFilterBundle.getString("dontWarnAboutDeleteCheckbox"),
-                                 checkValue)))
+  let checkValue = { value: false };
+  if (
+    Services.prefs.getBoolPref("mailnews.filters.confirm_delete") &&
+    Services.prompt.confirmEx(
+      window,
+      null,
+      gFilterBundle.getString("deleteFilterConfirmation"),
+      Services.prompt.STD_YES_NO_BUTTONS,
+      "",
+      "",
+      "",
+      gFilterBundle.getString("dontWarnAboutDeleteCheckbox"),
+      checkValue
+    )
+  ) {
     return;
+  }
 
-  if (checkValue.value)
-     Services.prefs.setBoolPref("mailnews.filters.confirm_delete", false);
+  if (checkValue.value) {
+    Services.prefs.setBoolPref("mailnews.filters.confirm_delete", false);
+  }
 
   // Save filter position before the first selected one.
   let newSelectionIndex = gFilterListbox.selectedIndex - 1;
 
   // Must reverse the loop, as the items list shrinks when we delete.
   for (let index = items.length - 1; index >= 0; --index) {
     let item = items[index];
     gCurrentFilterList.removeFilter(item._filter);
     item.remove();
   }
   updateCountBox();
 
   // Select filter above previously selected if one existed, otherwise the first one.
-  if (newSelectionIndex == -1 && gFilterListbox.itemCount > 0)
+  if (newSelectionIndex == -1 && gFilterListbox.itemCount > 0) {
     newSelectionIndex = 0;
+  }
   if (newSelectionIndex > -1) {
     gFilterListbox.selectedIndex = newSelectionIndex;
     updateViewPosition(-1);
   }
 }
 
 /**
  * Move filter one step up in visible list.
@@ -476,17 +545,17 @@ function onUp(event) {
  */
 function onDown(event) {
   moveFilter(msgMoveMotion.Down);
 }
 
 /**
  * Move filter to bottom for long filter lists.
  */
- function onTop(evt) {
+function onTop(evt) {
   moveFilter(msgMoveMotion.Top);
 }
 
 /**
  * Move filter to top for long filter lists.
  */
 function onBottom(evt) {
   moveFilter(msgMoveMotion.Bottom);
@@ -506,34 +575,38 @@ function onBottom(evt) {
  *   which would further "compact" related filters
  *
  * @param motion
  *   msgMoveMotion.Up, msgMoveMotion.Down, msgMoveMotion.Top, msgMoveMotion.Bottom
  */
 function moveFilter(motion) {
   // At the moment, do not allow moving groups of filters.
   let selectedFilter = currentFilter();
-  if (!selectedFilter)
+  if (!selectedFilter) {
     return;
+  }
 
   var relativeStep = 0;
   var moveFilterNative = null;
 
   switch (motion) {
     case msgMoveMotion.Top:
       if (selectedFilter) {
         gCurrentFilterList.removeFilter(selectedFilter);
         gCurrentFilterList.insertFilterAt(0, selectedFilter);
         rebuildFilterList();
       }
       return;
     case msgMoveMotion.Bottom:
       if (selectedFilter) {
         gCurrentFilterList.removeFilter(selectedFilter);
-        gCurrentFilterList.insertFilterAt(gCurrentFilterList.filterCount, selectedFilter);
+        gCurrentFilterList.insertFilterAt(
+          gCurrentFilterList.filterCount,
+          selectedFilter
+        );
         rebuildFilterList();
       }
       return;
     case msgMoveMotion.Up:
       relativeStep = -1;
       moveFilterNative = Ci.nsMsgFilterMotion.up;
       break;
     case msgMoveMotion.Down:
@@ -558,91 +631,118 @@ function moveFilter(motion) {
   let filterCount = gCurrentFilterList.filterCount;
   for (let i = 0; i < filterCount; i++) {
     if (gCurrentFilterList.getFilterAt(i) == nextFilter) {
       newIndex = i;
       break;
     }
   }
 
-  if (motion == msgMoveMotion.Down)
+  if (motion == msgMoveMotion.Down) {
     newIndex += relativeStep;
+  }
 
   gCurrentFilterList.insertFilterAt(newIndex, selectedFilter);
 
   rebuildFilterList();
 }
 
 function viewLog() {
-  var args = {filterList: gCurrentFilterList};
+  var args = { filterList: gCurrentFilterList };
 
-  window.openDialog("chrome://messenger/content/viewLog.xul", "FilterLog", "chrome,modal,titlebar,resizable,centerscreen", args);
+  window.openDialog(
+    "chrome://messenger/content/viewLog.xul",
+    "FilterLog",
+    "chrome,modal,titlebar,resizable,centerscreen",
+    args
+  );
 }
 
 function onFilterUnload() {
   gCurrentFilterList.saveToDefaultFile();
-  Services.obs.removeObserver(filterEditorQuitObserver,
-                              "quit-application-requested");
+  Services.obs.removeObserver(
+    filterEditorQuitObserver,
+    "quit-application-requested"
+  );
 }
 
 function onFilterClose() {
-  if (gRunFiltersButton.getAttribute("label") ==
-      gRunFiltersButton.getAttribute("stoplabel")) {
+  if (
+    gRunFiltersButton.getAttribute("label") ==
+    gRunFiltersButton.getAttribute("stoplabel")
+  ) {
     let promptTitle = gFilterBundle.getString("promptTitle");
     let promptMsg = gFilterBundle.getString("promptMsg");
     let stopButtonLabel = gFilterBundle.getString("stopButtonLabel");
     let continueButtonLabel = gFilterBundle.getString("continueButtonLabel");
 
-    let result = Services.prompt.confirmEx(window, promptTitle, promptMsg,
-               (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0) +
-               (Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1),
-               continueButtonLabel, stopButtonLabel, null, null, {value: 0});
+    let result = Services.prompt.confirmEx(
+      window,
+      promptTitle,
+      promptMsg,
+      Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0 +
+        Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1,
+      continueButtonLabel,
+      stopButtonLabel,
+      null,
+      null,
+      { value: 0 }
+    );
 
-    if (result)
+    if (result) {
       gFilterListMsgWindow.StopUrls();
-    else
+    } else {
       return false;
+    }
   }
 
   return true;
 }
 
 function runSelectedFilters() {
   // if run button has "stop" label, do stop.
-  if (gRunFiltersButton.getAttribute("label") ==
-      gRunFiltersButton.getAttribute("stoplabel")) {
+  if (
+    gRunFiltersButton.getAttribute("label") ==
+    gRunFiltersButton.getAttribute("stoplabel")
+  ) {
     gFilterListMsgWindow.StopUrls();
     return;
   }
 
-  let folder = gRunFiltersFolder._folder || gRunFiltersFolder.selectedItem._folder;
-  if (!folder)
+  let folder =
+    gRunFiltersFolder._folder || gRunFiltersFolder.selectedItem._folder;
+  if (!folder) {
     return;
+  }
 
   let filterList = MailServices.filters.getTempFilterList(folder);
-  let folders = Cc["@mozilla.org/array;1"]
-                  .createInstance(Ci.nsIMutableArray);
+  let folders = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
   folders.appendElement(folder);
 
   // make sure the tmp filter list uses the real filter list log stream
   filterList.logStream = gCurrentFilterList.logStream;
   filterList.loggingEnabled = gCurrentFilterList.loggingEnabled;
 
   let index = 0;
   for (let item of gFilterListbox.selectedItems) {
     filterList.insertFilterAt(index++, item._filter);
   }
 
-  MailServices.filters.applyFiltersToFolders(filterList, folders, gFilterListMsgWindow);
+  MailServices.filters.applyFiltersToFolders(
+    filterList,
+    folders,
+    gFilterListMsgWindow
+  );
 }
 
 function moveCurrentFilter(motion) {
   let filter = currentFilter();
-  if (!filter)
+  if (!filter) {
     return;
+  }
 
   gCurrentFilterList.moveFilter(filter, motion);
   rebuildFilterList();
 }
 
 /**
  * Redraws the list of filters. Takes the search box value into account.
  *
@@ -668,18 +768,19 @@ function rebuildFilterList() {
       searchBoxFocus = false;
       break;
     }
     activeElement = activeElement.parentNode;
   }
 
   // Make a note of which filters were previously selected
   let selectedNames = [];
-  for (let i = 0; i < gFilterListbox.selectedItems.length; i++)
+  for (let i = 0; i < gFilterListbox.selectedItems.length; i++) {
     selectedNames.push(gFilterListbox.selectedItems[i]._filter.filterName);
+  }
 
   // Save scroll position so we can try to restore it later.
   // Doesn't work when the list is rebuilt after search box condition changed.
   let firstVisibleRowIndex = gFilterListbox.getIndexOfFirstVisibleRow();
 
   // listbox.xml seems to cache the value of the first selected item in a
   // range at _selectionStart. The old value though is now obsolete,
   // since we will recreate all of the elements. We need to clear this,
@@ -688,22 +789,24 @@ function rebuildFilterList() {
   gFilterListbox.clearSelection();
 
   let listitem, nameCell, enabledCell, filter;
   let filterCount = gCurrentFilterList.filterCount;
   let listitemCount = gFilterListbox.itemCount;
   let listitemIndex = 0;
   let tempFilterListLength = aTempFilterList ? aTempFilterList.length - 1 : 0;
   for (let i = 0; i < filterCount; i++) {
-    if (aTempFilterList && listitemIndex > tempFilterListLength)
+    if (aTempFilterList && listitemIndex > tempFilterListLength) {
       break;
+    }
 
     filter = gCurrentFilterList.getFilterAt(i);
-    if (aTempFilterList && aTempFilterList[listitemIndex] != i)
+    if (aTempFilterList && aTempFilterList[listitemIndex] != i) {
       continue;
+    }
 
     if (listitemCount > listitemIndex) {
       // If there is a free existing listitem, reuse it.
       // Use .itemChildren[] instead of .getItemAtIndex() as it is much faster.
       listitem = gFilterListbox.itemChildren[listitemIndex];
       nameCell = listitem.firstChild;
       enabledCell = nameCell.nextSibling;
     } else {
@@ -727,45 +830,50 @@ function rebuildFilterList() {
     // For accessibility set the label on listitem.
     listitem.setAttribute("label", filter.filterName);
     // Set the listitem values to represent the current filter.
     nameCell.setAttribute("value", filter.filterName);
     enabledCell.setAttribute("checked", filter.enabled);
     listitem.setAttribute("aria-checked", filter.enabled);
     listitem._filter = filter;
 
-    if (selectedNames.includes(filter.filterName))
+    if (selectedNames.includes(filter.filterName)) {
       gFilterListbox.addItemToSelection(listitem);
+    }
 
     listitemIndex++;
   }
   // Remove any superfluous listitems, if the number of filters shrunk.
   for (let i = listitemCount - 1; i >= listitemIndex; i--) {
     gFilterListbox.lastChild.remove();
   }
 
   updateViewPosition(firstVisibleRowIndex);
   updateCountBox();
 
   // If before rebuilding the list the searchbox was focused, focus it again.
   // In any other case, focus the list.
-  if (searchBoxFocus)
+  if (searchBoxFocus) {
     gSearchBox.focus();
-  else
+  } else {
     gFilterListbox.focus();
+  }
 }
 
 function updateViewPosition(firstVisibleRowIndex) {
-  if (firstVisibleRowIndex == -1)
+  if (firstVisibleRowIndex == -1) {
     firstVisibleRowIndex = gFilterListbox.getIndexOfFirstVisibleRow();
+  }
 
   // Restore to the extent possible the scroll position.
-  if (firstVisibleRowIndex && gFilterListbox.itemCount)
-    gFilterListbox.scrollToIndex(Math.min(firstVisibleRowIndex,
-                                          gFilterListbox.itemCount - 1));
+  if (firstVisibleRowIndex && gFilterListbox.itemCount) {
+    gFilterListbox.scrollToIndex(
+      Math.min(firstVisibleRowIndex, gFilterListbox.itemCount - 1)
+    );
+  }
 
   if (gFilterListbox.selectedCount) {
     // Make sure that at least the first selected item is visible.
     gFilterListbox.ensureElementIsVisible(gFilterListbox.selectedItems[0]);
 
     // The current item should be the first selected item, so that keyboard
     // selection extension can work.
     gFilterListbox.currentItem = gFilterListbox.selectedItems[0];
@@ -777,121 +885,134 @@ function updateViewPosition(firstVisible
 /**
  * Try to only enable buttons that make sense
  *  - moving filters is currently only enabled for single selection
  *    also movement is restricted by searchBox and current selection position
  *  - edit only for single filters
  *  - delete / run only for one or more selected filters
  */
 function updateButtons() {
-    var numFiltersSelected = gFilterListbox.selectedItems.length;
-    var oneFilterSelected = (numFiltersSelected == 1);
+  var numFiltersSelected = gFilterListbox.selectedItems.length;
+  var oneFilterSelected = numFiltersSelected == 1;
 
-    // "edit" is disabled when not exactly one filter is selected
-    // or if we couldn't parse that filter
-    let disabled = !oneFilterSelected || currentFilter().unparseable;
-    gEditButton.disabled = disabled;
+  // "edit" is disabled when not exactly one filter is selected
+  // or if we couldn't parse that filter
+  let disabled = !oneFilterSelected || currentFilter().unparseable;
+  gEditButton.disabled = disabled;
 
-    // "copy" is the same as "edit"
-    gCopyToNewButton.disabled = disabled;
+  // "copy" is the same as "edit"
+  gCopyToNewButton.disabled = disabled;
 
-    // "delete" only disabled when no filters are selected
-    gDeleteButton.disabled = !numFiltersSelected;
+  // "delete" only disabled when no filters are selected
+  gDeleteButton.disabled = !numFiltersSelected;
 
-    // we can run multiple filters on a folder
-    // so only disable this UI if no filters are selected
-    document.getElementById("folderPickerPrefix").disabled = !numFiltersSelected;
-    gRunFiltersFolder.disabled = !numFiltersSelected;
-    gRunFiltersButton.disabled = !numFiltersSelected || !gRunFiltersFolder._folder;
-    // "up" and "top" enabled only if one filter is selected, and it's not the first
-    // don't use gFilterListbox.currentIndex here, it's buggy when we've just changed the
-    // children in the list (via rebuildFilterList)
-    disabled = !(oneFilterSelected &&
-                 gFilterListbox.getSelectedItem(0) != gFilterListbox.getItemAtIndex(0));
-    gUpButton.disabled = disabled;
-    gTopButton.disabled = disabled;
+  // we can run multiple filters on a folder
+  // so only disable this UI if no filters are selected
+  document.getElementById("folderPickerPrefix").disabled = !numFiltersSelected;
+  gRunFiltersFolder.disabled = !numFiltersSelected;
+  gRunFiltersButton.disabled =
+    !numFiltersSelected || !gRunFiltersFolder._folder;
+  // "up" and "top" enabled only if one filter is selected, and it's not the first
+  // don't use gFilterListbox.currentIndex here, it's buggy when we've just changed the
+  // children in the list (via rebuildFilterList)
+  disabled = !(
+    oneFilterSelected &&
+    gFilterListbox.getSelectedItem(0) != gFilterListbox.getItemAtIndex(0)
+  );
+  gUpButton.disabled = disabled;
+  gTopButton.disabled = disabled;
 
-    // "down" and "bottom" enabled only if one filter is selected,
-    // and it's not the last one
-    disabled = !(oneFilterSelected && gFilterListbox.selectedIndex < gFilterListbox.itemCount - 1);
-    gDownButton.disabled = disabled;
-    gBottomButton.disabled = disabled;
+  // "down" and "bottom" enabled only if one filter is selected,
+  // and it's not the last one
+  disabled = !(
+    oneFilterSelected &&
+    gFilterListbox.selectedIndex < gFilterListbox.itemCount - 1
+  );
+  gDownButton.disabled = disabled;
+  gBottomButton.disabled = disabled;
 }
 
 /**
  * Given a selected folder, returns the folder where filters should
  *  be defined (the root folder except for news) if the server can
  *  accept filters.
  *
  * @param   nsIMsgFolder aFolder - selected folder, from window args
  * @returns an nsIMsgFolder where the filter is defined
  */
 function getFilterFolderForSelection(aFolder) {
   let rootFolder = aFolder && aFolder.server ? aFolder.server.rootFolder : null;
-  if (rootFolder && rootFolder.isServer && rootFolder.server.canHaveFilters)
-    return (aFolder.server.type == "nntp") ? aFolder : rootFolder;
+  if (rootFolder && rootFolder.isServer && rootFolder.server.canHaveFilters) {
+    return aFolder.server.type == "nntp" ? aFolder : rootFolder;
+  }
 
   return null;
 }
 
 /**
  * If the selected server cannot have filters, get the default server.
  * If the default server cannot have filters, check all accounts
  * and get a server that can have filters.
  *
  * @returns an nsIMsgIncomingServer
  */
 function getServerThatCanHaveFilters() {
-    let defaultAccount = MailServices.accounts.defaultAccount;
-    if (defaultAccount) {
-      let defaultIncomingServer = defaultAccount.incomingServer;
-      // Check to see if default server can have filters.
-      if (defaultIncomingServer.canHaveFilters)
-        return defaultIncomingServer;
+  let defaultAccount = MailServices.accounts.defaultAccount;
+  if (defaultAccount) {
+    let defaultIncomingServer = defaultAccount.incomingServer;
+    // Check to see if default server can have filters.
+    if (defaultIncomingServer.canHaveFilters) {
+      return defaultIncomingServer;
     }
+  }
 
-    // If it cannot, check all accounts to find a server
-    // that can have filters.
-    let allServers = MailServices.accounts.allServers;
-    for (let currentServer of fixIterator(allServers, Ci.nsIMsgIncomingServer)) {
-      if (currentServer.canHaveFilters)
-        return currentServer;
+  // If it cannot, check all accounts to find a server
+  // that can have filters.
+  let allServers = MailServices.accounts.allServers;
+  for (let currentServer of fixIterator(allServers, Ci.nsIMsgIncomingServer)) {
+    if (currentServer.canHaveFilters) {
+      return currentServer;
     }
+  }
 
-    return null;
+  return null;
 }
 
 function onFilterClick(event) {
   // This is called after the clicked checkbox changed state
   // so this.checked is the right state we want to toggle to.
   toggleFilter(this.parentNode, this.checked);
 }
 
 function onFilterDoubleClick(event) {
-    // we only care about button 0 (left click) events
-    if (event.button != 0)
-      return;
+  // we only care about button 0 (left click) events
+  if (event.button != 0) {
+    return;
+  }
 
-    onEditFilter();
+  onEditFilter();
 }
 
 function onFilterListKeyPress(aEvent) {
   if (aEvent.keyCode) {
     switch (aEvent.keyCode) {
       case KeyEvent.DOM_VK_INSERT:
-        if (!document.getElementById("newButton").disabled)
+        if (!document.getElementById("newButton").disabled) {
           onNewFilter();
+        }
         break;
       case KeyEvent.DOM_VK_DELETE:
-        if (!document.getElementById("deleteButton").disabled)
+        if (!document.getElementById("deleteButton").disabled) {
           onDeleteFilter();
+        }
         break;
       case KeyEvent.DOM_VK_RETURN:
-        if (!document.getElementById("editButton").disabled)
+        if (!document.getElementById("editButton").disabled) {
           onEditFilter();
+        }
         break;
     }
   } else if (!aEvent.ctrlKey && !aEvent.altKey && !aEvent.metaKey) {
     switch (aEvent.charCode) {
       case KeyEvent.DOM_VK_SPACE:
         for (let item of gFilterListbox.selectedItems) {
           toggleFilter(item);
         }
@@ -909,73 +1030,81 @@ function onFilterListKeyPress(aEvent) {
  * @param  aFilter   nsIMsgFilter to check
  * @param  aKeyword  the string to find in the filter name
  *
  * @return  True if the filter name contains the searched keyword.
             Otherwise false. In the future this may be extended to match
             other filter attributes.
  */
 function filterSearchMatch(aFilter, aKeyword) {
-  return (aFilter.filterName.toLocaleLowerCase().includes(aKeyword));
+  return aFilter.filterName.toLocaleLowerCase().includes(aKeyword);
 }
 
 /**
  * Called from rebuildFilterList when the list needs to be redrawn.
  * @return  Uses the search term in search box, to produce an array of
  *          row (filter) numbers (indexes) that match the search term.
  */
 function onFindFilter() {
   let keyWord = gSearchBox.value.toLocaleLowerCase();
 
   // If searchbox is empty, just return and let rebuildFilterList
   // create an unfiltered list.
-  if (!keyWord)
+  if (!keyWord) {
     return null;
+  }
 
   // Rematch everything in the list, remove what doesn't match the search box.
   let rows = gCurrentFilterList.filterCount;
   let matchingFilterList = [];
   // Use the full gCurrentFilterList, not the filterList listbox,
   // which may already be filtered.
   for (let i = 0; i < rows; i++) {
-    if (filterSearchMatch(gCurrentFilterList.getFilterAt(i), keyWord))
+    if (filterSearchMatch(gCurrentFilterList.getFilterAt(i), keyWord)) {
       matchingFilterList.push(i);
+    }
   }
 
   return matchingFilterList;
 }
 
 /**
  * Clear the search term in the search box if needed.
  *
  * @param aFilter  If this nsIMsgFilter matches the search term,
  *                 do not reset the box. If this is null,
  *                 reset unconditionally.
  */
 function resetSearchBox(aFilter) {
   let keyword = gSearchBox.value.toLocaleLowerCase();
-  if (keyword && (!aFilter || !filterSearchMatch(aFilter, keyword)))
+  if (keyword && (!aFilter || !filterSearchMatch(aFilter, keyword))) {
     gSearchBox.reset();
+  }
 }
 
 /**
  * Display "1 item",  "11 items" or "4 of 10" if list is filtered via search box.
  */
 function updateCountBox() {
   let countBox = document.getElementById("countBox");
   let sum = gCurrentFilterList.filterCount;
   let len = gFilterListbox.itemCount;
 
   if (len == sum) {
     // "N items"
-    countBox.value = PluralForm.get(len, gFilterBundle.getString("filterCountItems"))
-                               .replace("#1", len);
+    countBox.value = PluralForm.get(
+      len,
+      gFilterBundle.getString("filterCountItems")
+    ).replace("#1", len);
     countBox.removeAttribute("filterActive");
   } else {
     // "N of M"
-    countBox.value = gFilterBundle.getFormattedString("filterCountVisibleOfTotal",
-                                                      [len, sum]);
-    if (len == 0 && sum > 0)
+    countBox.value = gFilterBundle.getFormattedString(
+      "filterCountVisibleOfTotal",
+      [len, sum]
+    );
+    if (len == 0 && sum > 0) {
       countBox.setAttribute("filterActive", "nomatches");
-    else
+    } else {
       countBox.setAttribute("filterActive", "matches");
+    }
   }
 }
--- a/mail/base/content/SearchDialog.js
+++ b/mail/base/content/SearchDialog.js
@@ -7,20 +7,22 @@
 /* import-globals-from folderDisplay.js */
 /* import-globals-from mailWindow.js */
 /* import-globals-from mailWindowOverlay.js */
 /* import-globals-from messageDisplay.js */
 /* import-globals-from threadPane.js */
 
 "use strict";
 
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {MailUtils} = ChromeUtils.import("resource:///modules/MailUtils.jsm");
-var {PluralForm} = ChromeUtils.import("resource://gre/modules/PluralForm.jsm");
-var {TagUtils} = ChromeUtils.import("resource:///modules/TagUtils.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
+var { PluralForm } = ChromeUtils.import(
+  "resource://gre/modules/PluralForm.jsm"
+);
+var { TagUtils } = ChromeUtils.import("resource:///modules/TagUtils.jsm");
 
 var gCurrentFolder;
 
 var gFolderDisplay;
 // Although we don't display messages, we have a message display object to
 //  simplify our code.  It's just always disabled.
 var gMessageDisplay;
 
@@ -60,34 +62,37 @@ var nsSearchResultsController = {
   // this controller only handles commands
   // that rely on items being selected in
   // the search results pane.
   isCommandEnabled(command) {
     var enabled = true;
 
     switch (command) {
       case "open_in_folder_button":
-        if (gFolderDisplay.selectedCount != 1)
+        if (gFolderDisplay.selectedCount != 1) {
           enabled = false;
+        }
         break;
       case "cmd_delete":
       case "cmd_shiftDelete":
       case "button_delete":
         // this assumes that advanced searches don't cross accounts
-        if (gFolderDisplay.selectedCount <= 0)
+        if (gFolderDisplay.selectedCount <= 0) {
           enabled = false;
+        }
         break;
       case "saveas_vf_button":
         // need someway to see if there are any search criteria...
         return true;
       case "cmd_selectAll":
         return true;
       default:
-        if (gFolderDisplay.selectedCount <= 0)
+        if (gFolderDisplay.selectedCount <= 0) {
           enabled = false;
+        }
         break;
     }
 
     return enabled;
   },
 
   doCommand(command) {
     switch (command) {
@@ -118,38 +123,35 @@ var nsSearchResultsController = {
         gFolderDisplay.doCommand(Ci.nsMsgViewCommandType.selectAll);
         return true;
 
       default:
         return false;
     }
   },
 
-  onEvent(event) {
-  },
+  onEvent(event) {},
 };
 
 function UpdateMailSearch(caller) {
   document.commandDispatcher.updateCommands("mail-search");
 }
 /**
  * FolderDisplayWidget currently calls this function when the command updater
  *  notification for updateCommandStatus is called.  We don't have a toolbar,
  *  but our 'mail-search' command set serves the same purpose.
  */
 var UpdateMailToolbar = UpdateMailSearch;
 
 /**
  * No-op clear message pane function for FolderDisplayWidget.
  */
-function ClearMessagePane() {
-}
+function ClearMessagePane() {}
 
-function SetAdvancedSearchStatusText(aNumHits) {
-}
+function SetAdvancedSearchStatusText(aNumHits) {}
 
 /**
  * Subclass the FolderDisplayWidget to deal with UI specific to the search
  *  window.
  */
 function SearchFolderDisplayWidget(aMessageDisplay) {
   FolderDisplayWidget.call(this, /* no tab info */ null, aMessageDisplay);
 }
@@ -159,109 +161,128 @@ SearchFolderDisplayWidget.prototype = {
 
   // folder display will want to show the thread pane; we need do nothing
   _showThreadPane() {},
 
   onSearching(aIsSearching) {
     if (aIsSearching) {
       // Search button becomes the "stop" button
       gSearchStopButton.setAttribute(
-        "label", gSearchBundle.getString("labelForStopButton"));
+        "label",
+        gSearchBundle.getString("labelForStopButton")
+      );
       gSearchStopButton.setAttribute(
-        "accesskey", gSearchBundle.getString("labelForStopButton.accesskey"));
+        "accesskey",
+        gSearchBundle.getString("labelForStopButton.accesskey")
+      );
 
       // update our toolbar equivalent
       UpdateMailSearch("new-search");
       // spin the meteors
       gStatusFeedback._startMeteors();
       // tell the user that we're searching
       gStatusFeedback.showStatusString(
-        gSearchBundle.getString("searchingMessage"));
+        gSearchBundle.getString("searchingMessage")
+      );
     } else {
       // Stop button resumes being the "search" button
       gSearchStopButton.setAttribute(
-        "label", gSearchBundle.getString("labelForSearchButton"));
+        "label",
+        gSearchBundle.getString("labelForSearchButton")
+      );
       gSearchStopButton.setAttribute(
-        "accesskey", gSearchBundle.getString("labelForSearchButton.accesskey"));
+        "accesskey",
+        gSearchBundle.getString("labelForSearchButton.accesskey")
+      );
 
       // update our toolbar equivalent
       UpdateMailSearch("done-search");
       // stop spining the meteors
       gStatusFeedback._stopMeteors();
       // set the result test
       this.updateStatusResultText();
     }
   },
 
   /**
    * If messages were removed, we might have lost some search results and so
    *  should update our search result text.  Also, defer to our super-class.
    */
   onMessagesRemoved() {
     // result text is only for when we are not searching
-    if (!this.view.searching)
+    if (!this.view.searching) {
       this.updateStatusResultText();
+    }
     this.__proto__.__proto__.onMessagesRemoved.call(this);
   },
 
   updateStatusResultText() {
     let rowCount = this.view.dbView.rowCount;
     let statusMsg;
 
     if (rowCount == 0) {
       statusMsg = gSearchBundle.getString("noMatchesFound");
     } else {
-      statusMsg = PluralForm.get(rowCount,
-                                 gSearchBundle.getString("matchesFound"));
+      statusMsg = PluralForm.get(
+        rowCount,
+        gSearchBundle.getString("matchesFound")
+      );
       statusMsg = statusMsg.replace("#1", rowCount);
     }
 
     gStatusFeedback.showStatusString(statusMsg);
   },
 };
 
-
 function searchOnLoad() {
   TagUtils.loadTagsIntoCSS(document);
   initializeSearchWidgets();
   initializeSearchWindowWidgets();
   // eslint-disable-next-line no-global-assign
-  messenger = Cc["@mozilla.org/messenger;1"]
-                .createInstance(Ci.nsIMessenger);
+  messenger = Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
 
   gSearchBundle = document.getElementById("bundle_search");
-  gSearchStopButton.setAttribute("label", gSearchBundle.getString("labelForSearchButton"));
-  gSearchStopButton.setAttribute("accesskey", gSearchBundle.getString("labelForSearchButton.accesskey"));
+  gSearchStopButton.setAttribute(
+    "label",
+    gSearchBundle.getString("labelForSearchButton")
+  );
+  gSearchStopButton.setAttribute(
+    "accesskey",
+    gSearchBundle.getString("labelForSearchButton.accesskey")
+  );
 
   gMessageDisplay = new NeverVisibleMessageDisplayWidget();
   gFolderDisplay = new SearchFolderDisplayWidget(gMessageDisplay);
   gFolderDisplay.messenger = messenger;
   gFolderDisplay.msgWindow = msgWindow;
   gFolderDisplay.tree = document.getElementById("threadTree");
 
   // The view is initially unsorted; get the persisted sortDirection column
   // and set up the user's desired sort. This synthetic view is not backed by
   // a db, so secondary sorts and custom columns are not supported here.
   let sortCol = gFolderDisplay.tree.querySelector("[sortDirection]");
   let sortType, sortOrder;
   if (sortCol) {
     sortType = Ci.nsMsgViewSortType[gFolderDisplay.COLUMNS_MAP.get(sortCol.id)];
-    sortOrder = sortCol.getAttribute("sortDirection") == "descending" ?
-                  Ci.nsMsgViewSortOrder.descending : Ci.nsMsgViewSortOrder.ascending;
+    sortOrder =
+      sortCol.getAttribute("sortDirection") == "descending"
+        ? Ci.nsMsgViewSortOrder.descending
+        : Ci.nsMsgViewSortOrder.ascending;
   }
 
   gFolderDisplay.view.openSearchView();
   gFolderDisplay.makeActive();
 
   if (sortType) {
     gFolderDisplay.view.sort(sortType, sortOrder);
   }
 
-  if (window.arguments && window.arguments[0])
+  if (window.arguments && window.arguments[0]) {
     updateSearchFolderPicker(window.arguments[0].folder);
+  }
 
   // Trigger searchTerm.js to create the first criterion.
   onMore(null);
   // Make sure all the buttons are configured.
   UpdateMailSearch("onload");
 }
 
 function searchOnUnload() {
@@ -273,30 +294,30 @@ function searchOnUnload() {
 }
 
 function initializeSearchWindowWidgets() {
   gFolderPicker = document.getElementById("searchableFolders");
   gSearchStopButton = document.getElementById("search-button");
   hideMatchAllItem();
 
   // eslint-disable-next-line no-global-assign
-  msgWindow = Cc["@mozilla.org/messenger/msgwindow;1"]
-                .createInstance(Ci.nsIMsgWindow);
+  msgWindow = Cc["@mozilla.org/messenger/msgwindow;1"].createInstance(
+    Ci.nsIMsgWindow
+  );
   msgWindow.domWindow = window;
   msgWindow.rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_MAIL;
 
   gStatusFeedback = new nsMsgStatusFeedback();
   msgWindow.statusFeedback = gStatusFeedback;
 
   // functionality to enable/disable buttons using nsSearchResultsController
   // depending of whether items are selected in the search results thread pane.
   top.controllers.insertControllerAt(0, nsSearchResultsController);
 }
 
-
 function onSearchStop() {
   gFolderDisplay.view.search.session.interruptSearch();
 }
 
 function onResetSearch(event) {
   onReset(event);
   gFolderDisplay.view.search.clear();
 
@@ -329,17 +350,20 @@ function updateSearchLocalSystem() {
 function UpdateAfterCustomHeaderChange() {
   updateSearchAttributes();
 }
 
 function onEnterInSearchTerm() {
   // on enter
   // if not searching, start the search
   // if searching, stop and then start again
-  if (gSearchStopButton.getAttribute("label") == gSearchBundle.getString("labelForSearchButton")) {
+  if (
+    gSearchStopButton.getAttribute("label") ==
+    gSearchBundle.getString("labelForSearchButton")
+  ) {
     onSearch();
   } else {
     onSearchStop();
     onSearch();
   }
 }
 
 function onSearch() {
@@ -366,76 +390,84 @@ function getSearchTerms() {
   for (let iTerm = 0; iTerm < gSearchTerms.length; iTerm++) {
     let termWrapper = gSearchTerms[iTerm].obj;
     let realTerm = termCreator.createTerm();
     termWrapper.saveTo(realTerm);
     // A header search of "" is illegal for IMAP and will cause us to
     //  explode.  You don't want that and I don't want that.  So let's check
     //  if the bloody term is a subject search on a blank string, and if it
     //  is, let's secretly not add the term.  Everyone wins!
-    if ((realTerm.attrib != Ci.nsMsgSearchAttrib.Subject) ||
-        (realTerm.value.str != ""))
+    if (
+      realTerm.attrib != Ci.nsMsgSearchAttrib.Subject ||
+      realTerm.value.str != ""
+    ) {
       searchTerms.push(realTerm);
+    }
   }
 
   return searchTerms;
 }
 
 /**
  * @return the list of folders the search should cover.
  */
 function getSearchFolders() {
   let searchFolders = [];
 
-  if (!gCurrentFolder.isServer && !gCurrentFolder.noSelect)
+  if (!gCurrentFolder.isServer && !gCurrentFolder.noSelect) {
     searchFolders.push(gCurrentFolder);
+  }
 
-  var searchSubfolders =
-    document.getElementById("checkSearchSubFolders").checked;
-  if (gCurrentFolder &&
-      (searchSubfolders || gCurrentFolder.isServer || gCurrentFolder.noSelect))
+  var searchSubfolders = document.getElementById("checkSearchSubFolders")
+    .checked;
+  if (
+    gCurrentFolder &&
+    (searchSubfolders || gCurrentFolder.isServer || gCurrentFolder.noSelect)
+  ) {
     AddSubFolders(gCurrentFolder, searchFolders);
+  }
 
   return searchFolders;
 }
 
 function AddSubFolders(folder, outFolders) {
   var subFolders = folder.subFolders;
   while (subFolders.hasMoreElements()) {
-    var nextFolder =
-      subFolders.getNext().QueryInterface(Ci.nsIMsgFolder);
+    var nextFolder = subFolders.getNext().QueryInterface(Ci.nsIMsgFolder);
 
     if (!(nextFolder.flags & Ci.nsMsgFolderFlags.Virtual)) {
-      if (!nextFolder.noSelect)
+      if (!nextFolder.noSelect) {
         outFolders.push(nextFolder);
+      }
 
       AddSubFolders(nextFolder, outFolders);
     }
   }
 }
 
 function AddSubFoldersToURI(folder) {
   var returnString = "";
 
   var subFolders = folder.subFolders;
 
   while (subFolders.hasMoreElements()) {
-    var nextFolder =
-      subFolders.getNext().QueryInterface(Ci.nsIMsgFolder);
+    var nextFolder = subFolders.getNext().QueryInterface(Ci.nsIMsgFolder);
 
     if (!(nextFolder.flags & Ci.nsMsgFolderFlags.Virtual)) {
       if (!nextFolder.noSelect && !nextFolder.isServer) {
-        if (returnString.length > 0)
+        if (returnString.length > 0) {
           returnString += "|";
+        }
         returnString += nextFolder.URI;
       }
       var subFoldersString = AddSubFoldersToURI(nextFolder);
       if (subFoldersString.length > 0) {
-        if (returnString.length > 0)
+        if (returnString.length > 0) {
           returnString += "|";
+        }
         returnString += subFoldersString;
       }
     }
   }
   return returnString;
 }
 
 /**
@@ -470,99 +502,117 @@ function GetScopeForFolder(folder) {
 
   let hasBody = folder.getFlag(Ci.nsMsgFolderFlags.Offline);
   let nsMsgSearchScope = Ci.nsMsgSearchScope;
   switch (localType) {
     case "news":
       // News has four offline scopes, depending on whether junk and body
       // are available.
       let hasJunk =
-        folder.getInheritedStringProperty("dobayes.mailnews@mozilla.org#junk")
-               == "true";
-      if (hasJunk && hasBody)
+        folder.getInheritedStringProperty(
+          "dobayes.mailnews@mozilla.org#junk"
+        ) == "true";
+      if (hasJunk && hasBody) {
         return nsMsgSearchScope.localNewsJunkBody;
-      if (hasJunk) // and no body
+      }
+      if (hasJunk) {
+        // and no body
         return nsMsgSearchScope.localNewsJunk;
-      if (hasBody) // and no junk
+      }
+      if (hasBody) {
+        // and no junk
         return nsMsgSearchScope.localNewsBody;
+      }
       // We don't have offline message bodies or junk processing.
       return nsMsgSearchScope.localNews;
 
     case "imap":
       // Junk is always enabled for imap, so the offline scope only depends on
       // whether the body is available.
 
       // If we are the root folder, use the server property for body rather
       // than the folder property.
       if (folder.isServer) {
-        let imapServer = folder.server
-                               .QueryInterface(Ci.nsIImapIncomingServer);
-        if (imapServer && imapServer.offlineDownload)
+        let imapServer = folder.server.QueryInterface(Ci.nsIImapIncomingServer);
+        if (imapServer && imapServer.offlineDownload) {
           hasBody = true;
+        }
       }
 
-      if (!hasBody)
+      if (!hasBody) {
         return nsMsgSearchScope.onlineManual;
-        // fall through to default
+      }
+    // fall through to default
     default:
       return nsMsgSearchScope.offlineMail;
   }
 }
 
 function goUpdateSearchItems(commandset) {
   for (var i = 0; i < commandset.childNodes.length; i++) {
     var commandID = commandset.childNodes[i].getAttribute("id");
     if (commandID) {
       goUpdateCommand(commandID);
     }
   }
 }
 
 // used to toggle functionality for Search/Stop button.
 function onSearchButton(event) {
-  if (event.target.label == gSearchBundle.getString("labelForSearchButton"))
+  if (event.target.label == gSearchBundle.getString("labelForSearchButton")) {
     onSearch();
-  else
+  } else {
     onSearchStop();
+  }
 }
 
 function MsgDeleteSelectedMessages(aCommandType) {
   gFolderDisplay.hintAboutToDeleteMessages();
   gFolderDisplay.doCommand(aCommandType);
 }
 
 /**
  * Move selected messages to the destination folder
  *
  * @param destFolder {nsIMsgFolder}  destination folder
  */
 function MoveMessageInSearch(destFolder) {
   gFolderDisplay.hintAboutToDeleteMessages();
-  gFolderDisplay.doCommandWithFolder(Ci.nsMsgViewCommandType.moveMessages,
-                                     destFolder);
+  gFolderDisplay.doCommandWithFolder(
+    Ci.nsMsgViewCommandType.moveMessages,
+    destFolder
+  );
 }
 
 function OpenInFolder() {
   MailUtils.displayMessageInFolderTab(gFolderDisplay.selectedMessage);
 }
 
 function saveAsVirtualFolder() {
   var searchFolderURIs = gCurrentFolder.URI;
 
-  var searchSubfolders = document.getElementById("checkSearchSubFolders").checked;
-  if (gCurrentFolder && (searchSubfolders || gCurrentFolder.isServer || gCurrentFolder.noSelect)) {
+  var searchSubfolders = document.getElementById("checkSearchSubFolders")
+    .checked;
+  if (
+    gCurrentFolder &&
+    (searchSubfolders || gCurrentFolder.isServer || gCurrentFolder.noSelect)
+  ) {
     var subFolderURIs = AddSubFoldersToURI(gCurrentFolder);
-    if (subFolderURIs.length > 0)
+    if (subFolderURIs.length > 0) {
       searchFolderURIs += "|" + subFolderURIs;
+    }
   }
 
   var searchOnline = document.getElementById("checkSearchOnline");
   var doOnlineSearch = searchOnline.checked && !searchOnline.disabled;
 
-  window.openDialog("chrome://messenger/content/virtualFolderProperties.xul", "",
-                    "chrome,titlebar,modal,centerscreen",
-                    {
-                      folder: window.arguments[0].folder,
-                      searchTerms: getSearchTerms(),
-                      searchFolderURIs,
-                      searchOnline: doOnlineSearch,
-                    });
+  window.openDialog(
+    "chrome://messenger/content/virtualFolderProperties.xul",
+    "",
+    "chrome,titlebar,modal,centerscreen",
+    {
+      folder: window.arguments[0].folder,
+      searchTerms: getSearchTerms(),
+      searchFolderURIs,
+      searchOnline: doOnlineSearch,
+    }
+  );
 }
--- a/mail/base/content/aboutAddonsExtra.js
+++ b/mail/base/content/aboutAddonsExtra.js
@@ -1,76 +1,98 @@
 /* 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/. */
 
 /* import-globals-from ../../../../toolkit/mozapps/extensions/content/aboutaddons.js */
 
-var {ExtensionSupport} = ChromeUtils.import("resource:///modules/ExtensionSupport.jsm");
-var {BrowserUtils} = ChromeUtils.import("resource://gre/modules/BrowserUtils.jsm");
+var { ExtensionSupport } = ChromeUtils.import(
+  "resource:///modules/ExtensionSupport.jsm"
+);
+var { BrowserUtils } = ChromeUtils.import(
+  "resource://gre/modules/BrowserUtils.jsm"
+);
 
-var mailExtBundle = Services.strings.createBundle("chrome://messenger/locale/extensionsOverlay.properties");
+var mailExtBundle = Services.strings.createBundle(
+  "chrome://messenger/locale/extensionsOverlay.properties"
+);
 var extensionsNeedingRestart = new Set();
 
 /* This file runs in both the outer window, which controls the categories list, search bar, etc.,
  * and the inner window which is the list of add-ons or the detail view. */
 (async function() {
   if (window.location.href == "about:addons") {
     let contentStylesheet = document.createProcessingInstruction(
       "xml-stylesheet",
-      'href="chrome://messenger/content/aboutAddonsExtra.css" type="text/css"');
+      'href="chrome://messenger/content/aboutAddonsExtra.css" type="text/css"'
+    );
     document.insertBefore(contentStylesheet, document.documentElement);
 
     // Add navigation buttons for back and forward on the addons page.
     let hbox = document.createXULElement("hbox");
     hbox.setAttribute("id", "nav-header");
     hbox.setAttribute("align", "center");
     hbox.setAttribute("pack", "center");
 
     let backButton = document.createXULElement("toolbarbutton");
     backButton.setAttribute("id", "back-btn");
     backButton.setAttribute("class", "nav-button");
     backButton.setAttribute("command", "cmd_back");
-    backButton.setAttribute("tooltiptext", mailExtBundle.GetStringFromName("cmdBackTooltip"));
+    backButton.setAttribute(
+      "tooltiptext",
+      mailExtBundle.GetStringFromName("cmdBackTooltip")
+    );
     backButton.setAttribute("disabled", "true");
 
     let forwardButton = document.createXULElement("toolbarbutton");
     forwardButton.setAttribute("id", "forward-btn");
     forwardButton.setAttribute("class", "nav-button");
     forwardButton.setAttribute("command", "cmd_forward");
-    forwardButton.setAttribute("tooltiptext", mailExtBundle.GetStringFromName("cmdForwardTooltip"));
+    forwardButton.setAttribute(
+      "tooltiptext",
+      mailExtBundle.GetStringFromName("cmdForwardTooltip")
+    );
     forwardButton.setAttribute("disabled", "true");
     hbox.appendChild(backButton);
     hbox.appendChild(forwardButton);
 
-    document.getElementById("category-box")
-            .insertBefore(hbox, document.getElementById("categories"));
+    document
+      .getElementById("category-box")
+      .insertBefore(hbox, document.getElementById("categories"));
 
     // Fix the "Search on addons.mozilla.org" placeholder text in the searchbox.
     let textbox = document.getElementById("header-search");
     let placeholder = textbox.getAttribute("placeholder");
-    placeholder = placeholder.replace("addons.mozilla.org", "addons.thunderbird.net");
+    placeholder = placeholder.replace(
+      "addons.mozilla.org",
+      "addons.thunderbird.net"
+    );
     textbox.setAttribute("placeholder", placeholder);
     return;
   }
 
-  window.isCorrectlySigned = function() { return true; };
+  window.isCorrectlySigned = function() {
+    return true;
+  };
 
   delete window.browserBundle;
-  window.browserBundle = Services.strings.createBundle("chrome://messenger/locale/addons.properties");
+  window.browserBundle = Services.strings.createBundle(
+    "chrome://messenger/locale/addons.properties"
+  );
 
   let _getAddonMessageInfo = getAddonMessageInfo;
   getAddonMessageInfo = async function(addon) {
     let result = await _getAddonMessageInfo(addon);
     if (!result.message) {
       let { stringName } = getTrueState(addon, "gDetailView._addon");
       if (stringName) {
-        result.message = mailExtBundle.formatStringFromName(
-          stringName, [addon.name, brandBundle.GetStringFromName("brandShortName")]
-        );
+        result.message = mailExtBundle.formatStringFromName(stringName, [
+          addon.name,
+          brandBundle.GetStringFromName("brandShortName"),
+        ]);
         result.type = "success";
         extensionsNeedingRestart.add(addon.id);
       } else {
         extensionsNeedingRestart.delete(addon.id);
       }
       setRestartBar();
     }
     return result;
@@ -86,17 +108,19 @@ var extensionsNeedingRestart = new Set()
     onUninstalled(addon) {
       if (ExtensionSupport.loadedLegacyExtensions.hasAnyState(addon.id)) {
         extensionsNeedingRestart.add(addon.id);
         setRestartBar();
       }
     },
   };
   AddonManager.addAddonListener(listener);
-  window.addEventListener("unload", () => AddonManager.removeAddonListener(listener));
+  window.addEventListener("unload", () =>
+    AddonManager.removeAddonListener(listener)
+  );
 
   // If a legacy extension has been removed, it needs a restart but is not in the list
   // - show the restart bar anyway.
   let removed = await ExtensionSupport.loadedLegacyExtensions.listRemoved();
   for (let removedExtension of removed) {
     extensionsNeedingRestart.add(removedExtension.id);
   }
   setRestartBar();
@@ -120,17 +144,18 @@ function setRestartBar() {
   }
 
   restartBar = document.createElement("message-bar");
   restartBar.id = "restartBar";
   restartBar.setAttribute("type", "warning");
 
   const message = document.createElement("span");
   message.textContent = mailExtBundle.formatStringFromName(
-    "globalRestartMessage", [brandBundle.GetStringFromName("brandShortName")]
+    "globalRestartMessage",
+    [brandBundle.GetStringFromName("brandShortName")]
   );
 
   const restart = document.createElement("button");
   restart.textContent = mailExtBundle.GetStringFromName("globalRestartButton");
   restart.addEventListener("click", () => {
     BrowserUtils.restartApplication();
   });
 
@@ -150,18 +175,20 @@ function setRestartBar() {
 function getTrueState(addon) {
   let state = ExtensionSupport.loadedLegacyExtensions.get(addon.id);
   let returnObject = {};
 
   if (!state) {
     return returnObject;
   }
 
-  if (addon.pendingOperations & AddonManager.PENDING_UNINSTALL &&
-      ExtensionSupport.loadedLegacyExtensions.has(addon.id)) {
+  if (
+    addon.pendingOperations & AddonManager.PENDING_UNINSTALL &&
+    ExtensionSupport.loadedLegacyExtensions.has(addon.id)
+  ) {
     returnObject.stringName = "warnLegacyUninstall";
     returnObject.undoFunction = addon.cancelUninstall;
   } else if (state.pendingOperation == "install") {
     returnObject.stringName = "warnLegacyInstall";
     returnObject.undoFunction = addon.uninstall;
   } else if (addon.userDisabled) {
     returnObject.stringName = "warnLegacyDisable";
     returnObject.undoFunction = addon.enable;
--- a/mail/base/content/aboutDialog-appUpdater.js
+++ b/mail/base/content/aboutDialog-appUpdater.js
@@ -1,61 +1,80 @@
 /* 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/. */
 
 // Note: this file is included in aboutDialog.xul and preferences/advanced.xul
 // if MOZ_UPDATER is defined.
 
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-var {DownloadUtils} = ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
+var { DownloadUtils } = ChromeUtils.import(
+  "resource://gre/modules/DownloadUtils.jsm"
+);
 
-ChromeUtils.defineModuleGetter(this, "UpdateUtils",
-                               "resource://gre/modules/UpdateUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "UpdateUtils",
+  "resource://gre/modules/UpdateUtils.jsm"
+);
 
 const PREF_APP_UPDATE_CANCELATIONS_OSX = "app.update.cancelations.osx";
-const PREF_APP_UPDATE_ELEVATE_NEVER    = "app.update.elevate.never";
+const PREF_APP_UPDATE_ELEVATE_NEVER = "app.update.elevate.never";
 
 var gAppUpdater;
 
 function onUnload(aEvent) {
   if (gAppUpdater) {
-    if (gAppUpdater.isChecking)
+    if (gAppUpdater.isChecking) {
       gAppUpdater.checker.stopCurrentCheck();
+    }
     // Safe to call even when there isn't a download in progress.
     gAppUpdater.removeDownloadListener();
     gAppUpdater = null;
   }
 }
 
-
 function appUpdater(options = {}) {
-  XPCOMUtils.defineLazyServiceGetter(this, "aus",
-                                     "@mozilla.org/updates/update-service;1",
-                                     "nsIApplicationUpdateService");
-  XPCOMUtils.defineLazyServiceGetter(this, "checker",
-                                     "@mozilla.org/updates/update-checker;1",
-                                     "nsIUpdateChecker");
-  XPCOMUtils.defineLazyServiceGetter(this, "um",
-                                     "@mozilla.org/updates/update-manager;1",
-                                     "nsIUpdateManager");
+  XPCOMUtils.defineLazyServiceGetter(
+    this,
+    "aus",
+    "@mozilla.org/updates/update-service;1",
+    "nsIApplicationUpdateService"
+  );
+  XPCOMUtils.defineLazyServiceGetter(
+    this,
+    "checker",
+    "@mozilla.org/updates/update-checker;1",
+    "nsIUpdateChecker"
+  );
+  XPCOMUtils.defineLazyServiceGetter(
+    this,
+    "um",
+    "@mozilla.org/updates/update-manager;1",
+    "nsIUpdateManager"
+  );
 
   this.options = options;
   this.updateDeck = document.getElementById("updateDeck");
   this.promiseAutoUpdateSetting = null;
 
-  this.bundle = Services.strings.
-                createBundle("chrome://messenger/locale/messenger.properties");
+  this.bundle = Services.strings.createBundle(
+    "chrome://messenger/locale/messenger.properties"
+  );
 
   let manualURL = Services.urlFormatter.formatURLPref("app.update.url.manual");
-  document.getElementById("manualLink")
-          .setAttribute("onclick", 'openURL("' + manualURL + '");');
-  document.getElementById("failedLink")
-          .setAttribute("onclick", 'openURL("' + manualURL + '");');
+  document
+    .getElementById("manualLink")
+    .setAttribute("onclick", 'openURL("' + manualURL + '");');
+  document
+    .getElementById("failedLink")
+    .setAttribute("onclick", 'openURL("' + manualURL + '");');
 
   if (this.updateDisabledByPolicy) {
     this.selectPanel("policyDisabled");
     return;
   }
 
   if (this.isReadyForRestart) {
     this.selectPanel("apply");
@@ -92,34 +111,42 @@ function appUpdater(options = {}) {
 
 appUpdater.prototype = {
   // true when there is an update check in progress.
   isChecking: false,
 
   // true when there is an update ready to be applied on restart or staged.
   get isPending() {
     if (this.update) {
-      return this.update.state == "pending" ||
-             this.update.state == "pending-service" ||
-             this.update.state == "pending-elevate";
+      return (
+        this.update.state == "pending" ||
+        this.update.state == "pending-service" ||
+        this.update.state == "pending-elevate"
+      );
     }
-    return this.um.activeUpdate &&
-           (this.um.activeUpdate.state == "pending" ||
-            this.um.activeUpdate.state == "pending-service" ||
-            this.um.activeUpdate.state == "pending-elevate");
+    return (
+      this.um.activeUpdate &&
+      (this.um.activeUpdate.state == "pending" ||
+        this.um.activeUpdate.state == "pending-service" ||
+        this.um.activeUpdate.state == "pending-elevate")
+    );
   },
 
   // true when there is an update already staged.
   get isApplied() {
-    if (this.update)
-      return this.update.state == "applied" ||
-             this.update.state == "applied-service";
-    return this.um.activeUpdate &&
-           (this.um.activeUpdate.state == "applied" ||
-            this.um.activeUpdate.state == "applied-service");
+    if (this.update) {
+      return (
+        this.update.state == "applied" || this.update.state == "applied-service"
+      );
+    }
+    return (
+      this.um.activeUpdate &&
+      (this.um.activeUpdate.state == "applied" ||
+        this.um.activeUpdate.state == "applied-service")
+    );
   },
 
   get isStaging() {
     if (!this.updateStagingEnabled) {
       return false;
     }
     let errorCode;
     if (this.update) {
@@ -146,31 +173,30 @@ appUpdater.prototype = {
       // without staging.
       return this.isApplied || (this.isPending && errorCode != 0);
     }
     return this.isPending;
   },
 
   // true when there is an update download in progress.
   get isDownloading() {
-    if (this.update)
+    if (this.update) {
       return this.update.state == "downloading";
-    return this.um.activeUpdate &&
-           this.um.activeUpdate.state == "downloading";
+    }
+    return this.um.activeUpdate && this.um.activeUpdate.state == "downloading";
   },
 
   // true when updating has been disabled by enterprise policy
   get updateDisabledByPolicy() {
     return Services.policies && !Services.policies.isAllowed("appUpdate");
   },
 
   // true when updating in background is enabled.
   get updateStagingEnabled() {
-    return !this.updateDisabledByPolicy &&
-           this.aus.canStageUpdates;
+    return !this.updateDisabledByPolicy && this.aus.canStageUpdates;
   },
 
   /**
    * Sets the panel of the updateDeck.
    *
    * @param  aChildID
    *         The id of the deck's child to select, e.g. "apply".
    */
@@ -184,23 +210,31 @@ appUpdater.prototype = {
         // Include the build ID if this is an "a#" (nightly or aurora) build
         if (/a\d+$/.test(updateVersion)) {
           let buildID = gAppUpdater.update.buildID;
           let year = buildID.slice(0, 4);
           let month = buildID.slice(4, 6);
           let day = buildID.slice(6, 8);
           updateVersion += ` (${year}-${month}-${day})`;
         }
-        button.label = this.bundle.formatStringFromName("update.downloadAndInstallButton.label", [updateVersion]);
-        button.accessKey = this.bundle.GetStringFromName("update.downloadAndInstallButton.accesskey");
+        button.label = this.bundle.formatStringFromName(
+          "update.downloadAndInstallButton.label",
+          [updateVersion]
+        );
+        button.accessKey = this.bundle.GetStringFromName(
+          "update.downloadAndInstallButton.accesskey"
+        );
       }
       this.updateDeck.selectedPanel = panel;
-      if (this.options.buttonAutoFocus &&
-          (!document.commandDispatcher.focusedElement || // don't steal the focus
-           document.commandDispatcher.focusedElement.localName == "button")) { // except from the other buttons
+      if (
+        this.options.buttonAutoFocus &&
+        (!document.commandDispatcher.focusedElement || // don't steal the focus
+          document.commandDispatcher.focusedElement.localName == "button")
+      ) {
+        // except from the other buttons
         button.focus();
       }
     } else {
       this.updateDeck.selectedPanel = panel;
     }
   },
 
   /**
@@ -227,34 +261,40 @@ appUpdater.prototype = {
   buttonRestartAfterDownload() {
     if (!this.isReadyForRestart) {
       return;
     }
 
     gAppUpdater.selectPanel("restarting");
 
     // Notify all windows that an application quit has been requested.
-    let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
-                     createInstance(Ci.nsISupportsPRBool);
-    Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
+    let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(
+      Ci.nsISupportsPRBool
+    );
+    Services.obs.notifyObservers(
+      cancelQuit,
+      "quit-application-requested",
+      "restart"
+    );
 
     // Something aborted the quit process.
     if (cancelQuit.data) {
       gAppUpdater.selectPanel("apply");
       return;
     }
 
     // If already in safe mode restart in safe mode (bug 327119)
     if (Services.appinfo.inSafeMode) {
       Services.startup.restartInSafeMode(Ci.nsIAppStartup.eAttemptQuit);
       return;
     }
 
-    Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit |
-                          Ci.nsIAppStartup.eRestart);
+    Services.startup.quit(
+      Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart
+    );
   },
 
   /**
    * Implements nsIUpdateCheckListener. The methods implemented by
    * nsIUpdateCheckListener are in a different scope from nsIIncrementalDownload
    * to make it clear which are used by each interface.
    */
   updateCheckListener: {
@@ -266,37 +306,40 @@ appUpdater.prototype = {
       gAppUpdater.update = gAppUpdater.aus.selectUpdate(aUpdates);
       if (!gAppUpdater.update) {
         gAppUpdater.selectPanel("noUpdatesFound");
         return;
       }
 
       if (gAppUpdater.update.unsupported) {
         let unsupportedLink = document.getElementById("unsupportedLink");
-        if (gAppUpdater.update.detailsURL)
+        if (gAppUpdater.update.detailsURL) {
           unsupportedLink.href = gAppUpdater.update.detailsURL;
-        else
+        } else {
           unsupportedLink.setAttribute("hidden", true);
+        }
 
         gAppUpdater.selectPanel("unsupportedSystem");
         return;
       }
 
       if (!gAppUpdater.aus.canApplyUpdates) {
         gAppUpdater.selectPanel("manualUpdate");
         return;
       }
 
       if (!gAppUpdater.promiseAutoUpdateSetting) {
         gAppUpdater.promiseAutoUpdateSetting = UpdateUtils.getAppUpdateAutoEnabled();
       }
       gAppUpdater.promiseAutoUpdateSetting.then(updateAuto => {
-        if (updateAuto) { // automatically download and install
+        if (updateAuto) {
+          // automatically download and install
           gAppUpdater.startDownload();
-        } else { // ask
+        } else {
+          // ask
           gAppUpdater.selectPanel("downloadAndInstall");
         }
       });
     },
 
     /**
      * See nsIUpdateService.idl
      */
@@ -313,30 +356,32 @@ appUpdater.prototype = {
      */
     QueryInterface: ChromeUtils.generateQI(["nsIUpdateCheckListener"]),
   },
 
   /**
    * Shows the applying UI until the update has finished staging
    */
   waitForUpdateToStage() {
-    if (!this.update)
+    if (!this.update) {
       this.update = this.um.activeUpdate;
+    }
     this.update.QueryInterface(Ci.nsIWritablePropertyBag);
     this.update.setProperty("foregroundDownload", "true");
     this.selectPanel("applying");
     this.updateUIWhenStagingComplete();
   },
 
   /**
    * Starts the download of an update mar.
    */
   startDownload() {
-    if (!this.update)
+    if (!this.update) {
       this.update = this.um.activeUpdate;
+    }
     this.update.QueryInterface(Ci.nsIWritablePropertyBag);
     this.update.setProperty("foregroundDownload", "true");
 
     let state = this.aus.downloadUpdate(this.update, false);
     if (state == "failed") {
       this.selectPanel("downloadFailed");
       return;
     }
@@ -344,98 +389,106 @@ appUpdater.prototype = {
     this.setupDownloadingUI();
   },
 
   /**
    * Switches to the UI responsible for tracking the download.
    */
   setupDownloadingUI() {
     this.downloadStatus = document.getElementById("downloadStatus");
-    this.downloadStatus.value =
-      DownloadUtils.getTransferTotal(0, this.update.selectedPatch.size);
+    this.downloadStatus.value = DownloadUtils.getTransferTotal(
+      0,
+      this.update.selectedPatch.size
+    );
     this.selectPanel("downloading");
     this.aus.addDownloadListener(this);
   },
 
   removeDownloadListener() {
     if (this.aus) {
       this.aus.removeDownloadListener(this);
     }
   },
 
   /**
    * See nsIRequestObserver.idl
    */
-  onStartRequest(aRequest) {
-  },
+  onStartRequest(aRequest) {},
 
   /**
    * See nsIRequestObserver.idl
    */
   onStopRequest(aRequest, aStatusCode) {
     switch (aStatusCode) {
-    case Cr.NS_ERROR_UNEXPECTED:
-      if (this.update.selectedPatch.state == "download-failed" &&
-          (this.update.isCompleteUpdate || this.update.patchCount != 2)) {
-        // Verification error of complete patch, informational text is held in
-        // the update object.
+      case Cr.NS_ERROR_UNEXPECTED:
+        if (
+          this.update.selectedPatch.state == "download-failed" &&
+          (this.update.isCompleteUpdate || this.update.patchCount != 2)
+        ) {
+          // Verification error of complete patch, informational text is held in
+          // the update object.
+          this.removeDownloadListener();
+          this.selectPanel("downloadFailed");
+          break;
+        }
+        // Verification failed for a partial patch, complete patch is now
+        // downloading so return early and do NOT remove the download listener!
+        break;
+      case Cr.NS_BINDING_ABORTED:
+        // Do not remove UI listener since the user may resume downloading again.
+        break;
+      case Cr.NS_OK:
+        this.removeDownloadListener();
+        if (this.updateStagingEnabled) {
+          this.selectPanel("applying");
+          this.updateUIWhenStagingComplete();
+        } else {
+          this.selectPanel("apply");
+        }
+        break;
+      default:
         this.removeDownloadListener();
         this.selectPanel("downloadFailed");
         break;
-      }
-      // Verification failed for a partial patch, complete patch is now
-      // downloading so return early and do NOT remove the download listener!
-      break;
-    case Cr.NS_BINDING_ABORTED:
-      // Do not remove UI listener since the user may resume downloading again.
-      break;
-    case Cr.NS_OK:
-      this.removeDownloadListener();
-      if (this.updateStagingEnabled) {
-        this.selectPanel("applying");
-        this.updateUIWhenStagingComplete();
-      } else {
-        this.selectPanel("apply");
-      }
-      break;
-    default:
-      this.removeDownloadListener();
-      this.selectPanel("downloadFailed");
-      break;
     }
   },
 
   /**
    * See nsIProgressEventSink.idl
    */
-  onStatus(aRequest, aContext, aStatus, aStatusArg) {
-  },
+  onStatus(aRequest, aContext, aStatus, aStatusArg) {},
 
   /**
    * See nsIProgressEventSink.idl
    */
   onProgress(aRequest, aContext, aProgress, aProgressMax) {
-    this.downloadStatus.value =
-      DownloadUtils.getTransferTotal(aProgress, aProgressMax);
+    this.downloadStatus.value = DownloadUtils.getTransferTotal(
+      aProgress,
+      aProgressMax
+    );
   },
 
   /**
    * This function registers an observer that watches for the staging process
    * to complete. Once it does, it updates the UI to either request that the
    * user restarts to install the update on success, request that the user
    * manually download and install the newer version, or automatically download
    * a complete update if applicable.
    */
   updateUIWhenStagingComplete() {
     let observer = (aSubject, aTopic, aData) => {
       // Update the UI when the background updater is finished
       let status = aData;
-      if (status == "applied" || status == "applied-service" ||
-          status == "pending" || status == "pending-service" ||
-          status == "pending-elevate") {
+      if (
+        status == "applied" ||
+        status == "applied-service" ||
+        status == "pending" ||
+        status == "pending-service" ||
+        status == "pending-elevate"
+      ) {
         // If the update is successfully applied, or if the updater has
         // fallen back to non-staged updates, show the "Restart to Update"
         // button.
         this.selectPanel("apply");
       } else if (status == "failed") {
         // Background update has failed, let's show the UI responsible for
         // prompting the user to update manually.
         this.selectPanel("downloadFailed");
@@ -449,10 +502,13 @@ appUpdater.prototype = {
       Services.obs.removeObserver(observer, "update-staged");
     };
     Services.obs.addObserver(observer, "update-staged");
   },
 
   /**
    * See nsISupports.idl
    */
-  QueryInterface: ChromeUtils.generateQI(["nsIProgressEventSink", "nsIRequestObserver"]),
+  QueryInterface: ChromeUtils.generateQI([
+    "nsIProgressEventSink",
+    "nsIRequestObserver",
+  ]),
 };
--- a/mail/base/content/aboutDialog.js
+++ b/mail/base/content/aboutDialog.js
@@ -2,36 +2,41 @@
  * 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/. */
 
 /* import-globals-from aboutDialog-appUpdater.js */
 
 "use strict";
 
 // Services = object with smart getters for common XPCOM services
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { AppConstants } = ChromeUtils.import(
+  "resource://gre/modules/AppConstants.jsm"
+);
 
 function init(aEvent) {
-  if (aEvent.target != document)
+  if (aEvent.target != document) {
     return;
+  }
 
   try {
     var distroId = Services.prefs.getCharPref("distribution.id");
     if (distroId) {
       var distroVersion = Services.prefs.getCharPref("distribution.version");
 
       var distroIdField = document.getElementById("distributionId");
       distroIdField.value = distroId + " - " + distroVersion;
       distroIdField.style.display = "block";
 
       try {
         // This is in its own try catch due to bug 895473 and bug 900925.
-        var distroAbout = Services.prefs.getComplexValue("distribution.about",
-          Ci.nsISupportsString);
+        var distroAbout = Services.prefs.getComplexValue(
+          "distribution.about",
+          Ci.nsISupportsString
+        );
         var distroField = document.getElementById("distribution");
         distroField.value = distroAbout;
         distroField.style.display = "block";
       } catch (ex) {
         // Pref is unset
         Cu.reportError(ex);
       }
     }
@@ -50,29 +55,33 @@ function init(aEvent) {
     let day = buildID.slice(6, 8);
     versionField.textContent += ` (${year}-${month}-${day})`;
 
     document.getElementById("experimental").hidden = false;
     document.getElementById("communityDesc").hidden = true;
   }
 
   // Append "(32-bit)" or "(64-bit)" build architecture to the version number:
-  let bundle = Services.strings.createBundle("chrome://messenger/locale/messenger.properties");
+  let bundle = Services.strings.createBundle(
+    "chrome://messenger/locale/messenger.properties"
+  );
   let archResource = Services.appinfo.is64Bit
-                     ? "aboutDialog.architecture.sixtyFourBit"
-                     : "aboutDialog.architecture.thirtyTwoBit";
+    ? "aboutDialog.architecture.sixtyFourBit"
+    : "aboutDialog.architecture.thirtyTwoBit";
   let arch = bundle.GetStringFromName(archResource);
   versionField.textContent += ` (${arch})`;
 
   if (!AppConstants.NIGHTLY_BUILD) {
     // Show a release notes link if we have a URL.
     let relNotesLink = document.getElementById("releasenotes");
     let relNotesPrefType = Services.prefs.getPrefType("app.releaseNotesURL");
     if (relNotesPrefType != Services.prefs.PREF_INVALID) {
-      let relNotesURL = Services.urlFormatter.formatURLPref("app.releaseNotesURL");
+      let relNotesURL = Services.urlFormatter.formatURLPref(
+        "app.releaseNotesURL"
+      );
       if (relNotesURL != "about:blank") {
         relNotesLink.href = relNotesURL;
         relNotesLink.hidden = false;
       }
     }
   }
 
   if (AppConstants.MOZ_UPDATER) {
@@ -81,38 +90,52 @@ function init(aEvent) {
     let defaults = Services.prefs.getDefaultBranch("");
     let channelLabel = document.getElementById("currentChannel");
     channelLabel.value = defaults.getCharPref("app.update.channel");
   }
 
   window.sizeToContent();
 
   if (AppConstants.platform == "macosx") {
-    window.moveTo((screen.availWidth / 2) - (window.outerWidth / 2), screen.availHeight / 5);
+    window.moveTo(
+      screen.availWidth / 2 - window.outerWidth / 2,
+      screen.availHeight / 5
+    );
   }
 }
 
 // This function is used to open about: tabs. The caller should ensure the url
 // is only an about: url.
 function openAboutTab(url) {
   // Check existing windows
   let mailWindow = Services.wm.getMostRecentWindow("mail:3pane");
   if (mailWindow) {
     mailWindow.focus();
-    mailWindow.document.getElementById("tabmail")
-              .openTab("contentTab", {contentPage: url,
-                                      clickHandler: "specialTabs.aboutClickHandler(event);"});
+    mailWindow.document.getElementById("tabmail").openTab("contentTab", {
+      contentPage: url,
+      clickHandler: "specialTabs.aboutClickHandler(event);",
+    });
     return;
   }
 
   // No existing windows.
-  window.openDialog("chrome://messenger/content/", "_blank",
-                    "chrome,dialog=no,all", null,
-                    { tabType: "contentTab",
-                      tabParams: {contentPage: url, clickHandler: "specialTabs.aboutClickHandler(event);"} });
+  window.openDialog(
+    "chrome://messenger/content/",
+    "_blank",
+    "chrome,dialog=no,all",
+    null,
+    {
+      tabType: "contentTab",
+      tabParams: {
+        contentPage: url,
+        clickHandler: "specialTabs.aboutClickHandler(event);",
+      },
+    }
+  );
 }
 
 function openLink(url) {
-  let m = ("messenger" in window) ? window.messenger :
-    Cc["@mozilla.org/messenger;1"]
-      .createInstance(Ci.nsIMessenger);
+  let m =
+    "messenger" in window
+      ? window.messenger
+      : Cc["@mozilla.org/messenger;1"].createInstance(Ci.nsIMessenger);
   m.launchExternalURL(url);
 }
--- a/mail/base/content/browserRequest.js
+++ b/mail/base/content/browserRequest.js
@@ -3,54 +3,62 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var wpl = Ci.nsIWebProgressListener;
 
 var reporterListener = {
   _isBusy: false,
   get securityButton() {
     delete this.securityButton;
-    return this.securityButton = document.getElementById("security-button");
-  },
-
-  QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
-                                          "nsISupportsWeakReference"]),
-
-  onStateChange(/* in nsIWebProgress*/ aWebProgress,
-                /* in nsIRequest*/ aRequest,
-                /* in unsigned long*/ aStateFlags,
-                /* in nsresult*/ aStatus) {
+    return (this.securityButton = document.getElementById("security-button"));
   },
 
-  onProgressChange(/* in nsIWebProgress*/ aWebProgress,
-                   /* in nsIRequest*/ aRequest,
-                   /* in long*/ aCurSelfProgress,
-                   /* in long */aMaxSelfProgress,
-                   /* in long */aCurTotalProgress,
-                   /* in long */aMaxTotalProgress) {
-  },
+  QueryInterface: ChromeUtils.generateQI([
+    "nsIWebProgressListener",
+    "nsISupportsWeakReference",
+  ]),
+
+  onStateChange(
+    /* in nsIWebProgress*/ aWebProgress,
+    /* in nsIRequest*/ aRequest,
+    /* in unsigned long*/ aStateFlags,
+    /* in nsresult*/ aStatus
+  ) {},
 
-  onLocationChange(/* in nsIWebProgress*/ aWebProgress,
-                   /* in nsIRequest*/ aRequest,
-                   /* in nsIURI*/ aLocation) {
+  onProgressChange(
+    /* in nsIWebProgress*/ aWebProgress,
+    /* in nsIRequest*/ aRequest,
+    /* in long*/ aCurSelfProgress,
+    /* in long */ aMaxSelfProgress,
+    /* in long */ aCurTotalProgress,
+    /* in long */ aMaxTotalProgress
+  ) {},
+
+  onLocationChange(
+    /* in nsIWebProgress*/ aWebProgress,
+    /* in nsIRequest*/ aRequest,
+    /* in nsIURI*/ aLocation
+  ) {
     document.getElementById("headerMessage").textContent = aLocation.spec;
   },
 
-  onStatusChange(/* in nsIWebProgress*/ aWebProgress,
-                 /* in nsIRequest*/ aRequest,
-                 /* in nsresult*/ aStatus,
-                 /* in wstring*/ aMessage) {
-  },
+  onStatusChange(
+    /* in nsIWebProgress*/ aWebProgress,
+    /* in nsIRequest*/ aRequest,
+    /* in nsresult*/ aStatus,
+    /* in wstring*/ aMessage
+  ) {},
 
-  onSecurityChange(/* in nsIWebProgress*/ aWebProgress,
-                   /* in nsIRequest*/ aRequest,
-                   /* in unsigned long*/ aState) {
-    const wpl_security_bits = wpl.STATE_IS_SECURE |
-                              wpl.STATE_IS_BROKEN |
-                              wpl.STATE_IS_INSECURE;
+  onSecurityChange(
+    /* in nsIWebProgress*/ aWebProgress,
+    /* in nsIRequest*/ aRequest,
+    /* in unsigned long*/ aState
+  ) {
+    const wpl_security_bits =
+      wpl.STATE_IS_SECURE | wpl.STATE_IS_BROKEN | wpl.STATE_IS_INSECURE;
     var browser = document.getElementById("requestFrame");
     var level;
 
     switch (aState & wpl_security_bits) {
       case wpl.STATE_IS_SECURE:
         level = "high";
         break;
       case wpl.STATE_IS_BROKEN:
@@ -59,44 +67,47 @@ var reporterListener = {
     }
     if (level) {
       this.securityButton.setAttribute("level", level);
       this.securityButton.hidden = false;
     } else {
       this.securityButton.hidden = true;
       this.securityButton.removeAttribute("level");
     }
-    this.securityButton.setAttribute("tooltiptext",
-                                     browser.securityUI.tooltipText);
+    this.securityButton.setAttribute(
+      "tooltiptext",
+      browser.securityUI.tooltipText
+    );
   },
 
-  onContentBlockingEvent(/* in nsIWebProgress*/ aWebProgress,
-                         /* in nsIRequest*/ aRequest,
-                         /* in unsigned long*/ aEvent) {
-  },
+  onContentBlockingEvent(
+    /* in nsIWebProgress*/ aWebProgress,
+    /* in nsIRequest*/ aRequest,
+    /* in unsigned long*/ aEvent
+  ) {},
 };
 
 function cancelRequest() {
   reportUserClosed();
   window.close();
 }
 
 function reportUserClosed() {
   let request = window.arguments[0].wrappedJSObject;
   request.cancelled();
 }
 
 function loadRequestedUrl() {
   let request = window.arguments[0].wrappedJSObject;
   document.getElementById("headerMessage").textContent = request.promptText;
-  if (request.iconURI != "")
+  if (request.iconURI != "") {
     document.getElementById("headerImage").src = request.iconURI;
+  }
 
   var browser = document.getElementById("requestFrame");
-  browser.addProgressListener(reporterListener,
-                              Ci.nsIWebProgress.NOTIFY_ALL);
+  browser.addProgressListener(reporterListener, Ci.nsIWebProgress.NOTIFY_ALL);
   var url = request.url;
   if (url != "") {
     browser.setAttribute("src", url);
     document.getElementById("headerMessage").textContent = url;
   }
   request.loaded(window, browser.webProgress);
 }
--- a/mail/base/content/button-menu-button.js
+++ b/mail/base/content/button-menu-button.js
@@ -1,11 +1,11 @@
 /* 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/. */
+ * 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/. */
 
 "use strict";
 
 /* global MozXULElement */
 
 // Wrap in a block to prevent leaking to window scope.
 {
   /**
@@ -22,58 +22,63 @@
       return {
         ...super.inheritedAttributes,
         ".button-menubutton-button": "disabled",
         ".button-menubutton-dropmarker": "open,disabled",
       };
     }
 
     static get menubuttonFragment() {
-      let frag = document.importNode(MozXULElement.parseXULToFragment(`
+      let frag = document.importNode(
+        MozXULElement.parseXULToFragment(`
         <hbox class="box-inherit button-box" align="center" pack="center" flex="1">
           <button class="box-inherit button-menubutton-button" allowevents="true" flex="1"></button>
           <dropmarker class="button-menubutton-dropmarker"></dropmarker>
-        </hbox>`), true);
-      Object.defineProperty(this, "menubuttonFragment", {value: frag});
+        </hbox>`),
+        true
+      );
+      Object.defineProperty(this, "menubuttonFragment", { value: frag });
       return frag;
     }
 
     connectedCallback() {
       if (this.delayConnectedCallback() || this._hasConnected) {
         return;
       }
       this.setAttribute("is", "button-menu-button");
       this.setAttribute("type", "menu-button"); // Ensure type is set.
 
       let fragment = this.constructor.menubuttonFragment;
       this.appendChild(fragment.cloneNode(true));
 
       let button = this.querySelector("button");
-      button.addEventListener("command", (event) => {
+      button.addEventListener("command", event => {
         // Retarget the command on the main object.
         event.stopPropagation();
         this.dispatchEvent(new CustomEvent("command", { bubbles: true }));
       });
-      button.addEventListener("keydown", (event) => {
+      button.addEventListener("keydown", event => {
         if (event.key != "Enter" && event.key != " ") {
           return;
         }
         // Prevent button keyboard action from also causing both the default
         // action and opening of the menupopup.
         event.stopPropagation();
       });
 
-      this.addEventListener("keydown", (event) => {
+      this.addEventListener("keydown", event => {
         if (event.key != "Enter" && event.key != " ") {
           return;
         }
 
         this.open = true;
         // Prevent page from scrolling on the space key.
         if (event.key == " ") {
           event.preventDefault();
         }
       });
       this.initializeAttributeInheritance();
     }
   }
-  customElements.define("button-menu-button", MozButtonMenuButton, { extends: "button" });
+  customElements.define("button-menu-button", MozButtonMenuButton, {
+    extends: "button",
+  });
 }
--- a/mail/base/content/commandglue.js
+++ b/mail/base/content/commandglue.js
@@ -6,25 +6,30 @@
  * Command-specific code. This stuff should be called by the widgets
  */
 
 /* import-globals-from folderDisplay.js */
 /* import-globals-from folderPane.js */
 /* import-globals-from mailWindow.js */
 /* import-globals-from msgMail3PaneWindow.js */
 
-var { MailViewConstants } = ChromeUtils.import("resource:///modules/MailViewManager.jsm");
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { MailViewConstants } = ChromeUtils.import(
+  "resource:///modules/MailViewManager.jsm"
+);
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function UpdateMailToolbar(caller) {
   // If we have a transient selection, we shouldn't update the toolbar. We'll
   // update it once we've restored the original selection.
-  if ("gRightMouseButtonSavedSelection" in window &&
-      window.gRightMouseButtonSavedSelection)
+  if (
+    "gRightMouseButtonSavedSelection" in window &&
+    window.gRightMouseButtonSavedSelection
+  ) {
     return;
+  }
 
   // dump("XXX update mail-toolbar " + caller + "\n");
   document.commandDispatcher.updateCommands("mail-toolbar");
 
   // hook for extra toolbar items
   Services.obs.notifyObservers(window, "mail:updateToolbarItems");
 }
 
@@ -34,18 +39,19 @@ function isNewsURI(uri) {
   }
   return uri.startsWith("news:/") || uri.startsWith("news-message:/");
 }
 
 function SwitchView(command) {
   // when switching thread views, we might be coming out of quick search
   // or a message view.
   // first set view picker to all
-  if (gFolderDisplay.view.mailViewIndex != MailViewConstants.kViewItemAll)
+  if (gFolderDisplay.view.mailViewIndex != MailViewConstants.kViewItemAll) {
     gFolderDisplay.view.setMailView(MailViewConstants.kViewItemAll);
+  }
 
   switch (command) {
     // "All" threads and "Unread" threads don't change threading state
     case "cmd_viewAllMsgs":
       gFolderDisplay.view.showUnreadOnly = false;
       break;
     case "cmd_viewUnreadMsgs":
       gFolderDisplay.view.showUnreadOnly = true;
@@ -66,22 +72,26 @@ function SwitchView(command) {
 }
 
 function SetNewsFolderColumns() {
   var sizeColumn = document.getElementById("sizeCol");
   var bundle = document.getElementById("bundle_messenger");
 
   if (gDBView.usingLines) {
     sizeColumn.setAttribute("label", bundle.getString("linesColumnHeader"));
-    sizeColumn.setAttribute("tooltiptext",
-                            bundle.getString("linesColumnTooltip2"));
+    sizeColumn.setAttribute(
+      "tooltiptext",
+      bundle.getString("linesColumnTooltip2")
+    );
   } else {
     sizeColumn.setAttribute("label", bundle.getString("sizeColumnHeader"));
-    sizeColumn.setAttribute("tooltiptext",
-                            bundle.getString("sizeColumnTooltip2"));
+    sizeColumn.setAttribute(
+      "tooltiptext",
+      bundle.getString("sizeColumnTooltip2")
+    );
   }
 }
 
 /**
  * For non-folder based tabs, message counts don't apply.
  * Therefore hide the counts for those folders. For folder based tabs
  * let the tab decide whether or not to show it in UpdateStatusMessageCounts().
  */
@@ -97,83 +107,98 @@ var statusMessageCountsMonitor = {
 
 function UpdateStatusMessageCounts(folder) {
   var unreadElement = document.getElementById("unreadMessageCount");
   var totalElement = document.getElementById("totalMessageCount");
   if (folder && !folder.isServer && unreadElement && totalElement) {
     var numSelected = gFolderDisplay.selectedCount;
     var bundle = document.getElementById("bundle_messenger");
 
-    var numUnread = (numSelected > 1) ?
-      bundle.getFormattedString("selectedMsgStatus", [numSelected]) :
-      bundle.getFormattedString("unreadMsgStatus", [folder.getNumUnread(false)]);
-    var numTotal = bundle.getFormattedString("totalMsgStatus",
-                                             [folder.getTotalMessages(false)]);
+    var numUnread =
+      numSelected > 1
+        ? bundle.getFormattedString("selectedMsgStatus", [numSelected])
+        : bundle.getFormattedString("unreadMsgStatus", [
+            folder.getNumUnread(false),
+          ]);
+    var numTotal = bundle.getFormattedString("totalMsgStatus", [
+      folder.getTotalMessages(false),
+    ]);
 
     unreadElement.setAttribute("value", numUnread);
     totalElement.setAttribute("value", numTotal);
     unreadElement.hidden = false;
     totalElement.hidden = false;
   }
 }
 
 var gQuotaUICache;
 function UpdateStatusQuota(folder) {
-  if (!(folder && // no folder selected
-        folder instanceof Ci.nsIMsgImapMailFolder)) { // POP etc.
-    if (typeof(gQuotaUICache) == "object") // ever shown quota
+  if (
+    !(folder && folder instanceof Ci.nsIMsgImapMailFolder) // no folder selected
+  ) {
+    // POP etc.
+    if (typeof gQuotaUICache == "object") {
+      // ever shown quota
       gQuotaUICache.panel.hidden = true;
+    }
     return;
   }
   folder = folder.QueryInterface(Ci.nsIMsgImapMailFolder);
 
   // get element references and prefs
-  if (typeof(gQuotaUICache) != "object") {
+  if (typeof gQuotaUICache != "object") {
     gQuotaUICache = {};
     gQuotaUICache.meter = document.getElementById("quotaMeter");
     gQuotaUICache.panel = document.getElementById("quotaPanel");
     gQuotaUICache.label = document.getElementById("quotaLabel");
     const kBranch = "mail.quota.mainwindow_threshold.";
     gQuotaUICache.showTreshold = Services.prefs.getIntPref(kBranch + "show");
-    gQuotaUICache.warningTreshold = Services.prefs.getIntPref(kBranch + "warning");
-    gQuotaUICache.criticalTreshold = Services.prefs.getIntPref(kBranch + "critical");
+    gQuotaUICache.warningTreshold = Services.prefs.getIntPref(
+      kBranch + "warning"
+    );
+    gQuotaUICache.criticalTreshold = Services.prefs.getIntPref(
+      kBranch + "critical"
+    );
   }
 
-  var valid = {value: null};
-  var used = {value: null};
-  var max = {value: null};
+  var valid = { value: null };
+  var used = { value: null };
+  var max = { value: null };
   try {
     // get data from backend
     folder.getQuota(valid, used, max);
   } catch (e) {
     dump(e + "\n");
   }
   if (valid.value && max.value > 0) {
-    var percent = Math.round(used.value / max.value * 100);
+    var percent = Math.round((used.value / max.value) * 100);
 
     // show in UI
     if (percent < gQuotaUICache.showTreshold) {
       gQuotaUICache.panel.hidden = true;
     } else {
       gQuotaUICache.panel.hidden = false;
       gQuotaUICache.meter.setAttribute("value", percent);
-           // do not use value property, because that is imprecise (3%)
-           // for optimization that we don't need here
+      // do not use value property, because that is imprecise (3%)
+      // for optimization that we don't need here
       var bundle = document.getElementById("bundle_messenger");
       var label = bundle.getFormattedString("percent", [percent]);
-      var tooltip = bundle.getFormattedString("quotaTooltip",
-                                              [used.value, max.value]);
+      var tooltip = bundle.getFormattedString("quotaTooltip", [
+        used.value,
+        max.value,
+      ]);
       gQuotaUICache.label.value = label;
       gQuotaUICache.label.tooltipText = tooltip;
-      if (percent < gQuotaUICache.warningTreshold)
+      if (percent < gQuotaUICache.warningTreshold) {
         gQuotaUICache.panel.removeAttribute("alert");
-      else if (percent < gQuotaUICache.criticalTreshold)
+      } else if (percent < gQuotaUICache.criticalTreshold) {
         gQuotaUICache.panel.setAttribute("alert", "warning");
-      else
+      } else {
         gQuotaUICache.panel.setAttribute("alert", "critical");
+      }
     }
   } else {
     gQuotaUICache.panel.hidden = true;
   }
 }
 
 function ConvertSortTypeToColumnID(sortKey) {
   var columnID;
@@ -234,22 +259,27 @@ function ConvertSortTypeToColumnID(sortK
       break;
     case Ci.nsMsgViewSortType.byJunkStatus:
       columnID = "junkStatusCol";
       break;
     case Ci.nsMsgViewSortType.byAttachments:
       columnID = "attachmentCol";
       break;
     case Ci.nsMsgViewSortType.byCustom:
-
       // TODO: either change try() catch to if (property exists) or restore the getColumnHandler() check
-      try { // getColumnHandler throws an error when the ID is not handled
+      try {
+        // getColumnHandler throws an error when the ID is not handled
         columnID = gDBView.curCustomColumn;
-      } catch (err) { // error - means no handler
-        dump("ConvertSortTypeToColumnID: custom sort key but no handler for column '" + columnID + "'\n");
+      } catch (err) {
+        // error - means no handler
+        dump(
+          "ConvertSortTypeToColumnID: custom sort key but no handler for column '" +
+            columnID +
+            "'\n"
+        );
         columnID = "dateCol";
       }
 
       break;
     case Ci.nsMsgViewSortType.byCorrespondent:
       columnID = "correspondentCol";
       break;
     default:
@@ -264,18 +294,19 @@ var gDBView = null;
 var gCurViewFlags;
 var gCurSortType;
 
 function ChangeMessagePaneVisibility(now_hidden) {
   // We also have to disable the Message/Attachments menuitem.
   // It will be enabled when loading a message with attachments
   // (see messageHeaderSink.handleAttachment).
   var node = document.getElementById("msgAttachmentMenu");
-  if (node && now_hidden)
+  if (node && now_hidden) {
     node.setAttribute("disabled", "true");
+  }
 
   gMessageDisplay.visible = !now_hidden;
 
   var event = document.createEvent("Events");
   if (now_hidden) {
     event.initEvent("messagepane-hide", false, true);
   } else {
     event.initEvent("messagepane-unhide", false, true);
@@ -299,36 +330,38 @@ function OnMouseUpThreadAndMessagePaneSp
 var gIgnoreSyntheticFolderPaneSelectionChange = false;
 function FolderPaneSelectionChange() {
   let folders = GetSelectedMsgFolders();
   if (folders.length) {
     let msgFolder = folders[0];
     let locationItem = document.getElementById("locationFolders");
     if (locationItem) {
       locationItem.setAttribute("label", msgFolder.prettyName);
-      document.getElementById("folderLocationPopup")
-              ._setCssSelectors(msgFolder, locationItem);
+      document
+        .getElementById("folderLocationPopup")
+        ._setCssSelectors(msgFolder, locationItem);
     }
   }
 
   if (gIgnoreSyntheticFolderPaneSelectionChange) {
     gIgnoreSyntheticFolderPaneSelectionChange = false;
     return;
   }
 
   let folderSelection = gFolderTreeView.selection;
 
   // This prevents a folder from being loaded in the case that the user
   // has right-clicked on a folder different from the one that was
   // originally highlighted.  On a right-click, the highlight (selection)
   // of a row will be different from the value of currentIndex, thus if
   // the currentIndex is not selected, it means the user right-clicked
   // and we don't want to load the contents of the folder.
-  if (!folderSelection.isSelected(folderSelection.currentIndex))
+  if (!folderSelection.isSelected(folderSelection.currentIndex)) {
     return;
+  }
 
   gFolderDisplay.show(folders.length ? folders[0] : null);
   SetGetMsgButtonTooltip();
 }
 
 function Undo() {
   messenger.undo(msgWindow);
 }
--- a/mail/base/content/contentAreaClick.js
+++ b/mail/base/content/contentAreaClick.js
@@ -3,50 +3,62 @@
  * 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/. */
 
 /* import-globals-from ../../../../toolkit/content/contentAreaUtils.js */
 /* import-globals-from mailWindow.js */
 /* import-globals-from utilityOverlay.js */
 /* import-globals-from phishingDetector.js */
 
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {PlacesUtils} = ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { PlacesUtils } = ChromeUtils.import(
+  "resource://gre/modules/PlacesUtils.jsm"
+);
 
 /**
  * Extract the href from the link click event.
  * We look for HTMLAnchorElement, HTMLAreaElement, HTMLLinkElement,
  * HTMLInputElement.form.action, and nested anchor tags.
  * If the clicked element was a HTMLInputElement or HTMLButtonElement
  * we return the form action.
  *
  * @return [href, linkText] the url and the text for the link being clicked.
  */
 function hRefForClickEvent(aEvent, aDontCheckInputElement) {
-  let target = (aEvent.type == "command") ?
-    document.commandDispatcher.focusedElement : aEvent.target;
+  let target =
+    aEvent.type == "command"
+      ? document.commandDispatcher.focusedElement
+      : aEvent.target;
 
-  if (target instanceof HTMLImageElement &&
-      target.hasAttribute("overflowing")) { // Click on zoomed image.
+  if (
+    target instanceof HTMLImageElement &&
+    target.hasAttribute("overflowing")
+  ) {
+    // Click on zoomed image.
     return [null, null];
   }
 
   let href = null;
   let linkText = null;
-  if (target instanceof HTMLAnchorElement ||
-      target instanceof HTMLAreaElement ||
-      target instanceof HTMLLinkElement) {
+  if (
+    target instanceof HTMLAnchorElement ||
+    target instanceof HTMLAreaElement ||
+    target instanceof HTMLLinkElement
+  ) {
     if (target.hasAttribute("href")) {
       href = target.href;
       linkText = gatherTextUnder(target);
     }
-  } else if (!aDontCheckInputElement && ((target instanceof HTMLInputElement) ||
-                                         (target instanceof HTMLButtonElement))) {
-    if (target.form && target.form.action)
+  } else if (
+    !aDontCheckInputElement &&
+    (target instanceof HTMLInputElement || target instanceof HTMLButtonElement)
+  ) {
+    if (target.form && target.form.action) {
       href = target.form.action;
+    }
   } else {
     // We may be nested inside of a link node.
     let linkNode = aEvent.originalTarget;
     while (linkNode && !(linkNode instanceof HTMLAnchorElement)) {
       linkNode = linkNode.parentNode;
     }
 
     if (linkNode) {
@@ -56,111 +68,131 @@ function hRefForClickEvent(aEvent, aDont
   }
   return [href, linkText];
 }
 
 function messagePaneOnResize(aEvent) {
   // Scale any overflowing images, exclude http content.
   let browser = getBrowser();
   let doc = browser && browser.contentDocument ? browser.contentDocument : null;
-  if (!doc || doc.URL.startsWith("http") || !doc.images)
+  if (!doc || doc.URL.startsWith("http") || !doc.images) {
     return;
+  }
 
   for (let img of doc.images) {
-    if (img.clientWidth - doc.body.offsetWidth >= 0 &&
-        (img.clientWidth <= img.naturalWidth || !img.naturalWidth))
+    if (
+      img.clientWidth - doc.body.offsetWidth >= 0 &&
+      (img.clientWidth <= img.naturalWidth || !img.naturalWidth)
+    ) {
       img.setAttribute("overflowing", true);
-    else
+    } else {
       img.removeAttribute("overflowing");
+    }
   }
 }
 
 /**
  * Check whether the click target's or its ancestor's href
  * points to an anchor on the page.
  *
  * @param HTMLElement aTargetNode - the element node.
  * @return                        - true if link pointing to anchor.
  */
 function isLinkToAnchorOnPage(aTargetNode) {
   let url = aTargetNode.ownerDocument.URL;
-  if (!url.startsWith("http"))
+  if (!url.startsWith("http")) {
     return false;
+  }
 
   let linkNode = aTargetNode;
-  while (linkNode && !(linkNode instanceof HTMLAnchorElement))
+  while (linkNode && !(linkNode instanceof HTMLAnchorElement)) {
     linkNode = linkNode.parentNode;
+  }
 
   // It's not a link with an anchor.
-  if (!linkNode || !linkNode.href || !linkNode.hash)
+  if (!linkNode || !linkNode.href || !linkNode.hash) {
     return false;
+  }
 
   // The link's href must match the document URL.
-  if (makeURI(linkNode.href).specIgnoringRef != makeURI(url).specIgnoringRef)
+  if (makeURI(linkNode.href).specIgnoringRef != makeURI(url).specIgnoringRef) {
     return false;
+  }
 
   return true;
 }
 
 // Called whenever the user clicks in the content area,
 // should always return true for click to go through.
 function contentAreaClick(aEvent) {
   let target = aEvent.target;
 
   // If we've loaded a web page url, and the element's or its ancestor's href
   // points to an anchor on the page, let the click go through.
   // Otherwise fall through and open externally.
-  if (isLinkToAnchorOnPage(target))
+  if (isLinkToAnchorOnPage(target)) {
     return true;
+  }
 
   let [href, linkText] = hRefForClickEvent(aEvent);
 
   if (!href && !aEvent.button) {
     // Is this an image that we might want to scale?
 
     if (target instanceof Ci.nsIImageLoadingContent) {
       // Make sure it loaded successfully. No action if not or a broken link.
       var req = target.getRequest(Ci.nsIImageLoadingContent.CURRENT_REQUEST);
-      if (!req || req.imageStatus & Ci.imgIRequest.STATUS_ERROR)
+      if (!req || req.imageStatus & Ci.imgIRequest.STATUS_ERROR) {
         return false;
+      }
 
       // Is it an image?
       if (target.localName == "img" && target.hasAttribute("overflowing")) {
-        if (target.hasAttribute("shrinktofit"))
+        if (target.hasAttribute("shrinktofit")) {
           // Currently shrunk to fit, so unshrink it.
           target.removeAttribute("shrinktofit");
-        else
-          // User wants to shrink now.
+        }
+        // User wants to shrink now.
+        else {
           target.setAttribute("shrinktofit", true);
+        }
 
         return false;
       }
     }
     return true;
   }
 
-  if (!href || aEvent.button == 2)
+  if (!href || aEvent.button == 2) {
     return true;
+  }
 
   // We want all about, http and https links in the message pane to be loaded
   // externally in a browser, therefore we need to detect that here and redirect
   // as necessary.
   let uri = makeURI(href);
-  if (Cc["@mozilla.org/uriloader/external-protocol-service;1"]
-        .getService(Ci.nsIExternalProtocolService)
-        .isExposedProtocol(uri.scheme) &&
-      !uri.schemeIs("http") && !uri.schemeIs("https"))
+  if (
+    Cc["@mozilla.org/uriloader/external-protocol-service;1"]
+      .getService(Ci.nsIExternalProtocolService)
+      .isExposedProtocol(uri.scheme) &&
+    !uri.schemeIs("http") &&
+    !uri.schemeIs("https")
+  ) {
     return true;
+  }
 
   // Now we're here, we know this should be loaded in an external browser, so
   // prevent the default action so we don't try and load it here.
   aEvent.preventDefault();
 
   // Let the phishing detector check the link.
-  let urlPhishCheckResult = gPhishingDetector.warnOnSuspiciousLinkClick(href, linkText);
+  let urlPhishCheckResult = gPhishingDetector.warnOnSuspiciousLinkClick(
+    href,
+    linkText
+  );
   if (urlPhishCheckResult === 1) {
     return false; // Block request
   }
 
   if (urlPhishCheckResult === 0) {
     // Use linkText instead.
     openLinkExternally(linkText);
     return true;
@@ -173,26 +205,31 @@ function contentAreaClick(aEvent) {
 /**
  * Forces a url to open in an external application according to the protocol
  * service settings.
  *
  * @param url  A url string or an nsIURI containing the url to open.
  */
 function openLinkExternally(url) {
   let uri = url;
-  if (!(uri instanceof Ci.nsIURI))
+  if (!(uri instanceof Ci.nsIURI)) {
     uri = Services.io.newURI(url);
+  }
 
   // This can fail if there is a problem with the places database.
-  PlacesUtils.history.insert({
-    url, // accepts both string and nsIURI
-    visits: [{
-      date: new Date(),
-    }],
-  }).catch(Cu.reportError);
+  PlacesUtils.history
+    .insert({
+      url, // accepts both string and nsIURI
+      visits: [
+        {
+          date: new Date(),
+        },
+      ],
+    })
+    .catch(Cu.reportError);
 
   Cc["@mozilla.org/uriloader/external-protocol-service;1"]
     .getService(Ci.nsIExternalProtocolService)
     .loadURI(uri);
 }
 
 /**
  * Compatibility to Firefox, used for example by devtools to open links. Defer
@@ -200,17 +237,19 @@ function openLinkExternally(url) {
  * open an actionable tab.
  */
 function openWebLinkIn(url, where, params) {
   if (!params) {
     params = {};
   }
 
   if (!params.triggeringPrincipal) {
-    params.triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({});
+    params.triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal(
+      {}
+    );
   }
 
   openUILinkIn(url, where, params);
 }
 
 function openUILinkIn(url, where, options) {
   openLinkExternally(url);
 }
--- a/mail/base/content/customElements.js
+++ b/mail/base/content/customElements.js
@@ -2,26 +2,27 @@
  * 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/. */
 
 "use strict";
 
 // This is loaded into chrome windows with the subscript loader. Wrap in
 // a block to prevent accidentally leaking globals onto `window`.
 (() => {
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+  var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-const isDummyDocument = document.documentURI == "chrome://extensions/content/dummy.xul";
-if (!isDummyDocument) {
-  for (let script of [
-    "chrome://chat/content/conversation-browser.js",
-    "chrome://chat/content/chat-tooltip.js",
-    "chrome://messenger/content/mailWidgets.js",
-    "chrome://messenger/content/statuspanel.js",
-    "chrome://messenger/content/foldersummary.js",
-    "chrome://messenger/content/addressbook/menulist-addrbooks.js",
-    "chrome://messenger/content/folder-menupopup.js",
-    "chrome://messenger/content/toolbarbutton-menu-button.js",
-  ]) {
-    Services.scriptloader.loadSubScript(script, window);
+  const isDummyDocument =
+    document.documentURI == "chrome://extensions/content/dummy.xul";
+  if (!isDummyDocument) {
+    for (let script of [
+      "chrome://chat/content/conversation-browser.js",
+      "chrome://chat/content/chat-tooltip.js",
+      "chrome://messenger/content/mailWidgets.js",
+      "chrome://messenger/content/statuspanel.js",
+      "chrome://messenger/content/foldersummary.js",
+      "chrome://messenger/content/addressbook/menulist-addrbooks.js",
+      "chrome://messenger/content/folder-menupopup.js",
+      "chrome://messenger/content/toolbarbutton-menu-button.js",
+    ]) {
+      Services.scriptloader.loadSubScript(script, window);
+    }
   }
-}
 })();
--- a/mail/base/content/editContactPanel.js
+++ b/mail/base/content/editContactPanel.js
@@ -1,93 +1,103 @@
 /* -*- 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 {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {MailServices} = ChromeUtils.import("resource:///modules/MailServices.jsm");
-var { fixIterator } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { MailServices } = ChromeUtils.import(
+  "resource:///modules/MailServices.jsm"
+);
+var { fixIterator } = ChromeUtils.import(
+  "resource:///modules/iteratorUtils.jsm"
+);
 
 var editContactInlineUI = {
   _overlayLoaded: false,
   _overlayLoading: false,
   _cardDetails: null,
   _writeable: true,
   _blockedCommands: ["cmd_close"],
 
   _blockCommands() {
     for (var i = 0; i < this._blockedCommands; ++i) {
       var elt = document.getElementById(this._blockedCommands[i]);
       // make sure not to permanetly disable this item
-      if (elt.hasAttribute("wasDisabled"))
+      if (elt.hasAttribute("wasDisabled")) {
         continue;
+      }
 
       if (elt.getAttribute("disabled") == "true") {
         elt.setAttribute("wasDisabled", "true");
       } else {
         elt.setAttribute("wasDisabled", "false");
         elt.setAttribute("disabled", "true");
       }
     }
   },
 
   _restoreCommandsState() {
     for (var i = 0; i < this._blockedCommands; ++i) {
       var elt = document.getElementById(this._blockedCommands[i]);
-      if (elt.getAttribute("wasDisabled") != "true")
+      if (elt.getAttribute("wasDisabled") != "true") {
         elt.removeAttribute("disabled");
+      }
       elt.removeAttribute("wasDisabled");
     }
     document.getElementById("editContactAddressBookList").disabled = false;
     document.getElementById("contactMoveDisabledText").collapsed = true;
   },
 
   onPopupHidden(aEvent) {
-    if (aEvent.target == this.panel)
+    if (aEvent.target == this.panel) {
       this._restoreCommandsState();
+    }
   },
 
   onPopupShown(aEvent) {
-    if (aEvent.target == this.panel)
+    if (aEvent.target == this.panel) {
       document.getElementById("editContactName").focus();
+    }
   },
 
   onKeyPress(aEvent, aHandleOnlyReadOnly) {
     // Escape should just close this panel
     if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE) {
       this.panel.hidePopup();
       return;
     }
 
     // Return does the default button (done)
     if (aEvent.keyCode == KeyEvent.DOM_VK_RETURN) {
-      if (!aEvent.target.hasAttribute("oncommand"))
+      if (!aEvent.target.hasAttribute("oncommand")) {
         this.saveChanges();
+      }
       return;
     }
 
     // Only handle the read-only cases here.
-    if (aHandleOnlyReadOnly &&
-        (this._writeable && !aEvent.target.readOnly))
+    if (aHandleOnlyReadOnly && (this._writeable && !aEvent.target.readOnly)) {
       return;
+    }
 
     // Any other character and we prevent the default, this stops us doing
     // things in the main message window.
-    if (aEvent.charCode)
+    if (aEvent.charCode) {
       aEvent.preventDefault();
+    }
   },
 
   get panel() {
     delete this.panel;
     var element = document.getElementById("editContactPanel");
     // initially the panel is hidden to avoid impacting startup / new window
     // performance
     element.hidden = false;
-    return this.panel = element;
+    return (this.panel = element);
   },
 
   showEditContactPanel(aCardDetails, aAnchorElement) {
     this._cardDetails = aCardDetails;
     let position = "after_start";
     this._doShowEditContactPanel(aAnchorElement, position);
   },
 
@@ -95,105 +105,125 @@ var editContactInlineUI = {
     this._blockCommands(); // un-done in the popuphiding handler.
     var bundle = document.getElementById("bundle_editContact");
 
     // Is this address book writeable?
     this._writeable = !this._cardDetails.book.readOnly;
     var type = this._writeable ? "edit" : "view";
 
     // Update the labels accordingly.
-    document.getElementById("editContactPanelTitle").value =
-      bundle.getString(type + "Title");
-    document.getElementById("editContactPanelEditDetailsButton").label =
-      bundle.getString(type + "DetailsLabel");
-    document.getElementById("editContactPanelEditDetailsButton").accessKey =
-      bundle.getString(type + "DetailsAccessKey");
+    document.getElementById("editContactPanelTitle").value = bundle.getString(
+      type + "Title"
+    );
+    document.getElementById(
+      "editContactPanelEditDetailsButton"
+    ).label = bundle.getString(type + "DetailsLabel");
+    document.getElementById(
+      "editContactPanelEditDetailsButton"
+    ).accessKey = bundle.getString(type + "DetailsAccessKey");
 
     // We don't need a delete button for a read only card.
-    document.getElementById("editContactPanelDeleteContactButton").hidden =
-      !this._writeable;
+    document.getElementById(
+      "editContactPanelDeleteContactButton"
+    ).hidden = !this._writeable;
 
     var nameElement = document.getElementById("editContactName");
 
     // Set these to read only if we can't write to the directory.
     if (this._writeable) {
       nameElement.removeAttribute("readonly");
       nameElement.class = "editContactTextbox";
     } else {
       nameElement.readOnly = true;
       nameElement.class = "plain";
     }
 
     // Fill in the card details
     nameElement.value = this._cardDetails.card.displayName;
-    document.getElementById("editContactEmail").value =
-      aAnchorElement.getAttribute("emailAddress");
+    document.getElementById(
+      "editContactEmail"
+    ).value = aAnchorElement.getAttribute("emailAddress");
 
-    document.getElementById("editContactAddressBookList").value =
-      this._cardDetails.book.URI;
+    document.getElementById(
+      "editContactAddressBookList"
+    ).value = this._cardDetails.book.URI;
 
     // Is this card contained within mailing lists?
     let inMailList = false;
     if (this._cardDetails.book.supportsMailingLists) {
       // We only have to look in one book here, because cards currently have
       // to be in the address book they belong to.
       let mailingLists = this._cardDetails.book.childNodes;
       while (mailingLists.hasMoreElements() && !inMailList) {
         let list = mailingLists.getNext();
-        if (!(list instanceof Ci.nsIAbDirectory) ||
-            !list.isMailList)
+        if (!(list instanceof Ci.nsIAbDirectory) || !list.isMailList) {
           continue;
+        }
 
         for (let card of fixIterator(list.addressLists)) {
-          if (card instanceof Ci.nsIAbCard &&
-              card.primaryEmail == this._cardDetails.card.primaryEmail) {
+          if (
+            card instanceof Ci.nsIAbCard &&
+            card.primaryEmail == this._cardDetails.card.primaryEmail
+          ) {
             inMailList = true;
             break;
           }
         }
       }
     }
 
-    if (!this._writeable || inMailList)
+    if (!this._writeable || inMailList) {
       document.getElementById("editContactAddressBookList").disabled = true;
+    }
 
-    if (inMailList)
+    if (inMailList) {
       document.getElementById("contactMoveDisabledText").collapsed = false;
+    }
 
     this.panel.openPopup(aAnchorElement, aPosition, -1, -1);
   },
 
   editDetails() {
     this.saveChanges();
 
-    window.openDialog("chrome://messenger/content/addressbook/abEditCardDialog.xul",
-                      "",
-                      "chrome,modal,resizable=no,centerscreen",
-                      { abURI: this._cardDetails.book.URI,
-                        card: this._cardDetails.card });
+    window.openDialog(
+      "chrome://messenger/content/addressbook/abEditCardDialog.xul",
+      "",
+      "chrome,modal,resizable=no,centerscreen",
+      { abURI: this._cardDetails.book.URI, card: this._cardDetails.card }
+    );
   },
 
   deleteContact() {
-    if (this._cardDetails.book.readOnly)
-      return; /* double check we can delete this */
+    if (this._cardDetails.book.readOnly) {
+      return;
+    } /* double check we can delete this */
 
     /* hide before the dialog or the panel takes the first click */
     this.panel.hidePopup();
 
     var bundle = document.getElementById("bundle_editContact");
-    if (!Services.prompt.confirm(window,
-                                 bundle.getString("deleteContactTitle"),
-                                 bundle.getString("deleteContactMessage")))
-      return;  /* XXX would be nice to bring the popup back up here */
+    if (
+      !Services.prompt.confirm(
+        window,
+        bundle.getString("deleteContactTitle"),
+        bundle.getString("deleteContactMessage")
+      )
+    ) {
+      return;
+    } /* XXX would be nice to bring the popup back up here */
 
-    let cardArray = Cc["@mozilla.org/array;1"]
-                      .createInstance(Ci.nsIMutableArray);
+    let cardArray = Cc["@mozilla.org/array;1"].createInstance(
+      Ci.nsIMutableArray
+    );
     cardArray.appendElement(this._cardDetails.card);
 
-    MailServices.ab.getDirectory(this._cardDetails.book.URI).deleteCards(cardArray);
+    MailServices.ab
+      .getDirectory(this._cardDetails.book.URI)
+      .deleteCards(cardArray);
   },
 
   saveChanges() {
     // If we're a popup dialog, just hide the popup and return
     if (!this._writeable) {
       this.panel.hidePopup();
       return;
     }
@@ -218,17 +248,18 @@ var editContactInlineUI = {
       this._cardDetails.book.modifyCard(this._cardDetails.card);
     } else {
       // We changed address books for the card.
 
       // Add it to the chosen address book...
       this._cardDetails.book.addCard(this._cardDetails.card);
 
       // ...and delete it from the old place.
-      let cardArray = Cc["@mozilla.org/array;1"]
-                              .createInstance(Ci.nsIMutableArray);
+      let cardArray = Cc["@mozilla.org/array;1"].createInstance(
+        Ci.nsIMutableArray
+      );
       cardArray.appendElement(this._cardDetails.card);
       originalBook.deleteCards(cardArray);
     }
 
     this.panel.hidePopup();
   },
 };
--- a/mail/base/content/folderDisplay.js
+++ b/mail/base/content/folderDisplay.js
@@ -1,20 +1,24 @@
 /* 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/. */
 
 /* import-globals-from commandglue.js */
 /* import-globals-from mailWindow.js */
 /* import-globals-from ../../extensions/mailviews/content/msgViewPickerOverlay.js */
 
-var {DBViewWrapper} = ChromeUtils.import("resource:///modules/DBViewWrapper.jsm");
-var { JSTreeSelection } = ChromeUtils.import("resource:///modules/jsTreeSelection.js");
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {MailUtils} = ChromeUtils.import("resource:///modules/MailUtils.jsm");
+var { DBViewWrapper } = ChromeUtils.import(
+  "resource:///modules/DBViewWrapper.jsm"
+);
+var { JSTreeSelection } = ChromeUtils.import(
+  "resource:///modules/jsTreeSelection.js"
+);
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { MailUtils } = ChromeUtils.import("resource:///modules/MailUtils.jsm");
 
 var gFolderDisplay = null;
 var gMessageDisplay = null;
 
 /**
  * Maintains a list of listeners for all FolderDisplayWidget instances in this
  *  window.  The assumption is that because of our multiplexed tab
  *  implementation all consumers are effectively going to care about all such
@@ -64,18 +68,19 @@ var FolderDisplayListenerManager = {
    * For use by FolderDisplayWidget to trigger listener invocation.
    */
   _fireListeners(aEventName, aArgs) {
     for (let listener of this._listeners) {
       if (aEventName in listener) {
         try {
           listener[aEventName].apply(listener, aArgs);
         } catch (e) {
-          Cu.reportError(aEventName + " event listener FAILED; " +
-                         e + " at: " + e.stack);
+          Cu.reportError(
+            aEventName + " event listener FAILED; " + e + " at: " + e.stack
+          );
         }
       }
     }
   },
 };
 
 /**
  * Abstraction for a widget that (roughly speaking) displays the contents of
@@ -197,62 +202,67 @@ FolderDisplayWidget.prototype = {
   /**
    * @return true if the selection should be summarized for this folder. This
    *     is based on the mail.operate_on_msgs_in_collapsed_threads pref and
    *     if we are in a newsgroup folder. XXX When bug 478167 is fixed, this
    *     should be limited to being disabled for newsgroups that are not stored
    *     offline.
    */
   get summarizeSelectionInFolder() {
-    return Services.prefs.getBoolPref("mail.operate_on_msgs_in_collapsed_threads") &&
-      !(this.displayedFolder instanceof Ci.nsIMsgNewsFolder);
+    return (
+      Services.prefs.getBoolPref("mail.operate_on_msgs_in_collapsed_threads") &&
+      !(this.displayedFolder instanceof Ci.nsIMsgNewsFolder)
+    );
   },
 
   /**
    * @return the nsITreeSelection object for our tree view.  This exists for
    *     the benefit of message tabs that haven't been switched to yet.
    *     We provide a fake tree selection in those cases.
    * @protected
    */
   get treeSelection() {
     // If we haven't switched to this tab yet, dbView will exist but
     // dbView.selection won't, so use the fake tree selection instead.
-    if (this._fakeTreeSelection)
+    if (this._fakeTreeSelection) {
       return this._fakeTreeSelection;
-    if (this.view.dbView)
+    }
+    if (this.view.dbView) {
       return this.view.dbView.selection;
+    }
     return null;
   },
 
   /**
    * Determine which pane currently has focus (one of the folder pane, thread
    * pane, or message pane). The message pane node is the common ancestor of
    * the single- and multi-message content windows. When changing focus to the
    * message pane, be sure to focus the appropriate content window in addition
    * to the messagepanebox (doing both is required in order to blur the
    * previously-focused chrome element).
    *
    * @return the focused pane
    */
   get focusedPane() {
     let panes = ["threadTree", "folderTree", "messagepanebox"].map(id =>
-        document.getElementById(id));
+      document.getElementById(id)
+    );
 
     let currentNode = top.document.activeElement;
 
     while (currentNode) {
-      if (panes.includes(currentNode))
+      if (panes.includes(currentNode)) {
         return currentNode;
+      }
 
       currentNode = currentNode.parentNode;
     }
     return null;
   },
 
-
   /**
    * Number of headers to tell the message database to cache when we enter a
    *  folder.  This value is being propagated from legacy code which provided
    *  no explanation for its choice.
    *
    * We definitely want the header cache size to be larger than the number of
    *  rows that can be displayed on screen simultaneously.
    *
@@ -297,17 +307,19 @@ FolderDisplayWidget.prototype = {
    *  or otherwise re-ordered in such a way that the nsITreeSelection will lose
    *  track of things (because it just has a naive view-index 'view' of the
    *  world.)  We just save each message's message-id header.  This is overkill
    *  and ambiguous in the face of duplicate messages (and expensive to
    *  restore), but is also the most reliable option for this use case.
    */
   _saveSelection() {
     this._savedSelection = {
-      messages: this.selectedMessages.map(msgHdr => ({messageId: msgHdr.messageId})),
+      messages: this.selectedMessages.map(msgHdr => ({
+        messageId: msgHdr.messageId,
+      })),
       forceSelect: false,
     };
   },
 
   /**
    * Clear the saved selection.
    */
   _clearSavedSelection() {
@@ -317,91 +329,96 @@ FolderDisplayWidget.prototype = {
   /**
    * Restore the view selection if we have a saved selection.  We must be
    *  active!
    *
    * @return true if we were able to restore the selection and there was
    *     a selection, false if there was no selection (anymore).
    */
   _restoreSelection() {
-    if (!this._savedSelection || !this._active)
+    if (!this._savedSelection || !this._active) {
       return false;
+    }
 
     // translate message IDs back to messages.  this is O(s(m+n)) where:
     // - s is the number of messages saved in the selection
     // - m is the number of messages in the view (from findIndexOfMsgHdr)
     // - n is the number of messages in the underlying folders (from
     //   DBViewWrapper.getMsgHdrForMessageID).
     // which ends up being O(sn)
-    let messages =
-      this._savedSelection.messages.
-      map(savedInfo => this.view.getMsgHdrForMessageID(savedInfo.messageId)).
-      filter(msgHdr => !!msgHdr);
+    let messages = this._savedSelection.messages
+      .map(savedInfo => this.view.getMsgHdrForMessageID(savedInfo.messageId))
+      .filter(msgHdr => !!msgHdr);
 
     this.selectMessages(messages, this._savedSelection.forceSelect, true);
     this._savedSelection = null;
 
     return this.selectedCount != 0;
   },
 
   /**
    * Restore the last expandAll/collapseAll state, for both grouped and threaded
    * views. Not all views respect viewFlags, ie single folder non-virtual.
    */
   restoreThreadState() {
-    if (!this._active || !this.tree || !this.view.dbView.viewFolder)
+    if (!this._active || !this.tree || !this.view.dbView.viewFolder) {
       return;
+    }
 
-    if (this.view._threadExpandAll &&
-        !(this.view.dbView.viewFlags & Ci.nsMsgViewFlagsType.kExpandAll))
+    if (
+      this.view._threadExpandAll &&
+      !(this.view.dbView.viewFlags & Ci.nsMsgViewFlagsType.kExpandAll)
+    ) {
       this.view.dbView.doCommand(Ci.nsMsgViewCommandType.expandAll);
-    if (!this.view._threadExpandAll &&
-        this.view.dbView.viewFlags & Ci.nsMsgViewFlagsType.kExpandAll)
+    }
+    if (
+      !this.view._threadExpandAll &&
+      this.view.dbView.viewFlags & Ci.nsMsgViewFlagsType.kExpandAll
+    ) {
       this.view.dbView.doCommand(Ci.nsMsgViewCommandType.collapseAll);
+    }
   },
   // @}
 
   /**
    * @name Columns
    * @protected Folder Display
    */
   // @{
 
   /**
    * The map of all stock sortable columns and their sortType. The key must
    * match the column's xul <treecol> id.
    */
   COLUMNS_MAP: new Map([
-    ["accountCol",       "byAccount"],
-    ["attachmentCol",    "byAttachments"],
-    ["senderCol",        "byAuthor"],
+    ["accountCol", "byAccount"],
+    ["attachmentCol", "byAttachments"],
+    ["senderCol", "byAuthor"],
     ["correspondentCol", "byCorrespondent"],
-    ["dateCol",          "byDate"],
-    ["flaggedCol",       "byFlagged"],
-    ["idCol",            "byId"],
-    ["junkStatusCol",    "byJunkStatus"],
-    ["locationCol",      "byLocation"],
-    ["priorityCol",      "byPriority"],
-    ["receivedCol",      "byReceived"],
-    ["recipientCol",     "byRecipient"],
-    ["sizeCol",          "bySize"],
-    ["statusCol",        "byStatus"],
-    ["subjectCol",       "bySubject"],
-    ["tagsCol",          "byTags"],
-    ["threadCol",        "byThread"],
+    ["dateCol", "byDate"],
+    ["flaggedCol", "byFlagged"],
+    ["idCol", "byId"],
+    ["junkStatusCol", "byJunkStatus"],
+    ["locationCol", "byLocation"],
+    ["priorityCol", "byPriority"],
+    ["receivedCol", "byReceived"],
+    ["recipientCol", "byRecipient"],
+    ["sizeCol", "bySize"],
+    ["statusCol", "byStatus"],
+    ["subjectCol", "bySubject"],
+    ["tagsCol", "byTags"],
+    ["threadCol", "byThread"],
     ["unreadButtonColHeader", "byUnread"],
   ]),
 
   /**
    * The map of stock non-sortable columns. The key must match the column's
    *  xul <treecol> id.
    */
-  COLUMNS_MAP_NOSORT: new Set([
-    "selectCol", "totalCol", "unreadCol",
-  ]),
+  COLUMNS_MAP_NOSORT: new Set(["selectCol", "totalCol", "unreadCol"]),
 
   /**
    * The set of potential default columns in their default display order.  Each
    *  column in this list is checked against |COLUMN_DEFAULT_TESTERS| to see if
    *  it is actually an appropriate default for the folder type.
    */
   DEFAULT_COLUMNS: [
     "threadCol",
@@ -471,20 +488,22 @@ FolderDisplayWidget.prototype = {
   /**
    * Given a dbFolderInfo, extract the persisted state from it if there is any.
    *
    * @return null if there was no persisted state, the persisted state in object
    *     form otherwise.  (Ideally the state conforms to the documentation on
    *     |_savedColumnStates| but we can't stop people from doing bad things.)
    */
   _depersistColumnStatesFromDbFolderInfo(aDbFolderInfo) {
-    let columnJsonString =
-      aDbFolderInfo.getCharProperty(this.PERSISTED_COLUMN_PROPERTY_NAME);
-    if (!columnJsonString)
+    let columnJsonString = aDbFolderInfo.getCharProperty(
+      this.PERSISTED_COLUMN_PROPERTY_NAME
+    );
+    if (!columnJsonString) {
       return null;
+    }
 
     return JSON.parse(columnJsonString);
   },
 
   /**
    * Persist the column state for the currently displayed folder.  We are
    *  assuming that the message database is already open when we are called and
    *  therefore that we do not need to worry about cleaning up after the message
@@ -495,90 +514,100 @@ FolderDisplayWidget.prototype = {
    *  Otherwise this should be because the user explicitly changed up the column
    *  configurations.  You should not call this willy-nilly.
    *
    * @param aState State to persist.
    */
   _persistColumnStates(aState) {
     if (this.view.isSynthetic) {
       let syntheticView = this.view._syntheticView;
-      if ("setPersistedSetting" in syntheticView)
+      if ("setPersistedSetting" in syntheticView) {
         syntheticView.setPersistedSetting("columns", aState);
+      }
       return;
     }
 
-    if (!this.view.displayedFolder || !this.view.displayedFolder.msgDatabase)
+    if (!this.view.displayedFolder || !this.view.displayedFolder.msgDatabase) {
       return;
+    }
 
     let msgDatabase = this.view.displayedFolder.msgDatabase;
     let dbFolderInfo = msgDatabase.dBFolderInfo;
-    dbFolderInfo.setCharProperty(this.PERSISTED_COLUMN_PROPERTY_NAME,
-                                 JSON.stringify(aState));
+    dbFolderInfo.setCharProperty(
+      this.PERSISTED_COLUMN_PROPERTY_NAME,
+      JSON.stringify(aState)
+    );
     msgDatabase.Commit(Ci.nsMsgDBCommitType.kLargeCommit);
   },
 
   /**
    * Let us know that the state of the columns has changed.  This is either due
    *  to a re-ordering or hidden-ness being toggled.
    *
    * This method should only be called on (the active) gFolderDisplay.
    */
   hintColumnsChanged() {
     // ignore this if we are the ones doing things
-    if (this._touchingColumns)
+    if (this._touchingColumns) {
       return;
+    }
     this._persistColumnStates(this.getColumnStates());
   },
 
   /**
    * Either inherit the column state of another folder or use heuristics to
    *  figure out the best column state for the current folder.
    */
   _getDefaultColumnsForCurrentFolder(aDoNotInherit) {
     // If the view is synthetic, try asking it for its default columns. If it
     // fails, just return nothing, since most synthetic views don't care about
     // columns anyway.
     if (this.view.isSynthetic) {
-      if ("getDefaultSetting" in this.view._syntheticView)
+      if ("getDefaultSetting" in this.view._syntheticView) {
         return this.view._syntheticView.getDefaultSetting("columns");
+      }
       return {};
     }
 
     // do not inherit from the inbox if:
     // - It's an outgoing folder; these have a different use-case and there
     //    should be a small number of these, so it's okay to have no defaults.
     // - It's a virtual folder (single or multi-folder backed).  Who knows what
     //    the intent of the user is in this case.  This should also be bounded
     //    in number and our default heuristics should be pretty good.
     // - It's a multiple folder; this is either a search view (which has no
     //   displayed folder) or a virtual folder (which we eliminated above).
     // - News folders.  There is no inbox so there's nothing to inherit from.
     //    (Although we could try and see if they have opened any other news
     //    folders in the same account.  But it's not all that important to us.)
     // - It's an inbox!
-    let doNotInherit = aDoNotInherit ||
+    let doNotInherit =
+      aDoNotInherit ||
       this.view.isOutgoingFolder ||
       this.view.isVirtual ||
       this.view.isMultiFolder ||
       this.view.isNewsFolder ||
       this.displayedFolder.getFlag(Ci.nsMsgFolderFlags.Inbox);
 
     // Try and grab the inbox for this account's settings.  we may not be able
     //  to, in which case we just won't inherit.  (It ends up the same since the
     //  inbox is obviously not customized in this case.)
     if (!doNotInherit) {
-      let inboxFolder =
-        this.displayedFolder.rootFolder.getFolderWithFlags(Ci.nsMsgFolderFlags.Inbox);
+      let inboxFolder = this.displayedFolder.rootFolder.getFolderWithFlags(
+        Ci.nsMsgFolderFlags.Inbox
+      );
       if (inboxFolder) {
         let state = this._depersistColumnStatesFromDbFolderInfo(
-                      inboxFolder.msgDatabase.dBFolderInfo);
+          inboxFolder.msgDatabase.dBFolderInfo
+        );
         // inbox message databases don't get closed as a matter of policy.
 
-        if (state)
+        if (state) {
           return state;
+        }
       }
     }
 
     // if we are still here, use the defaults and helper functions
     let state = {};
     for (let colId of this.DEFAULT_COLUMNS) {
       let shouldShowColumn = true;
       if (colId in this.COLUMN_DEFAULT_TESTERS) {
@@ -586,17 +615,17 @@ FolderDisplayWidget.prototype = {
         //  killing us.
         try {
           shouldShowColumn = this.COLUMN_DEFAULT_TESTERS[colId](this.view);
         } catch (ex) {
           shouldShowColumn = false;
           Cu.reportError(ex);
         }
       }
-      state[colId] = {visible: shouldShowColumn};
+      state[colId] = { visible: shouldShowColumn };
     }
     return state;
   },
 
   /**
    * Is setColumnStates messing with the columns' DOM?  This is used by
    *  hintColumnsChanged to avoid wasteful state persistence.
    */
@@ -625,48 +654,55 @@ FolderDisplayWidget.prototype = {
     this._touchingColumns = true;
 
     try {
       let cols = document.getElementById("threadCols");
       let colChildren = cols.children;
 
       for (let iKid = 0; iKid < colChildren.length; iKid++) {
         let colChild = colChildren[iKid];
-        if (colChild == null)
+        if (colChild == null) {
           continue;
+        }
 
         // We only care about treecols.  The splitters do not need to be marked
         //  hidden or un-hidden.
         if (colChild.tagName == "treecol") {
           // if it doesn't have preserved state it should be hidden
           let shouldBeHidden = true;
           // restore state
           if (colChild.id in aColumnStates) {
             let colState = aColumnStates[colChild.id];
-            if ("visible" in colState)
+            if ("visible" in colState) {
               shouldBeHidden = !colState.visible;
-            if (("ordinal" in colState) &&
-                colChild.getAttribute("ordinal") != colState.ordinal)
+            }
+            if (
+              "ordinal" in colState &&
+              colChild.getAttribute("ordinal") != colState.ordinal
+            ) {
               colChild.setAttribute("ordinal", colState.ordinal);
+            }
           }
           let isHidden = colChild.getAttribute("hidden") == "true";
           if (isHidden != shouldBeHidden) {
-            if (shouldBeHidden)
+            if (shouldBeHidden) {
               colChild.setAttribute("hidden", "true");
-            else
+            } else {
               colChild.removeAttribute("hidden");
+            }
           }
         }
       }
     } finally {
       this._touchingColumns = false;
     }
 
-    if (aPersistChanges)
+    if (aPersistChanges) {
       this.hintColumnsChanged();
+    }
   },
 
   /**
    * A dictionary that maps column ids to dictionaries where each dictionary
    *  has the following fields:
    * - visible: Is the column visible.
    * - ordinal: The 1-based XUL 'ordinal' value assigned to the column.  This
    *    corresponds to the position but is not something you want to manipulate.
@@ -676,27 +712,29 @@ FolderDisplayWidget.prototype = {
 
   /**
    * Return a dictionary in the form of |_savedColumnStates| representing the
    *  current column states.
    *
    * @public
    */
   getColumnStates() {
-    if (!this._active)
+    if (!this._active) {
       return this._savedColumnStates;
+    }
 
     let columnStates = {};
 
     let cols = document.getElementById("threadCols");
     let colChildren = cols.children;
     for (let iKid = 0; iKid < colChildren.length; iKid++) {
       let colChild = colChildren[iKid];
-      if (colChild.tagName != "treecol")
+      if (colChild.tagName != "treecol") {
         continue;
+      }
       columnStates[colChild.id] = {
         visible: colChild.getAttribute("hidden") != "true",
         ordinal: colChild.getAttribute("ordinal"),
       };
     }
 
     return columnStates;
   },
@@ -781,33 +819,36 @@ FolderDisplayWidget.prototype = {
       } else {
         this._nonViewFolder = null;
         this.view.open(aFolder);
       }
     } else {
       // it must be a synthetic view
       this.view.openSynthetic(aFolder);
     }
-    if (this._active)
+    if (this._active) {
       this.makeActive();
+    }
 
-    if (this._tabInfo)
+    if (this._tabInfo) {
       document.getElementById("tabmail").setTabTitle(this._tabInfo);
+    }
   },
 
   /**
    * Clone an existing view wrapper as the basis for our display.
    */
   cloneView(aViewWrapper) {
     this.view = aViewWrapper.clone(this);
     // generate a view created notification; this will cause us to do the right
     //  thing in terms of associating the view with the tree and such.
     this.onCreatedView();
-    if (this._active)
+    if (this._active) {
       this.makeActive();
+    }
   },
 
   /**
    * Close resources associated with the currently displayed folder because you
    *  no longer care about this FolderDisplayWidget.
    */
   close() {
     // Mark ourselves as inactive without doing any of the hard work of becoming
@@ -852,99 +893,109 @@ FolderDisplayWidget.prototype = {
    *  can occur.
    *
    * @return true if the folder should be shown immediately, false if we should
    *     wait for updateFolder to complete.
    */
   get shouldDeferMessageDisplayUntilAfterServerConnect() {
     let passwordPromptRequired = false;
 
-    if (Services.prefs.getBoolPref("mail.password_protect_local_cache"))
-      passwordPromptRequired =
-        this.view.displayedFolder.server.passwordPromptRequired;
+    if (Services.prefs.getBoolPref("mail.password_protect_local_cache")) {
+      passwordPromptRequired = this.view.displayedFolder.server
+        .passwordPromptRequired;
+    }
 
     return passwordPromptRequired;
   },
 
   /**
    * Let the viewWrapper know if it should mark the messages read when leaving
    *  the provided folder.
    *
    * @return true if the preference is set for the folder's server type.
    */
   shouldMarkMessagesReadOnLeavingFolder(aMsgFolder) {
-      return Services.prefs.getBoolPref("mailnews.mark_message_read." +
-                                        aMsgFolder.server.type);
+    return Services.prefs.getBoolPref(
+      "mailnews.mark_message_read." + aMsgFolder.server.type
+    );
   },
 
   /**
    * The view wrapper tells us when it starts loading a folder, and we set the
    *  cursor busy.  Setting the cursor busy on a per-tab basis is us being
    *  nice to the future. Loading a folder is a blocking operation that is going
    *  to make us unresponsive and accordingly make it very hard for the user to
    *  change tabs.
    */
   onFolderLoading(aFolderLoading) {
-    if (this._tabInfo)
-      document.getElementById("tabmail").setTabBusy(this._tabInfo,
-                                                    aFolderLoading);
+    if (this._tabInfo) {
+      document
+        .getElementById("tabmail")
+        .setTabBusy(this._tabInfo, aFolderLoading);
+    }
 
-    FolderDisplayListenerManager._fireListeners("onFolderLoading",
-                                                [this, aFolderLoading]);
+    FolderDisplayListenerManager._fireListeners("onFolderLoading", [
+      this,
+      aFolderLoading,
+    ]);
   },
 
   /**
    * The view wrapper tells us when a search is active, and we mark the tab as
    *  thinking so the user knows something is happening.  'Searching' in this
    *  case is more than just a user-initiated search.  Virtual folders / saved
    *  searches, mail views, plus the more obvious quick search are all based off
    *  of searches and we will receive a notification for them.
    */
   onSearching(aIsSearching) {
     if (this._tabInfo) {
       let searchBundle = document.getElementById("bundle_search");
-      document.getElementById("tabmail").setTabThinking(
-        this._tabInfo,
-        aIsSearching && searchBundle.getString("searchingMessage"));
+      document
+        .getElementById("tabmail")
+        .setTabThinking(
+          this._tabInfo,
+          aIsSearching && searchBundle.getString("searchingMessage")
+        );
     }
 
-    FolderDisplayListenerManager._fireListeners("onSearching",
-                                                [this, aIsSearching]);
+    FolderDisplayListenerManager._fireListeners("onSearching", [
+      this,
+      aIsSearching,
+    ]);
   },
 
   /**
    * Things we do on creating a view:
    * - notify the observer service so that custom column handler providers can
    *   add their custom columns to our view.
    */
   onCreatedView() {
     // All of our messages are not displayed if the view was just created.  We
     //  will get an onMessagesLoaded(true) nearly immediately if this is a local
     //  folder where view creation is synonymous with having all messages.
     this._allMessagesLoaded = false;
     this.messageDisplay.onCreatedView();
 
-    FolderDisplayListenerManager._fireListeners("onCreatedView",
-                                                [this]);
+    FolderDisplayListenerManager._fireListeners("onCreatedView", [this]);
 
     this._notifyWhenActive(this._activeCreatedView);
   },
   _activeCreatedView() {
     gDBView = this.view.dbView; // eslint-disable-line no-global-assign
 
     // A change in view may result in changes to sorts, the view menu, etc.
     // Do this before we 'reroot' the dbview.
     this._updateThreadDisplay();
 
     // this creates a new selection object for the view.
-    if (this.tree)
+    if (this.tree) {
       this.tree.view = this.view.dbView;
+    }
 
-    FolderDisplayListenerManager._fireListeners("onActiveCreatedView",
-                                                [this]);
+    FolderDisplayListenerManager._fireListeners("onActiveCreatedView", [this]);
 
     // The data payload used to be viewType + ":" + viewFlags.  We no longer
     //  do this because we already have the implied contract that gDBView is
     //  valid at the time we generate the notification.  In such a case, you
     //  can easily get that information from the gDBView.  (The documentation
     //  on creating a custom column assumes gDBView.)
     Services.obs.notifyObservers(this.displayedFolder, "MsgCreateDBView");
   },
@@ -958,28 +1009,31 @@ FolderDisplayWidget.prototype = {
     if (this._active) {
       // If saving the selection throws an exception, we still want continue
       // destroying the view. Saving the selection can fail if an underlying
       // local folder has been compacted, invalidating the message keys.
       // See bug 536676 for more info.
       try {
         // If a new selection is coming up, there's no point in trying to
         // persist any selections.
-        if (aFolderIsComingBack && !this._aboutToSelectMessage)
+        if (aFolderIsComingBack && !this._aboutToSelectMessage) {
           this._saveSelection();
-        else
+        } else {
           this._clearSavedSelection();
+        }
       } catch (ex) {
         logException(ex);
       }
       gDBView = null; // eslint-disable-line no-global-assign
     }
 
-    FolderDisplayListenerManager._fireListeners("onDestroyingView",
-                                                [this, aFolderIsComingBack]);
+    FolderDisplayListenerManager._fireListeners("onDestroyingView", [
+      this,
+      aFolderIsComingBack,
+    ]);
 
     // if we have no view, no messages could be loaded.
     this._allMessagesLoaded = false;
 
     // but the actual tree view selection (based on view indices) is a goner no
     //  matter what, make everyone forget.
     this.view.dbView.selection = null;
     this._savedFirstVisibleRow = null;
@@ -998,70 +1052,75 @@ FolderDisplayWidget.prototype = {
 
   /**
    * Restore persisted information about what columns to display for the folder.
    *  If we have no persisted information, we leave/set _savedColumnStates null.
    *  The column states will be set to default values in onDisplayingFolder in
    *  that case.
    */
   onLoadingFolder(aDbFolderInfo) {
-    this._savedColumnStates =
-      this._depersistColumnStatesFromDbFolderInfo(aDbFolderInfo);
+    this._savedColumnStates = this._depersistColumnStatesFromDbFolderInfo(
+      aDbFolderInfo
+    );
 
-    FolderDisplayListenerManager._fireListeners("onLoadingFolder",
-                                                [this, aDbFolderInfo]);
+    FolderDisplayListenerManager._fireListeners("onLoadingFolder", [
+      this,
+      aDbFolderInfo,
+    ]);
   },
 
   /**
    * We are entering the folder for display:
    * - set the header cache size.
    * - Setup the columns if we did not already depersist in |onLoadingFolder|.
    */
   onDisplayingFolder() {
     let displayedFolder = this.view.displayedFolder;
     let msgDatabase = displayedFolder && displayedFolder.msgDatabase;
     if (msgDatabase) {
       msgDatabase.resetHdrCacheSize(this.PERF_HEADER_CACHE_SIZE);
     }
 
     // makeActive will restore the folder state
     if (!this._savedColumnStates) {
-      if (this.view.isSynthetic &&
-          "getPersistedSetting" in this.view._syntheticView) {
+      if (
+        this.view.isSynthetic &&
+        "getPersistedSetting" in this.view._syntheticView
+      ) {
         let columns = this.view._syntheticView.getPersistedSetting("columns");
         this._savedColumnStates = columns;
       } else {
         // get the default for this folder
         this._savedColumnStates = this._getDefaultColumnsForCurrentFolder();
         // and save it so it doesn't wiggle if the inbox/prototype changes
         this._persistColumnStates(this._savedColumnStates);
       }
     }
 
-    FolderDisplayListenerManager._fireListeners("onDisplayingFolder",
-                                                [this]);
+    FolderDisplayListenerManager._fireListeners("onDisplayingFolder", [this]);
 
-    if (this.active)
+    if (this.active) {
       this.makeActive();
+    }
   },
 
   /**
    * Notification from DBViewWrapper that it is closing the folder.  This can
    *  happen for reasons other than our own 'close' method closing the view.
    *  For example, user deletion of the folder or underlying folder closes it.
    */
   onLeavingFolder() {
-    FolderDisplayListenerManager._fireListeners("onLeavingFolder",
-                                                [this]);
+    FolderDisplayListenerManager._fireListeners("onLeavingFolder", [this]);
 
     // Keep the msgWindow's openFolder up-to-date; it powers nsMessenger's
     //  concept of history so that it can bring you back to the actual folder
     //  you were looking at, rather than just the underlying folder.
-    if (this._active)
+    if (this._active) {
       msgWindow.openFolder = null;
+    }
   },
 
   /**
    * Indicates whether we are done loading the messages that should be in this
    *  folder.  This is being surfaced for testing purposes, but could be useful
    *  to other code as well.  But don't poll this property; ask for an event
    *  that you can hook.
    */
@@ -1075,28 +1134,32 @@ FolderDisplayWidget.prototype = {
    *  entered. For a virtual folder, this happens when the search completes.
    *
    * What we do:
    * - Any scrolling required!
    */
   onMessagesLoaded(aAll) {
     this._allMessagesLoaded = aAll;
 
-    FolderDisplayListenerManager._fireListeners("onMessagesLoaded",
-                                                [this, aAll]);
+    FolderDisplayListenerManager._fireListeners("onMessagesLoaded", [
+      this,
+      aAll,
+    ]);
 
     this._notifyWhenActive(this._activeMessagesLoaded);
   },
   _activeMessagesLoaded() {
-    FolderDisplayListenerManager._fireListeners("onActiveMessagesLoaded",
-                                                [this]);
+    FolderDisplayListenerManager._fireListeners("onActiveMessagesLoaded", [
+      this,
+    ]);
 
     // - if a selectMessage's coming up, get out of here
-    if (this._aboutToSelectMessage)
+    if (this._aboutToSelectMessage) {
       return;
+    }
 
     // - restore user's last expand/collapse choice.
     this.restoreThreadState();
 
     // - restore selection
     // Attempt to restore the selection (if we saved it because the view was
     //  being destroyed or otherwise manipulated in a fashion that the normal
     //  nsTreeSelection would be unable to handle.)
@@ -1120,166 +1183,190 @@ FolderDisplayWidget.prototype = {
     //   first selected message and get out
     if (this.view.dbView.numSelected > 0) {
       this.ensureRowIsVisible(this.view.dbView.viewIndexForFirstSelectedMsg);
       return;
     }
 
     // - new messages
     // if configured to scroll to new messages, try that
-    if (Services.prefs.getBoolPref("mailnews.scroll_to_new_message") &&
-        this.navigate(Ci.nsMsgNavigationType.firstNew, /* select */ false))
+    if (
+      Services.prefs.getBoolPref("mailnews.scroll_to_new_message") &&
+      this.navigate(Ci.nsMsgNavigationType.firstNew, /* select */ false)
+    ) {
       return;
+    }
 
     // - last selected message
     // if configured to load the last selected message (this is currently more
     //  persistent than our saveSelection/restoreSelection stuff), and the view
     //  is backed by a single underlying folder (the only way having just a
     //  message key works out), try that
-    if (Services.prefs.getBoolPref("mailnews.remember_selected_message") &&
-        this.view.isSingleFolder && this.view.displayedFolder) {
+    if (
+      Services.prefs.getBoolPref("mailnews.remember_selected_message") &&
+      this.view.isSingleFolder &&
+      this.view.displayedFolder
+    ) {
       // use the displayed folder; nsMsgDBView goes to the effort to save the
       //  state to the viewFolder, so this is the correct course of action.
       let lastLoadedMessageKey = this.view.displayedFolder.lastMessageLoaded;
       if (lastLoadedMessageKey != nsMsgKey_None) {
         this.view.dbView.selectMsgByKey(lastLoadedMessageKey);
         // The message key may not be present in the view for a variety of
         //  reasons.  Beyond message deletion, it simply may not match the
         //  active mail view or quick search, for example.
         if (this.view.dbView.numSelected > 0) {
           this.ensureRowIsVisible(
-            this.view.dbView.viewIndexForFirstSelectedMsg);
+            this.view.dbView.viewIndexForFirstSelectedMsg
+          );
           return;
         }
       }
     }
 
     // - towards the newest messages, but don't select
-    if (this.view.isSortedAscending && this.view.sortImpliesTemporalOrdering &&
-      this.navigate(Ci.nsMsgNavigationType.lastMessage, /* select */ false))
+    if (
+      this.view.isSortedAscending &&
+      this.view.sortImpliesTemporalOrdering &&
+      this.navigate(Ci.nsMsgNavigationType.lastMessage, /* select */ false)
+    ) {
       return;
+    }
 
     // - to the top, the coliseum
     this.ensureRowIsVisible(0);
   },
 
   /**
    * The DBViewWrapper tells us when someone (possibly the wrapper itself)
    *  changes the active mail view so that we can kick the UI to update.
    */
   onMailViewChanged() {
     // only do this if we're currently active.  no need to queue it because we
     //  always update the mail view whenever we are made active.
     if (this.active) {
       // you cannot cancel a view change!
-      window.dispatchEvent(new Event("MailViewChanged",
-        { bubbles: false, cancelable: false }));
+      window.dispatchEvent(
+        new Event("MailViewChanged", { bubbles: false, cancelable: false })
+      );
     }
   },
 
   /**
    * Just the sort or threading was changed, without changing other things.  We
    *  will not get this notification if the view was re-created, for example.
    */
   onSortChanged() {
-    if (this.active)
-      UpdateSortIndicators(this.view.primarySortType,
-                           this.view.primarySortOrder);
+    if (this.active) {
+      UpdateSortIndicators(
+        this.view.primarySortType,
+        this.view.primarySortOrder
+      );
+    }
 
-    FolderDisplayListenerManager._fireListeners("onSortChanged",
-                                                [this]);
+    FolderDisplayListenerManager._fireListeners("onSortChanged", [this]);
   },
 
   /**
    * Messages (that may have been displayed) have been removed; this may impact
    * our message selection. We might know it's coming; if we do then
    * this._nextViewIndexAfterDelete should know what view index to select next.
    * For the imap mark-as-deleted we won't know beforehand.
    */
   onMessagesRemoved() {
-    FolderDisplayListenerManager._fireListeners("onMessagesRemoved",
-                                                [this]);
+    FolderDisplayListenerManager._fireListeners("onMessagesRemoved", [this]);
 
     let handled = this.messageDisplay.onMessagesRemoved();
     this._deleteInProgress = false;
-    if (handled)
+    if (handled) {
       return;
+    }
 
     // - we saw this coming
     let rowCount = this.view.dbView.rowCount;
-    if (!this._massMoveActive && (this._nextViewIndexAfterDelete != null)) {
+    if (!this._massMoveActive && this._nextViewIndexAfterDelete != null) {
       // adjust the index if it is after the last row...
       // (this can happen if the "mail.delete_matches_sort_order" pref is not
       //  set and the message is the last message in the view.)
-      if (this._nextViewIndexAfterDelete >= rowCount)
+      if (this._nextViewIndexAfterDelete >= rowCount) {
         this._nextViewIndexAfterDelete = rowCount - 1;
+      }
       // just select the index and get on with our lives
       this.selectViewIndex(this._nextViewIndexAfterDelete);
       this._nextViewIndexAfterDelete = null;
       return;
     }
 
     // - we didn't see it coming
 
     // A deletion happened to our folder.
     let treeSelection = this.treeSelection;
     // we can't fix the selection if we have no selection
-    if (!treeSelection)
+    if (!treeSelection) {
       return;
+    }
 
     // For reasons unknown (but theoretically knowable), sometimes the selection
     //  object will be invalid.  At least, I've reliably seen a selection of
     //  [0, 0] with 0 rows.  If that happens, we need to fix up the selection
     //  here.
-    if (rowCount == 0 && treeSelection.count)
+    if (rowCount == 0 && treeSelection.count) {
       // nsTreeSelection doesn't generate an event if we use clearRange, so use
       //  that to avoid spurious events, given that we are going to definitely
       //  trigger a change notification below.
       treeSelection.clearRange(0, 0);
+    }
 
     // Check if we now no longer have a selection, but we had exactly one
     //  message selected previously.  If we did, then try and do some
     //  'persistence of having a thing selected'.
-    if (treeSelection.count == 0 &&
-        this._mostRecentSelectionCounts.length > 1 &&
-        this._mostRecentSelectionCounts[1] == 1 &&
-        this._mostRecentCurrentIndices[1] != -1) {
+    if (
+      treeSelection.count == 0 &&
+      this._mostRecentSelectionCounts.length > 1 &&
+      this._mostRecentSelectionCounts[1] == 1 &&
+      this._mostRecentCurrentIndices[1] != -1
+    ) {
       let targetIndex = this._mostRecentCurrentIndices[1];
-      if (targetIndex >= rowCount)
+      if (targetIndex >= rowCount) {
         targetIndex = rowCount - 1;
+      }
       this.selectViewIndex(targetIndex);
       return;
     }
 
     // Otherwise, just tell the view that things have changed so it can update
     //  itself to the new state of things.
     // tell the view that things have changed so it can update itself suitably.
-    if (this.view.dbView)
+    if (this.view.dbView) {
       this.view.dbView.selectionChanged();
+    }
   },
 
   /**
    * Messages were not actually removed, but we were expecting that they would
    *  be.  Clean-up what onMessagesRemoved would have cleaned up, namely the
    *  next view index to select.
    */
   onMessageRemovalFailed() {
     this._nextViewIndexAfterDelete = null;
-    FolderDisplayListenerManager._fireListeners("onMessagesRemovalFailed",
-                                                [this]);
+    FolderDisplayListenerManager._fireListeners("onMessagesRemovalFailed", [
+      this,
+    ]);
   },
 
   /**
    * Update the status bar to reflect our exciting message counts.
    */
   onMessageCountsChanged() {
-    if (this.active)
+    if (this.active) {
       UpdateStatusMessageCounts(this.displayedFolder);
-    FolderDisplayListenerManager._fireListeners("onMessageCountsChanged",
-                                                [this]);
+    }
+    FolderDisplayListenerManager._fireListeners("onMessageCountsChanged", [
+      this,
+    ]);
   },
   // @}
   /* ===== End IDBViewWrapperListener ===== */
 
   /*   ==================================   */
   /* ===== nsIMsgDBViewCommandUpdater ===== */
   /*   ==================================   */
 
@@ -1292,18 +1379,19 @@ FolderDisplayWidget.prototype = {
   /**
    * This gets called when the selection changes AND !suppressCommandUpdating
    *  AND (we're not removing a row OR we are now out of rows).
    * In response, we update the toolbar.
    */
   updateCommandStatus() {
     // Do this only if we're active. If we aren't, we're going to take care of
     // this when we switch back to the tab.
-    if (this._active)
+    if (this._active) {
       UpdateMailToolbar("FolderDisplayWidget command updater notification");
+    }
   },
 
   /**
    * This gets called by nsMsgDBView::UpdateDisplayMessage following a call
    *  to nsIMessenger.OpenURL to kick off message display OR (UDM gets called)
    *  by nsMsgDBView::SelectionChanged in lieu of loading the message because
    *  mSupressMsgDisplay.
    * In other words, we get notified immediately after the process of displaying
@@ -1320,18 +1408,19 @@ FolderDisplayWidget.prototype = {
    *     notably different from just directly accessing the message header's
    *     subject.
    * @param aKeywords The keywords, which roughly translates to message tags.
    */
   displayMessageChanged(aFolder, aSubject, aKeywords) {
     // Hide previous stale message to prevent brief threadpane selection and
     // content displayed mismatch, on both folder and tab changes.
     let browser = getBrowser();
-    if (browser && browser.contentDocument && browser.contentDocument.body)
+    if (browser && browser.contentDocument && browser.contentDocument.body) {
       browser.contentDocument.body.hidden = true;
+    }
 
     UpdateMailToolbar("FolderDisplayWidget displayed message changed");
     let selected = this.view.dbView.getSelectedMsgHdrs();
     let msgHdr = selected.length ? selected[0] : null;
     this.messageDisplay.onDisplayingMessage(msgHdr);
 
     // Although deletes should now be so fast that the user has no time to do
     //  anything, treat the user explicitly choosing to display a different
@@ -1479,18 +1568,20 @@ FolderDisplayWidget.prototype = {
     this._restoreSelection();
   },
   // @}
   /* ===== End hints from the command infrastructure ==== */
 
   _updateThreadDisplay() {
     if (this.active) {
       if (this.view.dbView) {
-        UpdateSortIndicators(this.view.dbView.sortType,
-                             this.view.dbView.sortOrder);
+        UpdateSortIndicators(
+          this.view.dbView.sortType,
+          this.view.dbView.sortOrder
+        );
         SetNewsFolderColumns();
         UpdateSelectCol();
       }
     }
   },
 
   /**
    * Update the UI display apart from the thread tree because the folder being
@@ -1524,30 +1615,33 @@ FolderDisplayWidget.prototype = {
    * If the requested notification function is already queued, it will not be
    *  added a second time, and the original call ordering will be maintained.
    *  If a new call ordering is required, the list of notifications should
    *  probably be reset by the 'big bang' event (new view creation?).
    */
   _notifyWhenActive(aNotificationFunc) {
     if (this._active) {
       aNotificationFunc.call(this);
-    } else if (!this._notificationsPendingActivation.includes(aNotificationFunc)) {
+    } else if (
+      !this._notificationsPendingActivation.includes(aNotificationFunc)
+    ) {
       this._notificationsPendingActivation.push(aNotificationFunc);
     }
   },
 
   /**
    * Some notifications cannot run while the FolderDisplayWidget is inactive
    *  (presumbly because it is in a background tab).  We accumulate those in
    *  _notificationsPendingActivation and then this method runs them when we
    *  become active again.
    */
   _runNotificationsPendingActivation() {
-    if (!this._notificationsPendingActivation.length)
+    if (!this._notificationsPendingActivation.length) {
       return;
+    }
 
     let pendingNotifications = this._notificationsPendingActivation;
     this._notificationsPendingActivation = [];
     for (let notif of pendingNotifications) {
       notif.call(this);
     }
   },
 
@@ -1556,18 +1650,19 @@ FolderDisplayWidget.prototype = {
 
   /**
    * Whether the folder pane is visible. When we're inactive, we stash the value
    * in |this._folderPaneVisible|.
    */
   get folderPaneVisible() {
     if (this._active) {
       let folderPaneBox = document.getElementById("folderPaneBox");
-      if (folderPaneBox)
+      if (folderPaneBox) {
         return !folderPaneBox.collapsed;
+      }
     } else {
       return this._folderPaneVisible;
     }
 
     return null;
   },
 
   /**
@@ -1607,18 +1702,20 @@ FolderDisplayWidget.prototype = {
     this._active = true;
     this._runNotificationsPendingActivation();
 
     // Make sure we get rid of this._fakeTreeSelection, whether we use it below
     // or not.
     let fakeTreeSelection = this._fakeTreeSelection;
     this._fakeTreeSelection = null;
 
-    FolderDisplayListenerManager._fireListeners("onMakeActive",
-                                                [this, aWasInactive]);
+    FolderDisplayListenerManager._fireListeners("onMakeActive", [
+      this,
+      aWasInactive,
+    ]);
 
     // -- UI
 
     // We're going to set this to true if we've already caused a
     // selectionChanged event, so that the message display doesn't cause
     // another, or if a select message is coming up shortly.
     let dontReloadMessage = this._aboutToSelectMessage;
     // thread pane if we have a db view
@@ -1634,18 +1731,19 @@ FolderDisplayWidget.prototype = {
         if (this.tree) {
           // We might have assigned our JS tree selection to
           //  this.view.dbView.selection back in _hookUpFakeTree. If we've
           //  done so, null the selection out so that the line after this
           //  causes a real selection to be created.
           // If we haven't done so, we're fine as selection would be null here
           //  anyway. (The fake tree selection should persist only till the
           //  first time the tab is switched to.)
-          if (fakeTreeSelection)
+          if (fakeTreeSelection) {
             this.view.dbView.selection = null;
+          }
 
           // Setting the 'view' attribute on treeBox results in the following
           //  effective calls, noting that in makeInactive we made sure to null
           //  out its view so that it won't try and clean up any views or their
           //  selections.  (The actual actions happen in
           //  nsTreeBodyFrame::SetView)
           // - this.view.dbView.selection.tree = this.tree
           // - this.view.dbView.setTree(this.tree)
@@ -1654,66 +1752,74 @@ FolderDisplayWidget.prototype = {
           this.tree.view = this.view.dbView;
 
           if (fakeTreeSelection) {
             fakeTreeSelection.duplicateSelection(this.view.dbView.selection);
             // Since duplicateSelection will fire a selectionChanged event,
             // which will try to reload the message, we shouldn't do the same.
             dontReloadMessage = true;
           }
-          if (this._savedFirstVisibleRow != null)
+          if (this._savedFirstVisibleRow != null) {
             this.tree.scrollToRow(this._savedFirstVisibleRow);
+          }
         }
       }
 
       // Always restore the column state if we have persisted state.  We restore
       //  state on folder entry, in which case we were probably not inactive.
       this._restoreColumnStates();
 
       // the tab mode knows whether we are folder or message display, which
       //  impacts the legal modes
-      if (this._tabInfo)
-        mailTabType._setPaneStates(this._tabInfo.mode.legalPanes,
-          {folder: folderPaneVisible,
-           message: this.messageDisplay.visible});
+      if (this._tabInfo) {
+        mailTabType._setPaneStates(this._tabInfo.mode.legalPanes, {
+          folder: folderPaneVisible,
+          message: this.messageDisplay.visible,
+        });
+      }
 
       // update the columns and such that live inside the thread pane
       this._updateThreadDisplay();
 
       this.messageDisplay.makeActive(dontReloadMessage);
     } else {
       // account central stuff when we don't have a dbview
       this._showAccountCentral();
-      if (this._tabInfo)
-        mailTabType._setPaneStates(this._tabInfo.mode.accountCentralLegalPanes,
-          {folder: folderPaneVisible});
+      if (this._tabInfo) {
+        mailTabType._setPaneStates(
+          this._tabInfo.mode.accountCentralLegalPanes,
+          { folder: folderPaneVisible }
+        );
+      }
     }
 
     this._updateContextDisplay();
   },
 
   /**
    * Cause the displayDeck to display the thread pane.
    */
   _showThreadPane() {
-    document.getElementById("displayDeck").selectedPanel =
-      document.getElementById("threadPaneBox");
+    document.getElementById(
+      "displayDeck"
+    ).selectedPanel = document.getElementById("threadPaneBox");
   },
 
   /**
    * Cause the displayDeck to display the (preference configurable) account
    *  central page.
    */
   _showAccountCentral() {
     var accountBox = document.getElementById("accountCentralBox");
     document.getElementById("displayDeck").selectedPanel = accountBox;
     var prefName = "mailnews.account_central_page.url";
-    var acctCentralPage =
-      Services.prefs.getComplexValue(prefName,
-                                     Ci.nsIPrefLocalizedString).data;
+    var acctCentralPage = Services.prefs.getComplexValue(
+      prefName,
+      Ci.nsIPrefLocalizedString
+    ).data;
     // Prevent a second load if necessary.
     if (window.frames.accountCentralPane.location.href != acctCentralPage) {
       window.frames.accountCentralPane.location.href = acctCentralPage;
     }
   },
 
   /**
    * Call this when the tab using us is being hidden.
@@ -1726,26 +1832,28 @@ FolderDisplayWidget.prototype = {
     //  used by _saveColumnStates) so we must do this before marking inactive.
     this._saveColumnStates();
 
     // - mark us inactive
     this._active = false;
 
     // - (everything after this point doesn't care that we are marked inactive)
     // save the folder pane's state always
-    this._folderPaneVisible =
-      !document.getElementById("folderPaneBox").collapsed;
+    this._folderPaneVisible = !document.getElementById("folderPaneBox")
+      .collapsed;
 
     if (this.view.dbView) {
-      if (this.tree)
+      if (this.tree) {
         this._savedFirstVisibleRow = this.tree.getFirstVisibleRow();
+      }
 
       // save the message pane's state only when it is potentially visible
-      this.messagePaneCollapsed =
-        document.getElementById("messagepaneboxwrapper").collapsed;
+      this.messagePaneCollapsed = document.getElementById(
+        "messagepaneboxwrapper"
+      ).collapsed;
 
       this.hookUpFakeTree(true);
     }
 
     this.messageDisplay.makeInactive();
   },
   // @}
 
@@ -1764,18 +1872,19 @@ FolderDisplayWidget.prototype = {
     //  view forget about it when our view is removed, so it's up to us to
     //  save it.
     // We use this.treeSelection instead of this.view.dbView.selection here,
     //  so that we get the fake tree selection if we have it.
     let treeSelection = this.treeSelection;
     // if we want to, make the tree forget about the view right now so we can
     //  tell the db view about its selection object so it can try and keep it
     //  up-to-date even while hidden in the background
-    if (aNullRealTreeBoxView && this.tree)
+    if (aNullRealTreeBoxView && this.tree) {
       this.tree.view = null;
+    }
     // (and tell the db view about its selection again...)
     this.view.dbView.selection = treeSelection;
 
     // hook the dbview up to the fake tree box
     this._fakeTree.view = this.view.dbView;
     this.view.dbView.setTree(this._fakeTree);
     treeSelection.tree = this._fakeTree;
   },
@@ -1787,19 +1896,21 @@ FolderDisplayWidget.prototype = {
 
   /**
    * @return true if there is a db view and the command is enabled on the view.
    *  This function hides some of the XPCOM-odditities of the getCommandStatus
    *  call.
    */
   getCommandStatus(aCommandType, aEnabledObj, aCheckStatusObj) {
     // no view means not enabled
-    if (!this.view.dbView)
+    if (!this.view.dbView) {
       return false;
-    let enabledObj = {}, checkStatusObj = {};
+    }
+    let enabledObj = {},
+      checkStatusObj = {};
     this.view.dbView.getCommandStatus(aCommandType, enabledObj, checkStatusObj);
     return enabledObj.value;
   },
 
   /**
    * Make code cleaner by allowing peoples to call doCommand on us rather than
    *  having to do folderDisplayWidget.view.dbView.doCommand.
    *
@@ -1813,27 +1924,29 @@ FolderDisplayWidget.prototype = {
    * Make code cleaner by allowing peoples to call doCommandWithFolder on us
    *  rather than having to do:
    *  folderDisplayWidget.view.dbView.doCommandWithFolder.
    *
    * @param aCommandName The command name to invoke.
    * @param aFolder The folder context for the command.
    */
   doCommandWithFolder(aCommandName, aFolder) {
-    return this.view.dbView &&
-           this.view.dbView.doCommandWithFolder(aCommandName, aFolder);
+    return (
+      this.view.dbView &&
+      this.view.dbView.doCommandWithFolder(aCommandName, aFolder)
+    );
   },
   // @}
 
   /**
    * @return true when account central is being displayed.
    * @groupName Displayed
    */
   get isAccountCentralDisplayed() {
-    return (this.view.dbView == null);
+    return this.view.dbView == null;
   },
 
   /**
    * @name Navigation
    * @protected
    */
   // @{
 
@@ -1846,62 +1959,73 @@ FolderDisplayWidget.prototype = {
    * @param {nsMsgNavigationType} aNavType navigation command.
    * @param {Boolean} [aSelect=true] should we select the message if we find
    *     one?
    *
    * @return true if the navigation constraint matched anything, false if not.
    *     We will have navigated if true, we will have done nothing if false.
    */
   navigate(aNavType, aSelect) {
-    if (aSelect === undefined)
+    if (aSelect === undefined) {
       aSelect = true;
-    let resultKeyObj = {}, resultIndexObj = {}, threadIndexObj = {};
+    }
+    let resultKeyObj = {},
+      resultIndexObj = {},
+      threadIndexObj = {};
 
     let summarizeSelection = this.summarizeSelectionInFolder;
 
     let treeSelection = this.treeSelection; // potentially magic getter
     let currentIndex = treeSelection ? treeSelection.currentIndex : 0;
 
     let viewIndex;
     // if we're doing next unread, and a collapsed thread is selected, and
     // the top level message is unread, just set the result manually to
     // the top level message, without using viewNavigate.
-    if (summarizeSelection &&
-        aNavType == Ci.nsMsgNavigationType.nextUnreadMessage &&
-        currentIndex != -1 &&
-        this.view.isCollapsedThreadAtIndex(currentIndex) &&
-        !(this.view.dbView.getFlagsAt(currentIndex) &
-          Ci.nsMsgMessageFlags.Read)) {
+    if (
+      summarizeSelection &&
+      aNavType == Ci.nsMsgNavigationType.nextUnreadMessage &&
+      currentIndex != -1 &&
+      this.view.isCollapsedThreadAtIndex(currentIndex) &&
+      !(this.view.dbView.getFlagsAt(currentIndex) & Ci.nsMsgMessageFlags.Read)
+    ) {
       viewIndex = currentIndex;
     } else {
       // always 'wrap' because the start index is relative to the selection.
       // (keep in mind that many forms of navigation do not care about the
       //  starting position or 'wrap' at all; for example, firstNew just finds
       //  the first new message.)
       // allegedly this does tree-expansion for us.
-      this.view.dbView.viewNavigate(aNavType, resultKeyObj, resultIndexObj,
-                                    threadIndexObj, true);
+      this.view.dbView.viewNavigate(
+        aNavType,
+        resultKeyObj,
+        resultIndexObj,
+        threadIndexObj,
+        true
+      );
       viewIndex = resultIndexObj.value;
     }
 
-    if (viewIndex == nsMsgViewIndex_None)
+    if (viewIndex == nsMsgViewIndex_None) {
       return false;
+    }
 
     // - Expand if required.
     // (The nsMsgDBView isn't really aware of the varying semantics of
     //  collapsed threads, so viewNavigate might tell us about the root message
     //  and leave it collapsed, not realizing that it needs to be expanded.)
-    if (summarizeSelection &&
-        this.view.isCollapsedThreadAtIndex(viewIndex))
+    if (summarizeSelection && this.view.isCollapsedThreadAtIndex(viewIndex)) {
       this.view.dbView.toggleOpenState(viewIndex);
+    }
 
-    if (aSelect)
+    if (aSelect) {
       this.selectViewIndex(viewIndex);
-    else
+    } else {
       this.ensureRowIsVisible(viewIndex);
+    }
     return true;
   },
 
   /**
    * Push a call to |navigate| to be what we do once we successfully open the
    *  next folder.  This is intended to be used by cross-folder navigation
    *  code.  It should call this method before triggering the folder change.
    */
@@ -1909,18 +2033,19 @@ FolderDisplayWidget.prototype = {
     this._pendingNavigation = [aNavType, aSelect];
   },
 
   /**
    * @return true if we are able to navigate using the given navigation type at
    *  this time.
    */
   navigateStatus(aNavType) {
-    if (!this.view.dbView)
+    if (!this.view.dbView) {
       return false;
+    }
     return this.view.dbView.navigateStatus(aNavType);
   },
   // @}
 
   /**
    * @name Selection
    */
   // @{
@@ -1937,19 +2062,21 @@ FolderDisplayWidget.prototype = {
    *  MessageDisplayWidget.  You can get to that via the messageDisplay
    *  attribute on this object or (potentially) via the gMessageDisplay object.
    */
   get selectedMessage() {
     // there are inconsistencies in hdrForFirstSelectedMessage between
     //  nsMsgDBView and nsMsgSearchDBView in whether they use currentIndex,
     //  do it ourselves.  (nsMsgDBView does not use currentIndex, search does.)
     let treeSelection = this.treeSelection;
-    if (!treeSelection || !treeSelection.count)
+    if (!treeSelection || !treeSelection.count) {
       return null;
-    let minObj = {}, maxObj = {};
+    }
+    let minObj = {},
+      maxObj = {};
     treeSelection.getRangeAt(0, minObj, maxObj);
     return this.view.dbView.getMsgHdrAt(minObj.value);
   },
 
   /**
    * @return true if there is a selected message and it's an RSS feed message;
    *  a feed message does not have to be in an rss account folder if stored in
    *  Tb15 and later.
@@ -1958,28 +2085,34 @@ FolderDisplayWidget.prototype = {
     return FeedMessageHandler.isFeedMessage(this.selectedMessage);
   },
 
   /**
    * @return true if there is a selected message and it's an IMAP message.
    */
   get selectedMessageIsImap() {
     let message = this.selectedMessage;
-    return Boolean(message && message.folder &&
-                   message.folder.flags & Ci.nsMsgFolderFlags.ImapBox);
+    return Boolean(
+      message &&
+        message.folder &&
+        message.folder.flags & Ci.nsMsgFolderFlags.ImapBox
+    );
   },
 
   /**
    * @return true if there is a selected message and it's a news message.  It
    *  would be great if messages knew this about themselves, but they don't.
    */
   get selectedMessageIsNews() {
     let message = this.selectedMessage;
-    return Boolean(message && message.folder &&
-                   (message.folder.flags & Ci.nsMsgFolderFlags.Newsgroup));
+    return Boolean(
+      message &&
+        message.folder &&
+        message.folder.flags & Ci.nsMsgFolderFlags.Newsgroup
+    );
   },
 
   /**
    * @return true if there is a selected message and it's an external message,
    *  meaning it is loaded from an .eml file on disk or is an rfc822 attachment
    *  on a message.
    */
   get selectedMessageIsExternal() {
@@ -1995,38 +2128,45 @@ FolderDisplayWidget.prototype = {
   },
 
   /**
    * @return true if there is a selected message and the message belongs to an
    *              ignored thread.
    */
   get selectedMessageThreadIgnored() {
     let message = this.selectedMessage;
-    return Boolean(message && message.folder &&
-                   message.folder.msgDatabase.IsIgnored(message.messageKey));
+    return Boolean(
+      message &&
+        message.folder &&
+        message.folder.msgDatabase.IsIgnored(message.messageKey)
+    );
   },
 
   /**
    * @return true if there is a selected message and the message is the base
    *              message for an ignored subthread.
    */
   get selectedMessageSubthreadIgnored() {
     let message = this.selectedMessage;
-    return Boolean(message && message.folder &&
-                   (message.flags & Ci.nsMsgMessageFlags.Ignored));
+    return Boolean(
+      message && message.folder && message.flags & Ci.nsMsgMessageFlags.Ignored
+    );
   },
 
   /**
    * @return true if there is a selected message and the message belongs to a
    *              watched thread.
    */
   get selectedMessageThreadWatched() {
     let message = this.selectedMessage;
-    return Boolean(message && message.folder &&
-                   message.folder.msgDatabase.IsWatched(message.messageKey));
+    return Boolean(
+      message &&
+        message.folder &&
+        message.folder.msgDatabase.IsWatched(message.messageKey)
+    );
   },
 
   /**
    * @return the number of selected messages.  If summarizeSelectionInFolder is
    *  true, then any collapsed thread roots that are selected will also
    *  conceptually have all of the messages in that thread selected.
    */
   get selectedCount() {
@@ -2042,18 +2182,19 @@ FolderDisplayWidget.prototype = {
    *  one.  (Or selectedMessageUris in some rare cases.)
    *
    * If the user has right-clicked on a message, this will return that message
    *  and not the selection prior to the right-click.
    *
    * @return a list of the view indices that are currently selected
    */
   get selectedIndices() {
-    if (!this.view.dbView)
+    if (!this.view.dbView) {
       return [];
+    }
 
     return this.view.dbView.getIndicesForSelection();
   },
 
   /**
    * Provides a list of the message headers for the currently selected messages.
    *  If summarizeSelectionInFolder is true, then any collapsed thread roots
    *  that are selected will also (conceptually) have all of the messages in
@@ -2062,33 +2203,35 @@ FolderDisplayWidget.prototype = {
    * If the user has right-clicked on a message, this will return that message
    *  (and any collapsed children if so enabled) and not the selection prior to
    *  the right-click.
    *
    * @return a list of the message headers for the currently selected messages.
    *     If there are no selected messages, the result is an empty list.
    */
   get selectedMessages() {
-    if (!this.view.dbView)
+    if (!this.view.dbView) {
       return [];
+    }
     return this.view.dbView.getSelectedMsgHdrs();
   },
 
   /**
    * @return a list of the URIs for the currently selected messages or null
    *     (instead of a list) if there are no selected messages.  Do not
    *     pass around URIs unless you have a good reason.  Legacy code is an
    *     ok reason.
    *
    * If the user has right-clicked on a message, this will return that message's
    *  URI and not the selection prior to the right-click.
    */
   get selectedMessageUris() {
-    if (!this.view.dbView)
+    if (!this.view.dbView) {
       return null;
+    }
 
     let messageArray = this.view.dbView.getURIsForSelection();
     return messageArray.length ? messageArray : null;
   },
 
   /**
    * The maximum number of messages to try to examine directly to determine if
    * they can be archived; if we exceed this count, we'll try to approximate
@@ -2096,87 +2239,98 @@ FolderDisplayWidget.prototype = {
    * let tests tweak the value.
    */
   MAX_COUNT_FOR_CAN_ARCHIVE_CHECK: 100,
 
   /**
    * @return true if all the selected messages can be archived, false otherwise.
    */
   get canArchiveSelectedMessages() {
-    if (!this.view.dbView || this.messageDisplay.isDummy)
+    if (!this.view.dbView || this.messageDisplay.isDummy) {
       return false;
+    }
 
-    if (this.selectedCount == 0)
+    if (this.selectedCount == 0) {
       return false;
+    }
 
     // If we're looking at a single folder (i.e. not a cross-fol