Bug 1561435 - Format toolkit/mozapps/, a=automatic-formatting
authorVictor Porof <vporof@mozilla.com>
Fri, 05 Jul 2019 11:17:14 +0200
changeset 541092 58fd5776802aa7dd7e6d3fddd7d433da5ef30426
parent 541091 e5be4c59b7f15f98fabb32a68fc64050ddb62bcb
child 541093 8be6c7ab9d2793c8d085c6868f6bb7591e3cd6bb
push id11533
push userarchaeopteryx@coole-files.de
push dateMon, 08 Jul 2019 18:18:03 +0000
treeherdermozilla-beta@f4452e031aed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatic-formatting
bugs1561435
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1561435 - Format toolkit/mozapps/, a=automatic-formatting # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D36057
toolkit/mozapps/downloads/DownloadLastDir.jsm
toolkit/mozapps/downloads/DownloadUtils.jsm
toolkit/mozapps/downloads/HelperAppDlg.jsm
toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_delayedbutton.js
toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_dialog_layout.js
toolkit/mozapps/downloads/tests/unit/head_downloads.js
toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js
toolkit/mozapps/downloads/tests/unit/test_lowMinutes.js
toolkit/mozapps/downloads/tests/unit/test_syncedDownloadUtils.js
toolkit/mozapps/downloads/tests/unit/test_unspecified_arguments.js
toolkit/mozapps/extensions/AbuseReporter.jsm
toolkit/mozapps/extensions/AddonManager.jsm
toolkit/mozapps/extensions/Blocklist.jsm
toolkit/mozapps/extensions/LightweightThemeManager.jsm
toolkit/mozapps/extensions/addonManager.js
toolkit/mozapps/extensions/amContentHandler.jsm
toolkit/mozapps/extensions/amInstallTrigger.jsm
toolkit/mozapps/extensions/amWebAPI.jsm
toolkit/mozapps/extensions/content/aboutaddons.js
toolkit/mozapps/extensions/content/aboutaddonsCommon.js
toolkit/mozapps/extensions/content/abuse-report-frame.js
toolkit/mozapps/extensions/content/abuse-report-panel.js
toolkit/mozapps/extensions/content/abuse-reports.js
toolkit/mozapps/extensions/content/blocklist.js
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/message-bar.js
toolkit/mozapps/extensions/content/named-deck.js
toolkit/mozapps/extensions/content/pluginPrefs.js
toolkit/mozapps/extensions/content/shortcuts.js
toolkit/mozapps/extensions/internal/AddonRepository.jsm
toolkit/mozapps/extensions/internal/AddonSettings.jsm
toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
toolkit/mozapps/extensions/internal/AddonUpdateChecker.jsm
toolkit/mozapps/extensions/internal/Content.js
toolkit/mozapps/extensions/internal/GMPProvider.jsm
toolkit/mozapps/extensions/internal/PluginProvider.jsm
toolkit/mozapps/extensions/internal/ProductAddonChecker.jsm
toolkit/mozapps/extensions/internal/XPIDatabase.jsm
toolkit/mozapps/extensions/internal/XPIInstall.jsm
toolkit/mozapps/extensions/internal/XPIProvider.jsm
toolkit/mozapps/extensions/test/browser/browser_CTP_plugins.js
toolkit/mozapps/extensions/test/browser/browser_about_debugging_link.js
toolkit/mozapps/extensions/test/browser/browser_bug523784.js
toolkit/mozapps/extensions/test/browser/browser_bug562890.js
toolkit/mozapps/extensions/test/browser/browser_bug562899.js
toolkit/mozapps/extensions/test/browser/browser_bug567127.js
toolkit/mozapps/extensions/test/browser/browser_bug567137.js
toolkit/mozapps/extensions/test/browser/browser_bug570760.js
toolkit/mozapps/extensions/test/browser/browser_bug572561.js
toolkit/mozapps/extensions/test/browser/browser_bug577990.js
toolkit/mozapps/extensions/test/browser/browser_bug580298.js
toolkit/mozapps/extensions/test/browser/browser_bug586574.js
toolkit/mozapps/extensions/test/browser/browser_bug587970.js
toolkit/mozapps/extensions/test/browser/browser_bug590347.js
toolkit/mozapps/extensions/test/browser/browser_bug591465.js
toolkit/mozapps/extensions/test/browser/browser_bug591663.js
toolkit/mozapps/extensions/test/browser/browser_bug618502.js
toolkit/mozapps/extensions/test/browser/browser_bug679604.js
toolkit/mozapps/extensions/test/browser/browser_checkAddonCompatibility.js
toolkit/mozapps/extensions/test/browser/browser_details.js
toolkit/mozapps/extensions/test/browser/browser_discovery.js
toolkit/mozapps/extensions/test/browser/browser_discovery_clientid.js
toolkit/mozapps/extensions/test/browser/browser_dragdrop.js
toolkit/mozapps/extensions/test/browser/browser_extension_sideloading_permission.js
toolkit/mozapps/extensions/test/browser/browser_file_xpi_no_process_switch.js
toolkit/mozapps/extensions/test/browser/browser_globalwarnings.js
toolkit/mozapps/extensions/test/browser/browser_gmpProvider.js
toolkit/mozapps/extensions/test/browser/browser_history_navigation.js
toolkit/mozapps/extensions/test/browser/browser_html_abuse_report.js
toolkit/mozapps/extensions/test/browser/browser_html_detail_view.js
toolkit/mozapps/extensions/test/browser/browser_html_discover_view.js
toolkit/mozapps/extensions/test/browser/browser_html_discover_view_clientid.js
toolkit/mozapps/extensions/test/browser/browser_html_discover_view_prefs.js
toolkit/mozapps/extensions/test/browser/browser_html_list_view.js
toolkit/mozapps/extensions/test/browser/browser_html_list_view_recommendations.js
toolkit/mozapps/extensions/test/browser/browser_html_message_bar.js
toolkit/mozapps/extensions/test/browser/browser_html_named_deck.js
toolkit/mozapps/extensions/test/browser/browser_html_options_ui.js
toolkit/mozapps/extensions/test/browser/browser_html_options_ui_in_tab.js
toolkit/mozapps/extensions/test/browser/browser_html_plugins.js
toolkit/mozapps/extensions/test/browser/browser_html_recent_updates.js
toolkit/mozapps/extensions/test/browser/browser_html_recommendations.js
toolkit/mozapps/extensions/test/browser/browser_html_updates.js
toolkit/mozapps/extensions/test/browser/browser_html_warning_messages.js
toolkit/mozapps/extensions/test/browser/browser_inlinesettings_browser.js
toolkit/mozapps/extensions/test/browser/browser_installssl.js
toolkit/mozapps/extensions/test/browser/browser_interaction_telemetry.js
toolkit/mozapps/extensions/test/browser/browser_langpack_signing.js
toolkit/mozapps/extensions/test/browser/browser_legacy.js
toolkit/mozapps/extensions/test/browser/browser_legacy_pre57.js
toolkit/mozapps/extensions/test/browser/browser_list.js
toolkit/mozapps/extensions/test/browser/browser_manage_shortcuts.js
toolkit/mozapps/extensions/test/browser/browser_manage_shortcuts_hidden.js
toolkit/mozapps/extensions/test/browser/browser_manualupdates.js
toolkit/mozapps/extensions/test/browser/browser_plugin_enabled_state_locked.js
toolkit/mozapps/extensions/test/browser/browser_pluginprefs.js
toolkit/mozapps/extensions/test/browser/browser_pluginprefs_is_not_disabled.js
toolkit/mozapps/extensions/test/browser/browser_recentupdates.js
toolkit/mozapps/extensions/test/browser/browser_reinstall.js
toolkit/mozapps/extensions/test/browser/browser_sorting.js
toolkit/mozapps/extensions/test/browser/browser_sorting_plugins.js
toolkit/mozapps/extensions/test/browser/browser_tabsettings.js
toolkit/mozapps/extensions/test/browser/browser_theme_previews.js
toolkit/mozapps/extensions/test/browser/browser_types.js
toolkit/mozapps/extensions/test/browser/browser_uninstalling.js
toolkit/mozapps/extensions/test/browser/browser_updateid.js
toolkit/mozapps/extensions/test/browser/browser_updatessl.js
toolkit/mozapps/extensions/test/browser/browser_webapi.js
toolkit/mozapps/extensions/test/browser/browser_webapi_access.js
toolkit/mozapps/extensions/test/browser/browser_webapi_addon_listener.js
toolkit/mozapps/extensions/test/browser/browser_webapi_enable.js
toolkit/mozapps/extensions/test/browser/browser_webapi_install.js
toolkit/mozapps/extensions/test/browser/browser_webapi_install_disabled.js
toolkit/mozapps/extensions/test/browser/browser_webapi_theme.js
toolkit/mozapps/extensions/test/browser/browser_webapi_uninstall.js
toolkit/mozapps/extensions/test/browser/browser_webext_icon.js
toolkit/mozapps/extensions/test/browser/browser_webext_incognito.js
toolkit/mozapps/extensions/test/browser/browser_webext_incognito_doorhanger_telemetry.js
toolkit/mozapps/extensions/test/browser/browser_webext_options.js
toolkit/mozapps/extensions/test/browser/browser_webext_options_addon_reload.js
toolkit/mozapps/extensions/test/browser/head.js
toolkit/mozapps/extensions/test/xpcshell/head_addons.js
toolkit/mozapps/extensions/test/xpcshell/head_compat.js
toolkit/mozapps/extensions/test/xpcshell/head_system_addons.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/head.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_appversion.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_clients.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_gfx.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_metadata_filters.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_osabi.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_flashonly.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_outdated.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_regexp.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_plugin_severities.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_prefs.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_severities.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklist_targetapp_filter.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_blocklistchange.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlacklist_Device.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlacklist_Equal_DriverNew.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlacklist_No_Comparison.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlacklist_Version.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_gfxBlacklist_prefs.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_pluginBlocklistCtp.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_pluginInfoURL.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_softblocked.js
toolkit/mozapps/extensions/test/xpcshell/rs-blocklist/test_switchImplementations.js
toolkit/mozapps/extensions/test/xpcshell/test_AbuseReporter.js
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository.js
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_cache.js
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_langpacks.js
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_paging.js
toolkit/mozapps/extensions/test/xpcshell/test_ProductAddonChecker.js
toolkit/mozapps/extensions/test/xpcshell/test_XPIStates.js
toolkit/mozapps/extensions/test/xpcshell/test_XPIcancel.js
toolkit/mozapps/extensions/test/xpcshell/test_addonStartup.js
toolkit/mozapps/extensions/test/xpcshell/test_addon_manager_telemetry_events.js
toolkit/mozapps/extensions/test/xpcshell/test_bad_json.js
toolkit/mozapps/extensions/test/xpcshell/test_badschema.js
toolkit/mozapps/extensions/test/xpcshell/test_builtin_location.js
toolkit/mozapps/extensions/test/xpcshell/test_cacheflush.js
toolkit/mozapps/extensions/test/xpcshell/test_compatoverrides.js
toolkit/mozapps/extensions/test/xpcshell/test_cookies.js
toolkit/mozapps/extensions/test/xpcshell/test_corrupt.js
toolkit/mozapps/extensions/test/xpcshell/test_crash_annotation_quoting.js
toolkit/mozapps/extensions/test/xpcshell/test_db_path.js
toolkit/mozapps/extensions/test/xpcshell/test_delay_update_webextension.js
toolkit/mozapps/extensions/test/xpcshell/test_dependencies.js
toolkit/mozapps/extensions/test/xpcshell/test_dictionary_webextension.js
toolkit/mozapps/extensions/test/xpcshell/test_distribution.js
toolkit/mozapps/extensions/test/xpcshell/test_duplicateplugins.js
toolkit/mozapps/extensions/test/xpcshell/test_error.js
toolkit/mozapps/extensions/test/xpcshell/test_ext_management.js
toolkit/mozapps/extensions/test/xpcshell/test_filepointer.js
toolkit/mozapps/extensions/test/xpcshell/test_getInstallSourceFromHost.js
toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js
toolkit/mozapps/extensions/test/xpcshell/test_harness.js
toolkit/mozapps/extensions/test/xpcshell/test_hidden.js
toolkit/mozapps/extensions/test/xpcshell/test_install.js
toolkit/mozapps/extensions/test/xpcshell/test_install_icons.js
toolkit/mozapps/extensions/test/xpcshell/test_isDebuggable.js
toolkit/mozapps/extensions/test/xpcshell/test_isReady.js
toolkit/mozapps/extensions/test/xpcshell/test_json_updatecheck.js
toolkit/mozapps/extensions/test/xpcshell/test_locale.js
toolkit/mozapps/extensions/test/xpcshell/test_no_addons.js
toolkit/mozapps/extensions/test/xpcshell/test_nodisable_hidden.js
toolkit/mozapps/extensions/test/xpcshell/test_onPropertyChanged_appDisabled.js
toolkit/mozapps/extensions/test/xpcshell/test_permissions.js
toolkit/mozapps/extensions/test/xpcshell/test_permissions_prefs.js
toolkit/mozapps/extensions/test/xpcshell/test_pluginchange.js
toolkit/mozapps/extensions/test/xpcshell/test_plugins.js
toolkit/mozapps/extensions/test/xpcshell/test_pref_properties.js
toolkit/mozapps/extensions/test/xpcshell/test_provider_markSafe.js
toolkit/mozapps/extensions/test/xpcshell/test_provider_shutdown.js
toolkit/mozapps/extensions/test/xpcshell/test_provider_unsafe_access_shutdown.js
toolkit/mozapps/extensions/test/xpcshell/test_provider_unsafe_access_startup.js
toolkit/mozapps/extensions/test/xpcshell/test_proxies.js
toolkit/mozapps/extensions/test/xpcshell/test_recommendations.js
toolkit/mozapps/extensions/test/xpcshell/test_registerchrome.js
toolkit/mozapps/extensions/test/xpcshell/test_registry.js
toolkit/mozapps/extensions/test/xpcshell/test_reinstall_disabled_addon.js
toolkit/mozapps/extensions/test/xpcshell/test_reload.js
toolkit/mozapps/extensions/test/xpcshell/test_safemode.js
toolkit/mozapps/extensions/test/xpcshell/test_schema_change.js
toolkit/mozapps/extensions/test/xpcshell/test_seen.js
toolkit/mozapps/extensions/test/xpcshell/test_shutdown.js
toolkit/mozapps/extensions/test/xpcshell/test_shutdown_barriers.js
toolkit/mozapps/extensions/test/xpcshell/test_sideloads.js
toolkit/mozapps/extensions/test/xpcshell/test_signed_inject.js
toolkit/mozapps/extensions/test/xpcshell/test_signed_install.js
toolkit/mozapps/extensions/test/xpcshell/test_signed_langpack.js
toolkit/mozapps/extensions/test/xpcshell/test_signed_long.js
toolkit/mozapps/extensions/test/xpcshell/test_signed_updatepref.js
toolkit/mozapps/extensions/test/xpcshell/test_signed_verify.js
toolkit/mozapps/extensions/test/xpcshell/test_startup.js
toolkit/mozapps/extensions/test/xpcshell/test_startup_enable.js
toolkit/mozapps/extensions/test/xpcshell/test_strictcompatibility.js
toolkit/mozapps/extensions/test/xpcshell/test_syncGUID.js
toolkit/mozapps/extensions/test/xpcshell/test_system_allowed.js
toolkit/mozapps/extensions/test/xpcshell/test_system_delay_update.js
toolkit/mozapps/extensions/test/xpcshell/test_system_repository.js
toolkit/mozapps/extensions/test/xpcshell/test_system_reset.js
toolkit/mozapps/extensions/test/xpcshell/test_system_update_blank.js
toolkit/mozapps/extensions/test/xpcshell/test_system_update_checkSizeHash.js
toolkit/mozapps/extensions/test/xpcshell/test_system_update_custom.js
toolkit/mozapps/extensions/test/xpcshell/test_system_update_empty.js
toolkit/mozapps/extensions/test/xpcshell/test_system_update_enterprisepolicy.js
toolkit/mozapps/extensions/test/xpcshell/test_system_update_fail.js
toolkit/mozapps/extensions/test/xpcshell/test_system_update_newset.js
toolkit/mozapps/extensions/test/xpcshell/test_system_update_overlapping.js
toolkit/mozapps/extensions/test/xpcshell/test_system_update_uninstall_check.js
toolkit/mozapps/extensions/test/xpcshell/test_system_update_upgrades.js
toolkit/mozapps/extensions/test/xpcshell/test_systemaddomstartupprefs.js
toolkit/mozapps/extensions/test/xpcshell/test_temporary.js
toolkit/mozapps/extensions/test/xpcshell/test_trash_directory.js
toolkit/mozapps/extensions/test/xpcshell/test_types.js
toolkit/mozapps/extensions/test/xpcshell/test_undouninstall.js
toolkit/mozapps/extensions/test/xpcshell/test_update.js
toolkit/mozapps/extensions/test/xpcshell/test_updateCancel.js
toolkit/mozapps/extensions/test/xpcshell/test_update_compatmode.js
toolkit/mozapps/extensions/test/xpcshell/test_update_noSystemAddonUpdate.js
toolkit/mozapps/extensions/test/xpcshell/test_update_strictcompat.js
toolkit/mozapps/extensions/test/xpcshell/test_update_webextensions.js
toolkit/mozapps/extensions/test/xpcshell/test_updatecheck.js
toolkit/mozapps/extensions/test/xpcshell/test_updatecheck_errors.js
toolkit/mozapps/extensions/test/xpcshell/test_updateid.js
toolkit/mozapps/extensions/test/xpcshell/test_upgrade.js
toolkit/mozapps/extensions/test/xpcshell/test_upgrade_incompatible.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension_events.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension_icons.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension_langpack.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension_paths.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension_theme.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/head.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklist_appversion.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklist_gfx.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklist_metadata_filters.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklist_osabi.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklist_plugin_flashonly.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklist_plugin_outdated.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklist_plugin_regexp.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklist_plugin_severities.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklist_prefs.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklist_severities.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklist_url_parameters.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklist_url_ping_count.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_blocklistchange.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_Device.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_DriverNew.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_Equal_DriverNew.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_Equal_DriverOld.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_Equal_OK.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_GTE_DriverOld.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_GTE_OK.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_No_Comparison.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_OK.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_OS.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_OSVersion_match.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_OSVersion_mismatch_DriverVersion.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_OSVersion_mismatch_OSVersion.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_Vendor.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_Version.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_gfxBlacklist_prefs.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_overrideblocklist.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_pluginBlocklistCtp.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_pluginInfoURL.js
toolkit/mozapps/extensions/test/xpcshell/xml-blocklist/test_softblocked.js
toolkit/mozapps/extensions/test/xpinstall/browser_amosigned_trigger.js
toolkit/mozapps/extensions/test/xpinstall/browser_amosigned_trigger_iframe.js
toolkit/mozapps/extensions/test/xpinstall/browser_amosigned_url.js
toolkit/mozapps/extensions/test/xpinstall/browser_auth.js
toolkit/mozapps/extensions/test/xpinstall/browser_auth2.js
toolkit/mozapps/extensions/test/xpinstall/browser_auth3.js
toolkit/mozapps/extensions/test/xpinstall/browser_auth4.js
toolkit/mozapps/extensions/test/xpinstall/browser_badargs.js
toolkit/mozapps/extensions/test/xpinstall/browser_badargs2.js
toolkit/mozapps/extensions/test/xpinstall/browser_badhash.js
toolkit/mozapps/extensions/test/xpinstall/browser_badhashtype.js
toolkit/mozapps/extensions/test/xpinstall/browser_block_fullscreen_prompt.js
toolkit/mozapps/extensions/test/xpinstall/browser_bug611242.js
toolkit/mozapps/extensions/test/xpinstall/browser_bug638292.js
toolkit/mozapps/extensions/test/xpinstall/browser_bug645699.js
toolkit/mozapps/extensions/test/xpinstall/browser_bug672485.js
toolkit/mozapps/extensions/test/xpinstall/browser_containers.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies2.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies3.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies4.js
toolkit/mozapps/extensions/test/xpinstall/browser_corrupt.js
toolkit/mozapps/extensions/test/xpinstall/browser_datauri.js
toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js
toolkit/mozapps/extensions/test/xpinstall/browser_empty.js
toolkit/mozapps/extensions/test/xpinstall/browser_enabled.js
toolkit/mozapps/extensions/test/xpinstall/browser_enabled2.js
toolkit/mozapps/extensions/test/xpinstall/browser_enabled3.js
toolkit/mozapps/extensions/test/xpinstall/browser_hash.js
toolkit/mozapps/extensions/test/xpinstall/browser_hash2.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash2.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash3.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash4.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash5.js
toolkit/mozapps/extensions/test/xpinstall/browser_httphash6.js
toolkit/mozapps/extensions/test/xpinstall/browser_installchrome.js
toolkit/mozapps/extensions/test/xpinstall/browser_localfile.js
toolkit/mozapps/extensions/test/xpinstall/browser_localfile2.js
toolkit/mozapps/extensions/test/xpinstall/browser_localfile3.js
toolkit/mozapps/extensions/test/xpinstall/browser_localfile4.js
toolkit/mozapps/extensions/test/xpinstall/browser_newwindow.js
toolkit/mozapps/extensions/test/xpinstall/browser_offline.js
toolkit/mozapps/extensions/test/xpinstall/browser_privatebrowsing.js
toolkit/mozapps/extensions/test/xpinstall/browser_relative.js
toolkit/mozapps/extensions/test/xpinstall/browser_signed_trigger.js
toolkit/mozapps/extensions/test/xpinstall/browser_softwareupdate.js
toolkit/mozapps/extensions/test/xpinstall/browser_trigger_redirect.js
toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger.js
toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger_iframe.js
toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger_xorigin.js
toolkit/mozapps/extensions/test/xpinstall/browser_whitelist.js
toolkit/mozapps/extensions/test/xpinstall/head.js
toolkit/mozapps/handling/ContentDispatchChooser.jsm
toolkit/mozapps/handling/content/dialog.js
toolkit/mozapps/installer/js-compare-ast.js
toolkit/mozapps/installer/precompile_cache.js
toolkit/mozapps/preferences/changemp.js
toolkit/mozapps/preferences/fontbuilder.js
toolkit/mozapps/preferences/removemp.js
toolkit/mozapps/update/UpdateListener.jsm
toolkit/mozapps/update/UpdateService.jsm
toolkit/mozapps/update/UpdateServiceStub.jsm
toolkit/mozapps/update/UpdateTelemetry.jsm
toolkit/mozapps/update/content/history.js
toolkit/mozapps/update/content/updateElevation.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloaded.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloaded_staged.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloaded_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloaded_stagingFailure.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloading.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_bc_downloading_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_malformedXML.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_noUpdate.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_check_unsupported.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadAuto.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadAuto_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadOptIn.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_downloadOptIn_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_completeBadSize.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize_complete.js
toolkit/mozapps/update/tests/browser/browser_aboutDialog_fc_patch_partialBadSize_completeBadSize.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloaded.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloaded_staged.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloaded_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloaded_stagingFailure.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloading.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_bc_downloading_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_malformedXML.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_noUpdate.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_check_unsupported.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadAuto.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadAuto_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadOptIn.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_downloadOptIn_staging.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_completeBadSize.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize_complete.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_fc_patch_partialBadSize_completeBadSize.js
toolkit/mozapps/update/tests/browser/browser_aboutPrefs_settings.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_check_cantApply.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_check_malformedXML.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_check_unsupported.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_downloadAutoFailures.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_downloadAutoFailures_bgWin.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_downloadOptIn.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_downloadOptIn_bgWin.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_downloadOptIn_staging.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_downloaded.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_downloaded_disableBITS.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_downloaded_staged.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_patch_completeBadSize.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_patch_partialBadSize.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_patch_partialBadSize_complete.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_bc_patch_partialBadSize_completeBadSize.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_sp_patch_completeApplyFailure.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_sp_patch_partialApplyFailure.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_sp_patch_partialApplyFailure_complete.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_sp_patch_partialApplyFailure_completeBadSize.js
toolkit/mozapps/update/tests/browser/browser_doorhanger_sp_patch_partialApplyFailure_complete_staging.js
toolkit/mozapps/update/tests/browser/browser_elevationDialog.js
toolkit/mozapps/update/tests/browser/browser_telemetry_complete_stageFailure.js
toolkit/mozapps/update/tests/browser/browser_telemetry_complete_staged_applied.js
toolkit/mozapps/update/tests/browser/browser_telemetry_partialBadSize_complete_staged_applied.js
toolkit/mozapps/update/tests/browser/browser_telemetry_partial_applyFailure_complete_stageFailure.js
toolkit/mozapps/update/tests/browser/browser_telemetry_partial_applyFailure_complete_staged_applied.js
toolkit/mozapps/update/tests/browser/browser_telemetry_partial_stageFailure_complete_stageFailure.js
toolkit/mozapps/update/tests/browser/browser_telemetry_partial_staged_applied.js
toolkit/mozapps/update/tests/browser/browser_telemetry_updatePing_ready.js
toolkit/mozapps/update/tests/browser/head.js
toolkit/mozapps/update/tests/data/shared.js
toolkit/mozapps/update/tests/data/sharedUpdateXML.js
toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
toolkit/mozapps/update/tests/unit_aus_update/ausReadStrings.js
toolkit/mozapps/update/tests/unit_aus_update/canCheckForAndCanApplyUpdates.js
toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForDifferentChannel.js
toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForOlderAppVersion.js
toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForSameVersionAndBuildID.js
toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingIncorrectStatus.js
toolkit/mozapps/update/tests/unit_aus_update/cleanupPendingVersionFileIncorrectStatus.js
toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogMove.js
toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogsFIFO.js
toolkit/mozapps/update/tests/unit_aus_update/downloadInterruptedNoRecovery.js
toolkit/mozapps/update/tests/unit_aus_update/downloadInterruptedOffline.js
toolkit/mozapps/update/tests/unit_aus_update/downloadInterruptedRecovery.js
toolkit/mozapps/update/tests/unit_aus_update/downloadResumeForSameAppVersion.js
toolkit/mozapps/update/tests/unit_aus_update/remoteUpdateXML.js
toolkit/mozapps/update/tests/unit_aus_update/updateAutoPrefMigrate.js
toolkit/mozapps/update/tests/unit_aus_update/updateDirectoryMigrate.js
toolkit/mozapps/update/tests/unit_aus_update/updateManagerXML.js
toolkit/mozapps/update/tests/unit_aus_update/urlConstruction.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgCallbackFileNotInInstallDirFailure.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgCallbackFilePathTooLongFailure.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTooLongFailure.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTraversalFailure.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallWorkingDirPathNotSameFailure_win.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgPatchDirPathTraversalFailure.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgStageDirNotInInstallDirFailure_win.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathLocalUNCFailure_win.js
toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathRelativeFailure.js
toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateAppBinInUseStageSuccess_win.js
toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageOldVersionFailure.js
toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js
toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js
toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageSuccessComplete_unix.js
toolkit/mozapps/update/tests/unit_base_updater/marFailurePartial.js
toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailurePartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessPartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marMissingUpdateSettings.js
toolkit/mozapps/update/tests/unit_base_updater/marMissingUpdateSettingsStage.js
toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailureComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailurePartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessComplete_win.js
toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessPartial_win.js
toolkit/mozapps/update/tests/unit_base_updater/marStageFailurePartial.js
toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessComplete.js
toolkit/mozapps/update/tests/unit_base_updater/marVersionDowngrade.js
toolkit/mozapps/update/tests/unit_base_updater/marWrongChannel.js
toolkit/mozapps/update/tests/unit_base_updater/marWrongChannelStage.js
toolkit/mozapps/update/tests/unit_service_updater/checkUpdaterSigSvc.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTooLongFailureSvc.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTraversalFailureSvc.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallWorkingDirPathNotSameFailureSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgPatchDirPathSuffixFailureSvc.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgPatchDirPathTraversalFailureSvc.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgStageDirNotInInstallDirFailureSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathLocalUNCFailureSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathRelativeFailureSvc.js
toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js
toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js
toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFailurePartialSvc.js
toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailurePartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessPartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailureCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailurePartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessCompleteSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessPartialSvc_win.js
toolkit/mozapps/update/tests/unit_service_updater/marStageFailurePartialSvc.js
toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js
--- a/toolkit/mozapps/downloads/DownloadLastDir.jsm
+++ b/toolkit/mozapps/downloads/DownloadLastDir.jsm
@@ -23,40 +23,44 @@
  * content preferences database. This can be disabled by setting the pref
  * browser.download.lastDir.savePerSite to false.
  */
 
 const LAST_DIR_PREF = "browser.download.lastDir";
 const SAVE_PER_SITE_PREF = LAST_DIR_PREF + ".savePerSite";
 const nsIFile = Ci.nsIFile;
 
-var EXPORTED_SYMBOLS = [ "DownloadLastDir" ];
+var EXPORTED_SYMBOLS = ["DownloadLastDir"];
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 let nonPrivateLoadContext = Cu.createLoadContext();
 let privateLoadContext = Cu.createPrivateLoadContext();
 
 var observer = {
-  QueryInterface: ChromeUtils.generateQI(["nsIObserver",
-                                          "nsISupportsWeakReference"]),
+  QueryInterface: ChromeUtils.generateQI([
+    "nsIObserver",
+    "nsISupportsWeakReference",
+  ]),
 
   observe(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "last-pb-context-exited":
         gDownloadLastDirFile = null;
         break;
       case "browser:purge-session-history":
         gDownloadLastDirFile = null;
-        if (Services.prefs.prefHasUserValue(LAST_DIR_PREF))
+        if (Services.prefs.prefHasUserValue(LAST_DIR_PREF)) {
           Services.prefs.clearUserPref(LAST_DIR_PREF);
+        }
         // Ensure that purging session history causes both the session-only PB cache
         // and persistent prefs to be cleared.
-        let cps2 = Cc["@mozilla.org/content-pref/service;1"].
-                     getService(Ci.nsIContentPrefService2);
+        let cps2 = Cc["@mozilla.org/content-pref/service;1"].getService(
+          Ci.nsIContentPrefService2
+        );
 
         cps2.removeByName(LAST_DIR_PREF, nonPrivateLoadContext);
         cps2.removeByName(LAST_DIR_PREF, privateLoadContext);
         break;
     }
   },
 };
 
@@ -77,93 +81,103 @@ function isContentPrefEnabled() {
   } catch (e) {
     return true;
   }
 }
 
 var gDownloadLastDirFile = readLastDirPref();
 
 function DownloadLastDir(aWindow) {
-  let loadContext = aWindow.docShell
-                           .QueryInterface(Ci.nsILoadContext);
+  let loadContext = aWindow.docShell.QueryInterface(Ci.nsILoadContext);
   // Need this in case the real thing has gone away by the time we need it.
   // We only care about the private browsing state. All the rest of the
   // load context isn't of interest to the content pref service.
-  this.fakeContext = loadContext.usePrivateBrowsing ?
-                       privateLoadContext :
-                       nonPrivateLoadContext;
+  this.fakeContext = loadContext.usePrivateBrowsing
+    ? privateLoadContext
+    : nonPrivateLoadContext;
 }
 
 DownloadLastDir.prototype = {
   isPrivate: function DownloadLastDir_isPrivate() {
     return this.fakeContext.usePrivateBrowsing;
   },
   // compat shims
-  get file() { return this._getLastFile(); },
-  set file(val) { this.setFile(null, val); },
+  get file() {
+    return this._getLastFile();
+  },
+  set file(val) {
+    this.setFile(null, val);
+  },
   cleanupPrivateFile() {
     gDownloadLastDirFile = null;
   },
 
   _getLastFile() {
-    if (gDownloadLastDirFile && !gDownloadLastDirFile.exists())
+    if (gDownloadLastDirFile && !gDownloadLastDirFile.exists()) {
       gDownloadLastDirFile = null;
+    }
 
     if (this.isPrivate()) {
-      if (!gDownloadLastDirFile)
+      if (!gDownloadLastDirFile) {
         gDownloadLastDirFile = readLastDirPref();
+      }
       return gDownloadLastDirFile;
     }
     return readLastDirPref();
   },
 
   getFileAsync(aURI, aCallback) {
     let plainPrefFile = this._getLastFile();
     if (!aURI || !isContentPrefEnabled()) {
       Services.tm.dispatchToMainThread(() => aCallback(plainPrefFile));
       return;
     }
 
     let uri = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
-    let cps2 = Cc["@mozilla.org/content-pref/service;1"]
-                 .getService(Ci.nsIContentPrefService2);
+    let cps2 = Cc["@mozilla.org/content-pref/service;1"].getService(
+      Ci.nsIContentPrefService2
+    );
     let result = null;
     cps2.getByDomainAndName(uri, LAST_DIR_PREF, this.fakeContext, {
-      handleResult: aResult => result = aResult,
+      handleResult: aResult => (result = aResult),
       handleCompletion(aReason) {
         let file = plainPrefFile;
-        if (aReason == Ci.nsIContentPrefCallback2.COMPLETE_OK &&
-           result instanceof Ci.nsIContentPref) {
+        if (
+          aReason == Ci.nsIContentPrefCallback2.COMPLETE_OK &&
+          result instanceof Ci.nsIContentPref
+        ) {
           try {
-            file = Cc["@mozilla.org/file/local;1"]
-                     .createInstance(Ci.nsIFile);
+            file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
             file.initWithPath(result.value);
           } catch (e) {
             file = plainPrefFile;
           }
         }
         aCallback(file);
       },
     });
   },
 
   setFile(aURI, aFile) {
     if (aURI && isContentPrefEnabled()) {
       let uri = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
-      let cps2 = Cc["@mozilla.org/content-pref/service;1"]
-                   .getService(Ci.nsIContentPrefService2);
-      if (aFile instanceof Ci.nsIFile)
+      let cps2 = Cc["@mozilla.org/content-pref/service;1"].getService(
+        Ci.nsIContentPrefService2
+      );
+      if (aFile instanceof Ci.nsIFile) {
         cps2.set(uri, LAST_DIR_PREF, aFile.path, this.fakeContext);
-      else
+      } else {
         cps2.removeByDomainAndName(uri, LAST_DIR_PREF, this.fakeContext);
+      }
     }
     if (this.isPrivate()) {
-      if (aFile instanceof Ci.nsIFile)
+      if (aFile instanceof Ci.nsIFile) {
         gDownloadLastDirFile = aFile.clone();
-      else
+      } else {
         gDownloadLastDirFile = null;
+      }
     } else if (aFile instanceof Ci.nsIFile) {
       Services.prefs.setComplexValue(LAST_DIR_PREF, nsIFile, aFile);
     } else if (Services.prefs.prefHasUserValue(LAST_DIR_PREF)) {
       Services.prefs.clearUserPref(LAST_DIR_PREF);
     }
   },
 };
--- a/toolkit/mozapps/downloads/DownloadUtils.jsm
+++ b/toolkit/mozapps/downloads/DownloadUtils.jsm
@@ -1,16 +1,16 @@
 /* vim: sw=2 ts=2 sts=2 expandtab filetype=javascript
  * 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/. */
 
 "use strict";
 
-var EXPORTED_SYMBOLS = [ "DownloadUtils" ];
+var EXPORTED_SYMBOLS = ["DownloadUtils"];
 
 /**
  * This module provides the DownloadUtils object which contains useful methods
  * for downloads such as displaying file sizes, transfer times, and download
  * locations.
  *
  * List of methods:
  *
@@ -32,30 +32,36 @@ var EXPORTED_SYMBOLS = [ "DownloadUtils"
  *
  * [string convertedBytes, string units]
  * convertByteUnits(int aBytes)
  *
  * [int time, string units, int subTime, string subUnits]
  * convertTimeUnits(double aSecs)
  */
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-ChromeUtils.defineModuleGetter(this, "PluralForm",
-                               "resource://gre/modules/PluralForm.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PluralForm",
+  "resource://gre/modules/PluralForm.jsm"
+);
 
 const MS_PER_DAY = 24 * 60 * 60 * 1000;
 
 var localeNumberFormatCache = new Map();
 function getLocaleNumberFormat(fractionDigits) {
   if (!localeNumberFormatCache.has(fractionDigits)) {
-    localeNumberFormatCache.set(fractionDigits,
-      new Services.intl.NumberFormat(undefined,
-                        { maximumFractionDigits: fractionDigits,
-                          minimumFractionDigits: fractionDigits }));
+    localeNumberFormatCache.set(
+      fractionDigits,
+      new Services.intl.NumberFormat(undefined, {
+        maximumFractionDigits: fractionDigits,
+        minimumFractionDigits: fractionDigits,
+      })
+    );
   }
   return localeNumberFormatCache.get(fractionDigits);
 }
 
 const kDownloadProperties =
   "chrome://mozapps/locale/downloads/downloads.properties";
 
 var gStr = {
@@ -80,17 +86,17 @@ var gStr = {
 };
 
 // This lazily initializes the string bundle upon first use.
 Object.defineProperty(this, "gBundle", {
   configurable: true,
   enumerable: true,
   get() {
     delete this.gBundle;
-    return this.gBundle = Services.strings.createBundle(kDownloadProperties);
+    return (this.gBundle = Services.strings.createBundle(kDownloadProperties));
   },
 });
 
 // Keep track of at most this many second/lastSec pairs so that multiple calls
 // to getTimeLeft produce the same time left
 const kCachedLastMaxSize = 10;
 var gCachedLast = [];
 
@@ -104,28 +110,43 @@ var DownloadUtils = {
    * @param [optional] aMaxBytes
    *        Total number of bytes or -1 for unknown
    * @param [optional] aSpeed
    *        Current transfer rate in bytes/sec or -1 for unknown
    * @param [optional] aLastSec
    *        Last time remaining in seconds or Infinity for unknown
    * @return A pair: [download status text, new value of "last seconds"]
    */
-  getDownloadStatus: function DU_getDownloadStatus(aCurrBytes, aMaxBytes,
-                                                   aSpeed, aLastSec) {
-    let [transfer, timeLeft, newLast, normalizedSpeed]
-      = this._deriveTransferRate(aCurrBytes, aMaxBytes, aSpeed, aLastSec);
+  getDownloadStatus: function DU_getDownloadStatus(
+    aCurrBytes,
+    aMaxBytes,
+    aSpeed,
+    aLastSec
+  ) {
+    let [
+      transfer,
+      timeLeft,
+      newLast,
+      normalizedSpeed,
+    ] = this._deriveTransferRate(aCurrBytes, aMaxBytes, aSpeed, aLastSec);
 
     let [rate, unit] = DownloadUtils.convertByteUnits(normalizedSpeed);
 
     let status;
     if (rate === "Infinity") {
       // Infinity download speed doesn't make sense. Show a localized phrase instead.
-      let params = [transfer, gBundle.GetStringFromName(gStr.infiniteRate), timeLeft];
-      status = gBundle.formatStringFromName(gStr.statusFormatInfiniteRate, params);
+      let params = [
+        transfer,
+        gBundle.GetStringFromName(gStr.infiniteRate),
+        timeLeft,
+      ];
+      status = gBundle.formatStringFromName(
+        gStr.statusFormatInfiniteRate,
+        params
+      );
     } else {
       let params = [transfer, rate, unit, timeLeft];
       status = gBundle.formatStringFromName(gStr.statusFormat, params);
     }
     return [status, newLast];
   },
 
   /**
@@ -139,21 +160,28 @@ var DownloadUtils = {
    * @param [optional] aMaxBytes
    *        Total number of bytes or -1 for unknown
    * @param [optional] aSpeed
    *        Current transfer rate in bytes/sec or -1 for unknown
    * @param [optional] aLastSec
    *        Last time remaining in seconds or Infinity for unknown
    * @return A pair: [download status text, new value of "last seconds"]
    */
-  getDownloadStatusNoRate:
-  function DU_getDownloadStatusNoRate(aCurrBytes, aMaxBytes, aSpeed,
-                                      aLastSec) {
-    let [transfer, timeLeft, newLast]
-      = this._deriveTransferRate(aCurrBytes, aMaxBytes, aSpeed, aLastSec);
+  getDownloadStatusNoRate: function DU_getDownloadStatusNoRate(
+    aCurrBytes,
+    aMaxBytes,
+    aSpeed,
+    aLastSec
+  ) {
+    let [transfer, timeLeft, newLast] = this._deriveTransferRate(
+      aCurrBytes,
+      aMaxBytes,
+      aSpeed,
+      aLastSec
+    );
 
     let params = [transfer, timeLeft];
     let status = gBundle.formatStringFromName(gStr.statusFormatNoRate, params);
     return [status, newLast];
   },
 
   /**
    * Helper function that returns a transfer string, a time remaining string,
@@ -164,29 +192,35 @@ var DownloadUtils = {
    *        Total number of bytes or -1 for unknown
    * @param [optional] aSpeed
    *        Current transfer rate in bytes/sec or -1 for unknown
    * @param [optional] aLastSec
    *        Last time remaining in seconds or Infinity for unknown
    * @return A triple: [amount transferred string, time remaining string,
    *                    new value of "last seconds"]
    */
-  _deriveTransferRate: function DU__deriveTransferRate(aCurrBytes,
-                                                       aMaxBytes, aSpeed,
-                                                       aLastSec) {
-    if (aMaxBytes == null)
+  _deriveTransferRate: function DU__deriveTransferRate(
+    aCurrBytes,
+    aMaxBytes,
+    aSpeed,
+    aLastSec
+  ) {
+    if (aMaxBytes == null) {
       aMaxBytes = -1;
-    if (aSpeed == null)
+    }
+    if (aSpeed == null) {
       aSpeed = -1;
-    if (aLastSec == null)
+    }
+    if (aLastSec == null) {
       aLastSec = Infinity;
+    }
 
     // Calculate the time remaining if we have valid values
-    let seconds = (aSpeed > 0) && (aMaxBytes > 0) ?
-      (aMaxBytes - aCurrBytes) / aSpeed : -1;
+    let seconds =
+      aSpeed > 0 && aMaxBytes > 0 ? (aMaxBytes - aCurrBytes) / aSpeed : -1;
 
     let transfer = DownloadUtils.getTransferTotal(aCurrBytes, aMaxBytes);
     let [timeLeft, newLast] = DownloadUtils.getTimeLeft(seconds, aLastSec);
     return [transfer, timeLeft, newLast, aSpeed];
   },
 
   /**
    * Generate the transfer progress string to show the current and total byte
@@ -195,45 +229,34 @@ var DownloadUtils = {
    *
    * @param aCurrBytes
    *        Number of bytes transferred so far
    * @param [optional] aMaxBytes
    *        Total number of bytes or -1 for unknown
    * @return The transfer progress text
    */
   getTransferTotal: function DU_getTransferTotal(aCurrBytes, aMaxBytes) {
-    if (aMaxBytes == null)
+    if (aMaxBytes == null) {
       aMaxBytes = -1;
+    }
 
     let [progress, progressUnits] = DownloadUtils.convertByteUnits(aCurrBytes);
     let [total, totalUnits] = DownloadUtils.convertByteUnits(aMaxBytes);
 
     // Figure out which byte progress string to display
     let name, values;
     if (aMaxBytes < 0) {
       name = gStr.transferNoTotal;
-      values = [
-        progress,
-        progressUnits,
-      ];
+      values = [progress, progressUnits];
     } else if (progressUnits == totalUnits) {
       name = gStr.transferSameUnits;
-      values = [
-        progress,
-        total,
-        totalUnits,
-      ];
+      values = [progress, total, totalUnits];
     } else {
       name = gStr.transferDiffUnits;
-      values = [
-        progress,
-        progressUnits,
-        total,
-        totalUnits,
-      ];
+      values = [progress, progressUnits, total, totalUnits];
     }
 
     return gBundle.formatStringFromName(name, values);
   },
 
   /**
    * Generate a "time left" string given an estimate on the time left and the
    * last time. The extra time is used to give a better estimate on the time to
@@ -243,71 +266,83 @@ var DownloadUtils = {
    * @param aSeconds
    *        Current estimate on number of seconds left for the download
    * @param [optional] aLastSec
    *        Last time remaining in seconds or Infinity for unknown
    * @return A pair: [time left text, new value of "last seconds"]
    */
   getTimeLeft: function DU_getTimeLeft(aSeconds, aLastSec) {
     let nf = new Services.intl.NumberFormat();
-    if (aLastSec == null)
+    if (aLastSec == null) {
       aLastSec = Infinity;
+    }
 
-    if (aSeconds < 0)
+    if (aSeconds < 0) {
       return [gBundle.GetStringFromName(gStr.timeUnknown), aLastSec];
+    }
 
     // Try to find a cached lastSec for the given second
-    aLastSec = gCachedLast.reduce((aResult, aItem) =>
-      aItem[0] == aSeconds ? aItem[1] : aResult, aLastSec);
+    aLastSec = gCachedLast.reduce(
+      (aResult, aItem) => (aItem[0] == aSeconds ? aItem[1] : aResult),
+      aLastSec
+    );
 
     // Add the current second/lastSec pair unless we have too many
     gCachedLast.push([aSeconds, aLastSec]);
-    if (gCachedLast.length > kCachedLastMaxSize)
+    if (gCachedLast.length > kCachedLastMaxSize) {
       gCachedLast.shift();
+    }
 
     // Apply smoothing only if the new time isn't a huge change -- e.g., if the
     // new time is more than half the previous time; this is useful for
     // downloads that start/resume slowly
     if (aSeconds > aLastSec / 2) {
       // Apply hysteresis to favor downward over upward swings
       // 30% of down and 10% of up (exponential smoothing)
       let diff = aSeconds - aLastSec;
-      aSeconds = aLastSec + (diff < 0 ? .3 : .1) * diff;
+      aSeconds = aLastSec + (diff < 0 ? 0.3 : 0.1) * diff;
 
       // If the new time is similar, reuse something close to the last seconds,
       // but subtract a little to provide forward progress
-      let diffPct = diff / aLastSec * 100;
-      if (Math.abs(diff) < 5 || Math.abs(diffPct) < 5)
-        aSeconds = aLastSec - (diff < 0 ? .4 : .2);
+      let diffPct = (diff / aLastSec) * 100;
+      if (Math.abs(diff) < 5 || Math.abs(diffPct) < 5) {
+        aSeconds = aLastSec - (diff < 0 ? 0.4 : 0.2);
+      }
     }
 
     // Decide what text to show for the time
     let timeLeft;
     if (aSeconds < 4) {
       // Be friendly in the last few seconds
       timeLeft = gBundle.GetStringFromName(gStr.timeFewSeconds);
     } else {
       // Convert the seconds into its two largest units to display
-      let [time1, unit1, time2, unit2] =
-        DownloadUtils.convertTimeUnits(aSeconds);
+      let [time1, unit1, time2, unit2] = DownloadUtils.convertTimeUnits(
+        aSeconds
+      );
 
-      let pair1 =
-        gBundle.formatStringFromName(gStr.timePair, [nf.format(time1), unit1]);
-      let pair2 =
-        gBundle.formatStringFromName(gStr.timePair, [nf.format(time2), unit2]);
+      let pair1 = gBundle.formatStringFromName(gStr.timePair, [
+        nf.format(time1),
+        unit1,
+      ]);
+      let pair2 = gBundle.formatStringFromName(gStr.timePair, [
+        nf.format(time2),
+        unit2,
+      ]);
 
       // Only show minutes for under 1 hour unless there's a few minutes left;
       // or the second pair is 0.
       if ((aSeconds < 3600 && time1 >= 4) || time2 == 0) {
-        timeLeft = gBundle.formatStringFromName(gStr.timeLeftSingle,
-                                                [pair1]);
+        timeLeft = gBundle.formatStringFromName(gStr.timeLeftSingle, [pair1]);
       } else {
         // We've got 2 pairs of times to display
-        timeLeft = gBundle.formatStringFromName(gStr.timeLeftDouble,
-                                                [pair1, pair2]);
+        timeLeft = gBundle.formatStringFromName(gStr.timeLeftDouble, [
+          pair1,
+          pair2,
+        ]);
       }
     }
 
     return [timeLeft, aSeconds];
   },
 
   /**
    * Converts a Date object to two readable formats, one compact, one complete.
@@ -337,60 +372,66 @@ var DownloadUtils = {
     let dateTimeFull;
 
     // Figure out if the time is from today, yesterday, this week, etc.
     if (aDate >= today) {
       let dts = new Services.intl.DateTimeFormat(undefined, {
         timeStyle: "short",
       });
       dateTimeCompact = dts.format(aDate);
-    } else if (today - aDate < (MS_PER_DAY)) {
+    } else if (today - aDate < MS_PER_DAY) {
       // After yesterday started, show yesterday
       dateTimeCompact = gBundle.GetStringFromName(gStr.yesterday);
-    } else if (today - aDate < (6 * MS_PER_DAY)) {
+    } else if (today - aDate < 6 * MS_PER_DAY) {
       // After last week started, show day of week
-      dateTimeCompact = aDate.toLocaleDateString(undefined, { weekday: "long" });
+      dateTimeCompact = aDate.toLocaleDateString(undefined, {
+        weekday: "long",
+      });
     } else {
       // Show month/day
       dateTimeCompact = aDate.toLocaleString(undefined, {
-                          month: "long",
-                          day: "numeric",
+        month: "long",
+        day: "numeric",
       });
     }
 
     const dtOptions = { dateStyle: "long", timeStyle: "short" };
-    dateTimeFull =
-      new Services.intl.DateTimeFormat(undefined, dtOptions).format(aDate);
+    dateTimeFull = new Services.intl.DateTimeFormat(
+      undefined,
+      dtOptions
+    ).format(aDate);
 
     return [dateTimeCompact, dateTimeFull];
   },
 
   /**
    * Get the appropriate display host string for a URI string depending on if
    * the URI has an eTLD + 1, is an IP address, a local file, or other protocol
    *
    * @param aURIString
    *        The URI string to try getting an eTLD + 1, etc.
    * @return A pair: [display host for the URI string, full host name]
    */
   getURIHost: function DU_getURIHost(aURIString) {
-    let idnService = Cc["@mozilla.org/network/idn-service;1"].
-                     getService(Ci.nsIIDNService);
+    let idnService = Cc["@mozilla.org/network/idn-service;1"].getService(
+      Ci.nsIIDNService
+    );
 
     // Get a URI that knows about its components
     let uri;
     try {
       uri = Services.io.newURI(aURIString);
     } catch (ex) {
       return ["", ""];
     }
 
     // Get the inner-most uri for schemes like jar:
-    if (uri instanceof Ci.nsINestedURI)
+    if (uri instanceof Ci.nsINestedURI) {
       uri = uri.innermostURI;
+    }
 
     let fullHost;
     try {
       // Get the full host name; some special URIs fail (data: jar:)
       fullHost = uri.host;
     } catch (e) {
       fullHost = "";
     }
@@ -409,18 +450,17 @@ var DownloadUtils = {
 
     // Check if we need to show something else for the host
     if (uri.scheme == "file") {
       // Display special text for file protocol
       displayHost = gBundle.GetStringFromName(gStr.doneFileScheme);
       fullHost = displayHost;
     } else if (displayHost.length == 0) {
       // Got nothing; show the scheme (data: about: moz-icon:)
-      displayHost =
-        gBundle.formatStringFromName(gStr.doneScheme, [uri.scheme]);
+      displayHost = gBundle.formatStringFromName(gStr.doneScheme, [uri.scheme]);
       fullHost = displayHost;
     } else if (uri.port != -1) {
       // Tack on the port if it's not the default port
       let port = ":" + uri.port;
       displayHost += port;
       fullHost += port;
     }
 
@@ -435,25 +475,25 @@ var DownloadUtils = {
    *        Number of bytes to convert
    * @return A pair: [new value with 3 sig. figs., its unit]
    */
   convertByteUnits: function DU_convertByteUnits(aBytes) {
     let unitIndex = 0;
 
     // Convert to next unit if it needs 4 digits (after rounding), but only if
     // we know the name of the next unit
-    while ((aBytes >= 999.5) && (unitIndex < gStr.units.length - 1)) {
+    while (aBytes >= 999.5 && unitIndex < gStr.units.length - 1) {
       aBytes /= 1024;
       unitIndex++;
     }
 
     // Get rid of insignificant bits by truncating to 1 or 0 decimal points
     // 0 -> 0; 1.2 -> 1.2; 12.3 -> 12.3; 123.4 -> 123; 234.5 -> 235
     // added in bug 462064: (unitIndex != 0) makes sure that no decimal digit for bytes appears when aBytes < 100
-    let fractionDigits = (aBytes > 0) && (aBytes < 100) && (unitIndex != 0) ? 1 : 0;
+    let fractionDigits = aBytes > 0 && aBytes < 100 && unitIndex != 0 ? 1 : 0;
 
     // Don't try to format Infinity values using NumberFormat.
     if (aBytes === Infinity) {
       aBytes = "Infinity";
     } else {
       aBytes = getLocaleNumberFormat(fractionDigits).format(aBytes);
     }
 
@@ -474,31 +514,32 @@ var DownloadUtils = {
     let timeSize = [60, 60, 24];
 
     let time = aSecs;
     let scale = 1;
     let unitIndex = 0;
 
     // Keep converting to the next unit while we have units left and the
     // current one isn't the largest unit possible
-    while ((unitIndex < timeSize.length) && (time >= timeSize[unitIndex])) {
+    while (unitIndex < timeSize.length && time >= timeSize[unitIndex]) {
       time /= timeSize[unitIndex];
       scale *= timeSize[unitIndex];
       unitIndex++;
     }
 
     let value = convertTimeUnitsValue(time);
     let units = convertTimeUnitsUnits(value, unitIndex);
 
     let extra = aSecs - value * scale;
     let nextIndex = unitIndex - 1;
 
     // Convert the extra time to the next largest unit
-    for (let index = 0; index < nextIndex; index++)
+    for (let index = 0; index < nextIndex; index++) {
       extra /= timeSize[index];
+    }
 
     let value2 = convertTimeUnitsValue(extra);
     let units2 = convertTimeUnitsUnits(value2, nextIndex);
 
     return [value, units, value2, units2];
   },
 };
 
@@ -519,20 +560,24 @@ function convertTimeUnitsValue(aTime) {
  * @param aTime
  *        Time value for display
  * @param aIndex
  *        Index into gStr.timeUnits for the appropriate unit
  * @return The appropriate plural form of the unit for the time
  */
 function convertTimeUnitsUnits(aTime, aIndex) {
   // Negative index would be an invalid unit, so just give empty
-  if (aIndex < 0)
+  if (aIndex < 0) {
     return "";
+  }
 
-  return PluralForm.get(aTime, gBundle.GetStringFromName(gStr.timeUnits[aIndex]));
+  return PluralForm.get(
+    aTime,
+    gBundle.GetStringFromName(gStr.timeUnits[aIndex])
+  );
 }
 
 /**
  * Private helper function to log errors to the error console and command line
  *
  * @param aMsg
  *        Error message to log or an array of strings to concat
  */
--- a/toolkit/mozapps/downloads/HelperAppDlg.jsm
+++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm
@@ -1,84 +1,86 @@
 /* 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/. */
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
-ChromeUtils.defineModuleGetter(this, "EnableDelayHelper",
-                               "resource://gre/modules/SharedPromptUtils.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { AppConstants } = ChromeUtils.import(
+  "resource://gre/modules/AppConstants.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "EnableDelayHelper",
+  "resource://gre/modules/SharedPromptUtils.jsm"
+);
 
 // /////////////////////////////////////////////////////////////////////////////
 // // Helper Functions
 
 /**
  * Determines if a given directory is able to be used to download to.
  *
  * @param aDirectory
  *        The directory to check.
  * @return true if we can use the directory, false otherwise.
  */
 function isUsableDirectory(aDirectory) {
-  return aDirectory.exists() && aDirectory.isDirectory() &&
-         aDirectory.isWritable();
+  return (
+    aDirectory.exists() && aDirectory.isDirectory() && aDirectory.isWritable()
+  );
 }
 
 // Web progress listener so we can detect errors while mLauncher is
 // streaming the data to a temporary file.
 function nsUnknownContentTypeDialogProgressListener(aHelperAppDialog) {
   this.helperAppDlg = aHelperAppDialog;
 }
 
 nsUnknownContentTypeDialogProgressListener.prototype = {
   // nsIWebProgressListener methods.
   // Look for error notifications and display alert to user.
-  onStatusChange( aWebProgress, aRequest, aStatus, aMessage ) {
-    if ( aStatus != Cr.NS_OK ) {
+  onStatusChange(aWebProgress, aRequest, aStatus, aMessage) {
+    if (aStatus != Cr.NS_OK) {
       // Display error alert (using text supplied by back-end).
       // FIXME this.dialog is undefined?
-      Services.prompt.alert( this.dialog, this.helperAppDlg.mTitle, aMessage );
+      Services.prompt.alert(this.dialog, this.helperAppDlg.mTitle, aMessage);
       // Close the dialog.
       this.helperAppDlg.onCancel();
-      if ( this.helperAppDlg.mDialog ) {
+      if (this.helperAppDlg.mDialog) {
         this.helperAppDlg.mDialog.close();
       }
     }
   },
 
   // Ignore onProgressChange, onProgressChange64, onStateChange, onLocationChange, onSecurityChange, onContentBlockingEvent and onRefreshAttempted notifications.
-  onProgressChange(aWebProgress,
-                   aRequest,
-                   aCurSelfProgress,
-                   aMaxSelfProgress,
-                   aCurTotalProgress,
-                   aMaxTotalProgress) {
-  },
+  onProgressChange(
+    aWebProgress,
+    aRequest,
+    aCurSelfProgress,
+    aMaxSelfProgress,
+    aCurTotalProgress,
+    aMaxTotalProgress
+  ) {},
 
-  onProgressChange64(aWebProgress,
-                     aRequest,
-                     aCurSelfProgress,
-                     aMaxSelfProgress,
-                     aCurTotalProgress,
-                     aMaxTotalProgress) {
-  },
-
-
+  onProgressChange64(
+    aWebProgress,
+    aRequest,
+    aCurSelfProgress,
+    aMaxSelfProgress,
+    aCurTotalProgress,
+    aMaxTotalProgress
+  ) {},
 
-  onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {
-  },
+  onStateChange(aWebProgress, aRequest, aStateFlags, aStatus) {},
 
-  onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {
-  },
+  onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {},
 
-  onSecurityChange(aWebProgress, aRequest, aState) {
-  },
+  onSecurityChange(aWebProgress, aRequest, aState) {},
 
-  onContentBlockingEvent(aWebProgress, aRequest, aEvent) {
-  },
+  onContentBlockingEvent(aWebProgress, aRequest, aEvent) {},
 
   onRefreshAttempted(aWebProgress, aURI, aDelay, aSameURI) {
     return true;
   },
 };
 
 // /////////////////////////////////////////////////////////////////////////////
 // // nsUnknownContentTypeDialog
@@ -92,81 +94,99 @@ nsUnknownContentTypeDialogProgressListen
  *
  * In addition, this file implements an nsIModule object that registers the
  * nsUnknownContentTypeDialog component.
  */
 
 const PREF_BD_USEDOWNLOADDIR = "browser.download.useDownloadDir";
 const nsITimer = Ci.nsITimer;
 
-var downloadModule = ChromeUtils.import("resource://gre/modules/DownloadLastDir.jsm");
-const {DownloadPaths} = ChromeUtils.import("resource://gre/modules/DownloadPaths.jsm");
-const {DownloadUtils} = ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm");
-const {Downloads} = ChromeUtils.import("resource://gre/modules/Downloads.jsm");
-const {FileUtils} = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
+var downloadModule = ChromeUtils.import(
+  "resource://gre/modules/DownloadLastDir.jsm"
+);
+const { DownloadPaths } = ChromeUtils.import(
+  "resource://gre/modules/DownloadPaths.jsm"
+);
+const { DownloadUtils } = ChromeUtils.import(
+  "resource://gre/modules/DownloadUtils.jsm"
+);
+const { Downloads } = ChromeUtils.import(
+  "resource://gre/modules/Downloads.jsm"
+);
+const { FileUtils } = ChromeUtils.import(
+  "resource://gre/modules/FileUtils.jsm"
+);
 
 /* ctor
  */
 function nsUnknownContentTypeDialog() {
   // Initialize data properties.
   this.mLauncher = null;
-  this.mContext  = null;
-  this.mReason   = null;
+  this.mContext = null;
+  this.mReason = null;
   this.chosenApp = null;
   this.givenDefaultApp = false;
   this.updateSelf = true;
-  this.mTitle    = "";
+  this.mTitle = "";
 }
 
 nsUnknownContentTypeDialog.prototype = {
   classID: Components.ID("{F68578EB-6EC2-4169-AE19-8C6243F0ABE1}"),
 
   nsIMIMEInfo: Ci.nsIMIMEInfo,
 
-  QueryInterface: ChromeUtils.generateQI(["nsIHelperAppLauncherDialog",
-                                          "nsITimerCallback"]),
+  QueryInterface: ChromeUtils.generateQI([
+    "nsIHelperAppLauncherDialog",
+    "nsITimerCallback",
+  ]),
 
   // ---------- nsIHelperAppLauncherDialog methods ----------
 
   // show: Open XUL dialog using window watcher.  Since the dialog is not
   //       modal, it needs to be a top level window and the way to open
   //       one of those is via that route).
   show(aLauncher, aContext, aReason) {
     this.mLauncher = aLauncher;
-    this.mContext  = aContext;
-    this.mReason   = aReason;
+    this.mContext = aContext;
+    this.mReason = aReason;
 
     // Cache some information in case this context goes away:
     try {
-      let parent = aContext.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
+      let parent = aContext
+        .QueryInterface(Ci.nsIInterfaceRequestor)
+        .getInterface(Ci.nsIDOMWindow);
       this._mDownloadDir = new downloadModule.DownloadLastDir(parent);
     } catch (ex) {
-      Cu.reportError("Missing window information when showing nsIHelperAppLauncherDialog: " + ex);
+      Cu.reportError(
+        "Missing window information when showing nsIHelperAppLauncherDialog: " +
+          ex
+      );
     }
 
     const nsITimer = Ci.nsITimer;
-    this._showTimer = Cc["@mozilla.org/timer;1"]
-                        .createInstance(nsITimer);
+    this._showTimer = Cc["@mozilla.org/timer;1"].createInstance(nsITimer);
     this._showTimer.initWithCallback(this, 0, nsITimer.TYPE_ONE_SHOT);
   },
 
   // When opening from new tab, if tab closes while dialog is opening,
   // (which is a race condition on the XUL file being cached and the timer
   // in nsExternalHelperAppService), the dialog gets a blur and doesn't
   // activate the OK button.  So we wait a bit before doing opening it.
   reallyShow() {
     try {
       let ir = this.mContext.QueryInterface(Ci.nsIInterfaceRequestor);
       let docShell = ir.getInterface(Ci.nsIDocShell);
       let rootWin = docShell.rootTreeItem.domWindow;
-      this.mDialog = Services.ww.openWindow(rootWin,
-                                            "chrome://mozapps/content/downloads/unknownContentType.xul",
-                                            null,
-                                            "chrome,centerscreen,titlebar,dialog=yes,dependent",
-                                            null);
+      this.mDialog = Services.ww.openWindow(
+        rootWin,
+        "chrome://mozapps/content/downloads/unknownContentType.xul",
+        null,
+        "chrome,centerscreen,titlebar,dialog=yes,dependent",
+        null
+      );
     } catch (ex) {
       // The containing window may have gone away.  Break reference
       // cycles and stop doing the download.
       this.mLauncher.cancel(Cr.NS_BINDING_ABORTED);
       return;
     }
 
     // Hook this object to the dialog.
@@ -181,38 +201,48 @@ nsUnknownContentTypeDialog.prototype = {
   },
 
   //
   // displayBadPermissionAlert()
   //
   // Diplay an alert panel about the bad permission of folder/directory.
   //
   displayBadPermissionAlert() {
-    let bundle =
-      Services.strings.createBundle("chrome://mozapps/locale/downloads/unknownContentType.properties");
+    let bundle = Services.strings.createBundle(
+      "chrome://mozapps/locale/downloads/unknownContentType.properties"
+    );
 
-    Services.prompt.alert(this.dialog,
-                   bundle.GetStringFromName("badPermissions.title"),
-                   bundle.GetStringFromName("badPermissions"));
+    Services.prompt.alert(
+      this.dialog,
+      bundle.GetStringFromName("badPermissions.title"),
+      bundle.GetStringFromName("badPermissions")
+    );
   },
 
-  promptForSaveToFileAsync(aLauncher, aContext, aDefaultFileName,
-                                     aSuggestedFileExtension, aForcePrompt) {
+  promptForSaveToFileAsync(
+    aLauncher,
+    aContext,
+    aDefaultFileName,
+    aSuggestedFileExtension,
+    aForcePrompt
+  ) {
     var result = null;
 
     this.mLauncher = aLauncher;
 
-    let bundle =
-      Services.strings
-              .createBundle("chrome://mozapps/locale/downloads/unknownContentType.properties");
+    let bundle = Services.strings.createBundle(
+      "chrome://mozapps/locale/downloads/unknownContentType.properties"
+    );
 
     let parent;
     let gDownloadLastDir;
     try {
-      parent = aContext.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
+      parent = aContext
+        .QueryInterface(Ci.nsIInterfaceRequestor)
+        .getInterface(Ci.nsIDOMWindow);
     } catch (ex) {}
 
     if (parent) {
       gDownloadLastDir = new downloadModule.DownloadLastDir(parent);
     } else {
       // Use the cached download info, but pick an arbitrary parent window
       // because the original one is definitely gone (and nsIFilePicker doesn't like
       // a null parent):
@@ -222,87 +252,105 @@ nsUnknownContentTypeDialog.prototype = {
         // that's going to go away when the user clicks "Save", and that breaks the
         // windows file picker that's supposed to show up if we let the user choose
         // where to save files...
         if (someWin != this.mDialog) {
           parent = someWin;
         }
       }
       if (!parent) {
-        Cu.reportError("No candidate parent windows were found for the save filepicker." +
-                       "This should never happen.");
+        Cu.reportError(
+          "No candidate parent windows were found for the save filepicker." +
+            "This should never happen."
+        );
       }
     }
 
     (async () => {
       if (!aForcePrompt) {
         // Check to see if the user wishes to auto save to the default download
         // folder without prompting. Note that preference might not be set.
-        let autodownload = Services.prefs.getBoolPref(PREF_BD_USEDOWNLOADDIR, false);
+        let autodownload = Services.prefs.getBoolPref(
+          PREF_BD_USEDOWNLOADDIR,
+          false
+        );
 
         if (autodownload) {
           // Retrieve the user's default download directory
           let preferredDir = await Downloads.getPreferredDownloadsDirectory();
           let defaultFolder = new FileUtils.File(preferredDir);
 
           try {
-            result = this.validateLeafName(defaultFolder, aDefaultFileName,
-                                           aSuggestedFileExtension);
+            result = this.validateLeafName(
+              defaultFolder,
+              aDefaultFileName,
+              aSuggestedFileExtension
+            );
           } catch (ex) {
             // When the default download directory is write-protected,
             // prompt the user for a different target file.
           }
 
           // Check to make sure we have a valid directory, otherwise, prompt
           if (result) {
             // Notifications for CloudStorage API consumers to show offer
             // prompts while downloading. See Bug 1365129
-            Services.obs.notifyObservers(null, "cloudstorage-prompt-notification", result.path);
+            Services.obs.notifyObservers(
+              null,
+              "cloudstorage-prompt-notification",
+              result.path
+            );
             // This path is taken when we have a writable default download directory.
             aLauncher.saveDestinationAvailable(result);
             return;
           }
         }
       }
 
       // Use file picker to show dialog.
       var nsIFilePicker = Ci.nsIFilePicker;
-      var picker = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
+      var picker = Cc["@mozilla.org/filepicker;1"].createInstance(
+        nsIFilePicker
+      );
       var windowTitle = bundle.GetStringFromName("saveDialogTitle");
       picker.init(parent, windowTitle, nsIFilePicker.modeSave);
       if (aDefaultFileName) {
         picker.defaultString = this.getFinalLeafName(aDefaultFileName);
       }
 
       if (aSuggestedFileExtension) {
         // aSuggestedFileExtension includes the period, so strip it
         picker.defaultExtension = aSuggestedFileExtension.substring(1);
       } else {
         try {
           picker.defaultExtension = this.mLauncher.MIMEInfo.primaryExtension;
-        } catch (ex) { }
+        } catch (ex) {}
       }
 
       var wildCardExtension = "*";
       if (aSuggestedFileExtension) {
         wildCardExtension += aSuggestedFileExtension;
-        picker.appendFilter(this.mLauncher.MIMEInfo.description, wildCardExtension);
+        picker.appendFilter(
+          this.mLauncher.MIMEInfo.description,
+          wildCardExtension
+        );
       }
 
-      picker.appendFilters( nsIFilePicker.filterAll );
+      picker.appendFilters(nsIFilePicker.filterAll);
 
       // Default to lastDir if it is valid, otherwise use the user's default
       // downloads directory.  getPreferredDownloadsDirectory should always
       // return a valid directory path, so we can safely default to it.
       let preferredDir = await Downloads.getPreferredDownloadsDirectory();
       picker.displayDirectory = new FileUtils.File(preferredDir);
 
       gDownloadLastDir.getFileAsync(aLauncher.source, lastDir => {
-        if (lastDir && isUsableDirectory(lastDir))
+        if (lastDir && isUsableDirectory(lastDir)) {
           picker.displayDirectory = lastDir;
+        }
 
         picker.open(returnValue => {
           if (returnValue == nsIFilePicker.returnCancel) {
             // null result means user cancelled.
             aLauncher.saveDestinationAvailable(null);
             return;
           }
 
@@ -312,18 +360,22 @@ nsUnknownContentTypeDialog.prototype = {
           result = picker.file;
 
           if (result) {
             try {
               // Remove the file so that it's not there when we ensure non-existence later;
               // this is safe because for the file to exist, the user would have had to
               // confirm that he wanted the file overwritten.
               // Only remove file if final name exists
-              if (result.exists() && this.getFinalLeafName(result.leafName) == result.leafName)
+              if (
+                result.exists() &&
+                this.getFinalLeafName(result.leafName) == result.leafName
+              ) {
                 result.remove(false);
+              }
             } catch (ex) {
               // As it turns out, the failure to remove the file, for example due to
               // permission error, will be handled below eventually somehow.
             }
 
             var newDir = result.parent.QueryInterface(Ci.nsIFile);
 
             // Do not store the last save directory as a pref inside the private browsing mode
@@ -345,18 +397,20 @@ nsUnknownContentTypeDialog.prototype = {
           }
           aLauncher.saveDestinationAvailable(result);
         });
       });
     })().catch(Cu.reportError);
   },
 
   getFinalLeafName(aLeafName, aFileExt) {
-    return DownloadPaths.sanitize(aLeafName) ||
-           "unnamed" + (aFileExt ? "." + aFileExt : "");
+    return (
+      DownloadPaths.sanitize(aLeafName) ||
+      "unnamed" + (aFileExt ? "." + aFileExt : "")
+    );
   },
 
   /**
    * Ensures that a local folder/file combination does not already exist in
    * the file system (or finds such a combination with a reasonably similar
    * leaf name), creates the corresponding file, and returns it.
    *
    * @param   aLocalFolder
@@ -369,33 +423,35 @@ nsUnknownContentTypeDialog.prototype = {
    *          if aLeafName is non-empty
    * @return  nsIFile
    *          the created file
    * @throw   an error such as permission doesn't allow creation of
    *          file, etc.
    */
   validateLeafName(aLocalFolder, aLeafName, aFileExt) {
     if (!(aLocalFolder && isUsableDirectory(aLocalFolder))) {
-      throw new Components.Exception("Destination directory non-existing or permission error",
-                                     Cr.NS_ERROR_FILE_ACCESS_DENIED);
+      throw new Components.Exception(
+        "Destination directory non-existing or permission error",
+        Cr.NS_ERROR_FILE_ACCESS_DENIED
+      );
     }
 
     aLeafName = this.getFinalLeafName(aLeafName, aFileExt);
     aLocalFolder.append(aLeafName);
 
     // The following assignment can throw an exception, but
     // is now caught properly in the caller of validateLeafName.
     var createdFile = DownloadPaths.createNiceUniqueFile(aLocalFolder);
 
     if (AppConstants.platform == "win") {
       let ext;
       try {
         // We can fail here if there's no primary extension set
         ext = "." + this.mLauncher.MIMEInfo.primaryExtension;
-      } catch (e) { }
+      } catch (e) {}
 
       // Append a file extension if it's an executable that doesn't have one
       // but make sure we actually have an extension to add
       let leaf = createdFile.leafName;
       if (ext && leaf.slice(-ext.length) != ext && createdFile.isExecutable()) {
         createdFile.remove(false);
         aLocalFolder.leafName = leaf + ext;
         createdFile = DownloadPaths.createNiceUniqueFile(aLocalFolder);
@@ -412,66 +468,81 @@ nsUnknownContentTypeDialog.prototype = {
     // Put file name in window title.
     var suggestedFileName = this.mLauncher.suggestedFileName;
 
     this.mDialog.document.addEventListener("dialogaccept", this);
     this.mDialog.document.addEventListener("dialogcancel", this);
 
     // Some URIs do not implement nsIURL, so we can't just QI.
     var url = this.mLauncher.source;
-    if (url instanceof Ci.nsINestedURI)
+    if (url instanceof Ci.nsINestedURI) {
       url = url.innermostURI;
+    }
 
     var fname = "";
     var iconPath = "goat";
     this.mSourcePath = url.prePath;
     if (url instanceof Ci.nsIURL) {
       // A url, use file name from it.
       fname = iconPath = url.fileName;
       this.mSourcePath += url.directory;
     } else {
       // A generic uri, use path.
       fname = url.pathQueryRef;
       this.mSourcePath += url.pathQueryRef;
     }
 
-    if (suggestedFileName)
+    if (suggestedFileName) {
       fname = iconPath = suggestedFileName;
+    }
 
     var displayName = fname.replace(/ +/g, " ");
 
-    this.mTitle = this.dialogElement("strings").getFormattedString("title", [displayName]);
+    this.mTitle = this.dialogElement("strings").getFormattedString("title", [
+      displayName,
+    ]);
     this.mDialog.document.title = this.mTitle;
 
     // Put content type, filename and location into intro.
     this.initIntro(url, fname, displayName);
 
-    var iconString = "moz-icon://" + iconPath + "?size=16&contentType=" + this.mLauncher.MIMEInfo.MIMEType;
+    var iconString =
+      "moz-icon://" +
+      iconPath +
+      "?size=16&contentType=" +
+      this.mLauncher.MIMEInfo.MIMEType;
     this.dialogElement("contentTypeImage").setAttribute("src", iconString);
 
     // if always-save and is-executable and no-handler
     // then set up simple ui
     var mimeType = this.mLauncher.MIMEInfo.MIMEType;
-    var shouldntRememberChoice = (mimeType == "application/octet-stream" ||
-                                  mimeType == "application/x-msdownload" ||
-                                  this.mLauncher.targetFileIsExecutable);
-    if ((shouldntRememberChoice && !this.openWithDefaultOK()) ||
-        Services.prefs.getBoolPref("browser.download.forbid_open_with")) {
+    var shouldntRememberChoice =
+      mimeType == "application/octet-stream" ||
+      mimeType == "application/x-msdownload" ||
+      this.mLauncher.targetFileIsExecutable;
+    if (
+      (shouldntRememberChoice && !this.openWithDefaultOK()) ||
+      Services.prefs.getBoolPref("browser.download.forbid_open_with")
+    ) {
       // hide featured choice
       this.dialogElement("normalBox").collapsed = true;
       // show basic choice
       this.dialogElement("basicBox").collapsed = false;
       // change button labels and icons; use "save" icon for the accept
       // button since it's the only action possible
-      let acceptButton = this.mDialog.document.documentElement
-                                              .getButton("accept");
-      acceptButton.label = this.dialogElement("strings")
-                               .getString("unknownAccept.label");
+      let acceptButton = this.mDialog.document.documentElement.getButton(
+        "accept"
+      );
+      acceptButton.label = this.dialogElement("strings").getString(
+        "unknownAccept.label"
+      );
       acceptButton.setAttribute("icon", "save");
-      this.mDialog.document.documentElement.getButton("cancel").label = this.dialogElement("strings").getString("unknownCancel.label");
+      this.mDialog.document.documentElement.getButton(
+        "cancel"
+      ).label = this.dialogElement("strings").getString("unknownCancel.label");
       // hide other handler
       this.dialogElement("openHandler").collapsed = true;
       // set save as the selected option
       this.dialogElement("mode").selectedItem = this.dialogElement("save");
     } else {
       this.initAppAndSaveToDiskValues();
 
       // Initialize "always ask me" box. This should always be disabled
@@ -498,36 +569,44 @@ nsUnknownContentTypeDialog.prototype = {
       // var type = mimeService.getTypeFromURI(this.mLauncher.source);
       // this.realMIMEInfo = mimeService.getFromTypeAndExtension(type, "");
 
       // if (type == "application/octet-stream") {
       if (shouldntRememberChoice) {
         rememberChoice.checked = false;
         rememberChoice.disabled = true;
       } else {
-        rememberChoice.checked = !this.mLauncher.MIMEInfo.alwaysAskBeforeHandling &&
-                                 this.mLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.handleInternally;
+        rememberChoice.checked =
+          !this.mLauncher.MIMEInfo.alwaysAskBeforeHandling &&
+          this.mLauncher.MIMEInfo.preferredAction !=
+            this.nsIMIMEInfo.handleInternally;
       }
       this.toggleRememberChoice(rememberChoice);
 
       // XXXben - menulist won't init properly, hack.
       var openHandler = this.dialogElement("openHandler");
       openHandler.remove();
       var openHandlerBox = this.dialogElement("openHandlerBox");
       openHandlerBox.appendChild(openHandler);
     }
 
-    this.mDialog.setTimeout(function() { this.dialog.postShowCallback(); }, 0);
+    this.mDialog.setTimeout(function() {
+      this.dialog.postShowCallback();
+    }, 0);
 
     this.delayHelper = new EnableDelayHelper({
       disableDialog: () => {
-        this.mDialog.document.documentElement.getButton("accept").disabled = true;
+        this.mDialog.document.documentElement.getButton(
+          "accept"
+        ).disabled = true;
       },
       enableDialog: () => {
-        this.mDialog.document.documentElement.getButton("accept").disabled = false;
+        this.mDialog.document.documentElement.getButton(
+          "accept"
+        ).disabled = false;
       },
       focusTarget: this.mDialog,
     });
   },
 
   notify(aTimer) {
     if (aTimer == this._showTimer) {
       if (!this.mDialog) {
@@ -547,73 +626,80 @@ nsUnknownContentTypeDialog.prototype = {
     this.mDialog.sizeToContent();
 
     // Set initial focus
     this.dialogElement("mode").focus();
   },
 
   // initIntro:
   initIntro(url, filename, displayname) {
-    this.dialogElement( "location" ).value = displayname;
-    this.dialogElement( "location" ).setAttribute("realname", filename);
-    this.dialogElement( "location" ).setAttribute("tooltiptext", displayname);
+    this.dialogElement("location").value = displayname;
+    this.dialogElement("location").setAttribute("realname", filename);
+    this.dialogElement("location").setAttribute("tooltiptext", displayname);
 
     // if mSourcePath is a local file, then let's use the pretty path name
     // instead of an ugly url...
     var pathString;
     if (url instanceof Ci.nsIFileURL) {
       try {
         // Getting .file might throw, or .parent could be null
         pathString = url.file.parent.path;
       } catch (ex) {}
     }
 
     if (!pathString) {
       // wasn't a fileURL
       var tmpurl = url; // don't want to change the real url
       try {
-        tmpurl = tmpurl.mutate()
-                       .setUserPass("")
-                       .finalize();
+        tmpurl = tmpurl
+          .mutate()
+          .setUserPass("")
+          .finalize();
       } catch (ex) {}
       pathString = tmpurl.prePath;
     }
 
     // Set the location text, which is separate from the intro text so it can be cropped
-    var location = this.dialogElement( "source" );
+    var location = this.dialogElement("source");
     location.value = pathString;
     location.setAttribute("tooltiptext", this.mSourcePath);
 
     // Show the type of file.
     var type = this.dialogElement("type");
     var mimeInfo = this.mLauncher.MIMEInfo;
 
     // 1. Try to use the pretty description of the type, if one is available.
     var typeString = mimeInfo.description;
 
     if (typeString == "") {
       // 2. If there is none, use the extension to identify the file, e.g. "ZIP file"
       var primaryExtension = "";
       try {
         primaryExtension = mimeInfo.primaryExtension;
-      } catch (ex) {
+      } catch (ex) {}
+      if (primaryExtension != "") {
+        typeString = this.dialogElement("strings").getFormattedString(
+          "fileType",
+          [primaryExtension.toUpperCase()]
+        );
       }
-      if (primaryExtension != "")
-        typeString = this.dialogElement("strings").getFormattedString("fileType", [primaryExtension.toUpperCase()]);
       // 3. If we can't even do that, just give up and show the MIME type.
-      else
+      else {
         typeString = mimeInfo.MIMEType;
+      }
     }
     // When the length is unknown, contentLength would be -1
     if (this.mLauncher.contentLength >= 0) {
-      let [size, unit] = DownloadUtils.
-                         convertByteUnits(this.mLauncher.contentLength);
-      type.value = this.dialogElement("strings")
-                       .getFormattedString("orderedFileSizeWithType",
-                                           [typeString, size, unit]);
+      let [size, unit] = DownloadUtils.convertByteUnits(
+        this.mLauncher.contentLength
+      );
+      type.value = this.dialogElement("strings").getFormattedString(
+        "orderedFileSizeWithType",
+        [typeString, size, unit]
+      );
     } else {
       type.value = typeString;
     }
   },
 
   // Returns true if opening the default application makes sense.
   openWithDefaultOK() {
     // The checking is different on Windows...
@@ -634,17 +720,20 @@ nsUnknownContentTypeDialog.prototype = {
     return this.mLauncher.MIMEInfo.hasDefaultHandler;
   },
 
   // Set "default" application description field.
   initDefaultApp() {
     // Use description, if we can get one.
     var desc = this.mLauncher.MIMEInfo.defaultDescription;
     if (desc) {
-      var defaultApp = this.dialogElement("strings").getFormattedString("defaultApp", [desc]);
+      var defaultApp = this.dialogElement("strings").getFormattedString(
+        "defaultApp",
+        [desc]
+      );
       this.dialogElement("defaultHandler").label = defaultApp;
     } else {
       this.dialogElement("modeDeck").setAttribute("selectedIndex", "1");
       // Hide the default handler item too, in case the user picks a
       // custom handler at a later date which triggers the menulist to show.
       this.dialogElement("defaultHandler").hidden = true;
     }
   },
@@ -661,61 +750,75 @@ nsUnknownContentTypeDialog.prototype = {
   initAppAndSaveToDiskValues() {
     var modeGroup = this.dialogElement("mode");
 
     // We don't let users open .exe files or random binary data directly
     // from the browser at the moment because of security concerns.
     var openWithDefaultOK = this.openWithDefaultOK();
     var mimeType = this.mLauncher.MIMEInfo.MIMEType;
     var openHandler = this.dialogElement("openHandler");
-    if (this.mLauncher.targetFileIsExecutable || (
-      (mimeType == "application/octet-stream" ||
-       mimeType == "application/x-msdownload") &&
-        !openWithDefaultOK)) {
+    if (
+      this.mLauncher.targetFileIsExecutable ||
+      ((mimeType == "application/octet-stream" ||
+        mimeType == "application/x-msdownload") &&
+        !openWithDefaultOK)
+    ) {
       this.dialogElement("open").disabled = true;
       openHandler.disabled = true;
       openHandler.selectedItem = null;
       modeGroup.selectedItem = this.dialogElement("save");
       return;
     }
 
     // Fill in helper app info, if there is any.
     try {
-      this.chosenApp =
-        this.mLauncher.MIMEInfo.preferredApplicationHandler
-                               .QueryInterface(Ci.nsILocalHandlerApp);
+      this.chosenApp = this.mLauncher.MIMEInfo.preferredApplicationHandler.QueryInterface(
+        Ci.nsILocalHandlerApp
+      );
     } catch (e) {
       this.chosenApp = null;
     }
     // Initialize "default application" field.
     this.initDefaultApp();
 
     var otherHandler = this.dialogElement("otherHandler");
 
     // Fill application name textbox.
-    if (this.chosenApp && this.chosenApp.executable &&
-        this.chosenApp.executable.path) {
-      otherHandler.setAttribute("path",
-                                this.getPath(this.chosenApp.executable));
+    if (
+      this.chosenApp &&
+      this.chosenApp.executable &&
+      this.chosenApp.executable.path
+    ) {
+      otherHandler.setAttribute(
+        "path",
+        this.getPath(this.chosenApp.executable)
+      );
 
       otherHandler.label = this.getFileDisplayName(this.chosenApp.executable);
       otherHandler.hidden = false;
     }
 
     openHandler.selectedIndex = 0;
     var defaultOpenHandler = this.dialogElement("defaultHandler");
 
-    if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useSystemDefault) {
+    if (
+      this.mLauncher.MIMEInfo.preferredAction ==
+      this.nsIMIMEInfo.useSystemDefault
+    ) {
       // Open (using system default).
       modeGroup.selectedItem = this.dialogElement("open");
-    } else if (this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useHelperApp) {
+    } else if (
+      this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.useHelperApp
+    ) {
       // Open with given helper app.
       modeGroup.selectedItem = this.dialogElement("open");
-      openHandler.selectedItem = (otherHandler && !otherHandler.hidden) ?
-                                 otherHandler : defaultOpenHandler;
+      openHandler.selectedItem =
+        otherHandler && !otherHandler.hidden
+          ? otherHandler
+          : defaultOpenHandler;
     } else {
       // Save to disk.
       modeGroup.selectedItem = this.dialogElement("save");
     }
 
     // If we don't have a "default app" then disable that choice.
     if (!openWithDefaultOK) {
       var isSelected = defaultOpenHandler.selected;
@@ -738,132 +841,174 @@ nsUnknownContentTypeDialog.prototype = {
     return this.chosenApp;
   },
 
   get saveToDisk() {
     return this.dialogElement("save").selected;
   },
 
   get useOtherHandler() {
-    return this.dialogElement("open").selected && this.dialogElement("openHandler").selectedIndex == 1;
+    return (
+      this.dialogElement("open").selected &&
+      this.dialogElement("openHandler").selectedIndex == 1
+    );
   },
 
   get useSystemDefault() {
-    return this.dialogElement("open").selected && this.dialogElement("openHandler").selectedIndex == 0;
+    return (
+      this.dialogElement("open").selected &&
+      this.dialogElement("openHandler").selectedIndex == 0
+    );
   },
 
   toggleRememberChoice(aCheckbox) {
     this.dialogElement("settingsChange").hidden = !aCheckbox.checked;
     this.mDialog.sizeToContent();
   },
 
   openHandlerCommand() {
     var openHandler = this.dialogElement("openHandler");
-    if (openHandler.selectedItem.id == "choose")
+    if (openHandler.selectedItem.id == "choose") {
       this.chooseApp();
-    else
-      openHandler.setAttribute("lastSelectedItemID", openHandler.selectedItem.id);
+    } else {
+      openHandler.setAttribute(
+        "lastSelectedItemID",
+        openHandler.selectedItem.id
+      );
+    }
   },
 
   updateOKButton() {
     var ok = false;
     if (this.dialogElement("save").selected) {
       // This is always OK.
       ok = true;
     } else if (this.dialogElement("open").selected) {
       switch (this.dialogElement("openHandler").selectedIndex) {
-      case 0:
-        // No app need be specified in this case.
-        ok = true;
-        break;
-      case 1:
-        // only enable the OK button if we have a default app to use or if
-        // the user chose an app....
-        ok = this.chosenApp || /\S/.test(this.dialogElement("otherHandler").getAttribute("path"));
-        break;
+        case 0:
+          // No app need be specified in this case.
+          ok = true;
+          break;
+        case 1:
+          // only enable the OK button if we have a default app to use or if
+          // the user chose an app....
+          ok =
+            this.chosenApp ||
+            /\S/.test(this.dialogElement("otherHandler").getAttribute("path"));
+          break;
       }
     }
 
     // Enable Ok button if ok to press.
     this.mDialog.document.documentElement.getButton("accept").disabled = !ok;
   },
 
   // Returns true iff the user-specified helper app has been modified.
   appChanged() {
-    return this.helperAppChoice() != this.mLauncher.MIMEInfo.preferredApplicationHandler;
+    return (
+      this.helperAppChoice() !=
+      this.mLauncher.MIMEInfo.preferredApplicationHandler
+    );
   },
 
   updateMIMEInfo() {
     // Don't update mime type preferences when the preferred action is set to
     // the internal handler -- this dialog is the result of the handler fallback
     // (e.g. Content-Disposition was set as attachment)
-    var discardUpdate = this.mLauncher.MIMEInfo.preferredAction == this.nsIMIMEInfo.handleInternally &&
-                        !this.dialogElement("rememberChoice").checked;
+    var discardUpdate =
+      this.mLauncher.MIMEInfo.preferredAction ==
+        this.nsIMIMEInfo.handleInternally &&
+      !this.dialogElement("rememberChoice").checked;
 
     var needUpdate = false;
     // If current selection differs from what's in the mime info object,
     // then we need to update.
     if (this.saveToDisk) {
-      needUpdate = this.mLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.saveToDisk;
-      if (needUpdate)
+      needUpdate =
+        this.mLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.saveToDisk;
+      if (needUpdate) {
         this.mLauncher.MIMEInfo.preferredAction = this.nsIMIMEInfo.saveToDisk;
+      }
     } else if (this.useSystemDefault) {
-      needUpdate = this.mLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.useSystemDefault;
-      if (needUpdate)
+      needUpdate =
+        this.mLauncher.MIMEInfo.preferredAction !=
+        this.nsIMIMEInfo.useSystemDefault;
+      if (needUpdate) {
         this.mLauncher.MIMEInfo.preferredAction = this.nsIMIMEInfo.useSystemDefault;
+      }
     } else {
       // For "open with", we need to check both preferred action and whether the user chose
       // a new app.
-      needUpdate = this.mLauncher.MIMEInfo.preferredAction != this.nsIMIMEInfo.useHelperApp || this.appChanged();
+      needUpdate =
+        this.mLauncher.MIMEInfo.preferredAction !=
+          this.nsIMIMEInfo.useHelperApp || this.appChanged();
       if (needUpdate) {
         this.mLauncher.MIMEInfo.preferredAction = this.nsIMIMEInfo.useHelperApp;
         // App may have changed - Update application
         var app = this.helperAppChoice();
         this.mLauncher.MIMEInfo.preferredApplicationHandler = app;
       }
     }
     // We will also need to update if the "always ask" flag has changed.
-    needUpdate = needUpdate || this.mLauncher.MIMEInfo.alwaysAskBeforeHandling != (!this.dialogElement("rememberChoice").checked);
+    needUpdate =
+      needUpdate ||
+      this.mLauncher.MIMEInfo.alwaysAskBeforeHandling !=
+        !this.dialogElement("rememberChoice").checked;
 
     // One last special case: If the input "always ask" flag was false, then we always
     // update.  In that case we are displaying the helper app dialog for the first
     // time for this mime type and we need to store the user's action in the handler service
     // (whether that action has changed or not; if it didn't change, then we need
     // to store the "always ask" flag so the helper app dialog will or won't display
     // next time, per the user's selection).
     needUpdate = needUpdate || !this.mLauncher.MIMEInfo.alwaysAskBeforeHandling;
 
     // Make sure mime info has updated setting for the "always ask" flag.
-    this.mLauncher.MIMEInfo.alwaysAskBeforeHandling = !this.dialogElement("rememberChoice").checked;
+    this.mLauncher.MIMEInfo.alwaysAskBeforeHandling = !this.dialogElement(
+      "rememberChoice"
+    ).checked;
 
     return needUpdate && !discardUpdate;
   },
 
   // See if the user changed things, and if so, store this mime type in the
   // handler service.
   updateHelperAppPref() {
     var handlerInfo = this.mLauncher.MIMEInfo;
-    var hs = Cc["@mozilla.org/uriloader/handler-service;1"].getService(Ci.nsIHandlerService);
+    var hs = Cc["@mozilla.org/uriloader/handler-service;1"].getService(
+      Ci.nsIHandlerService
+    );
     hs.store(handlerInfo);
   },
 
   // onOK:
   onOK(aEvent) {
     // Verify typed app path, if necessary.
     if (this.useOtherHandler) {
       var helperApp = this.helperAppChoice();
-      if (!helperApp || !helperApp.executable ||
-          !helperApp.executable.exists()) {
+      if (
+        !helperApp ||
+        !helperApp.executable ||
+        !helperApp.executable.exists()
+      ) {
         // Show alert and try again.
         var bundle = this.dialogElement("strings");
-        var msg = bundle.getFormattedString("badApp", [this.dialogElement("otherHandler").getAttribute("path")]);
-        Services.prompt.alert(this.mDialog, bundle.getString("badApp.title"), msg);
+        var msg = bundle.getFormattedString("badApp", [
+          this.dialogElement("otherHandler").getAttribute("path"),
+        ]);
+        Services.prompt.alert(
+          this.mDialog,
+          bundle.getString("badApp.title"),
+          msg
+        );
 
         // Disable the OK button.
-        this.mDialog.document.documentElement.getButton("accept").disabled = true;
+        this.mDialog.document.documentElement.getButton(
+          "accept"
+        ).disabled = true;
         this.dialogElement("mode").focus();
 
         // Clear chosen application.
         this.chosenApp = null;
 
         // Leave dialog up.
         aEvent.preventDefault();
       }
@@ -897,45 +1042,48 @@ nsUnknownContentTypeDialog.prototype = {
         }
         catch(e) { }
 
         this.mLauncher.saveToDisk(targetFile, false);
         */
 
         // see @notify
         // we cannot use opener's setTimeout, see bug 420405
-        this._saveToDiskTimer = Cc["@mozilla.org/timer;1"]
-                                  .createInstance(nsITimer);
-        this._saveToDiskTimer.initWithCallback(this, 0,
-                                               nsITimer.TYPE_ONE_SHOT);
+        this._saveToDiskTimer = Cc["@mozilla.org/timer;1"].createInstance(
+          nsITimer
+        );
+        this._saveToDiskTimer.initWithCallback(this, 0, nsITimer.TYPE_ONE_SHOT);
       } else {
         this.mLauncher.launchWithApplication(null, false);
       }
 
       // Update user pref for this mime type (if necessary). We do not
       // store anything in the mime type preferences for the ambiguous
       // type application/octet-stream. We do NOT do this for
       // application/x-msdownload since we want users to be able to
       // autodownload these to disk.
-      if (needUpdate && this.mLauncher.MIMEInfo.MIMEType != "application/octet-stream")
+      if (
+        needUpdate &&
+        this.mLauncher.MIMEInfo.MIMEType != "application/octet-stream"
+      ) {
         this.updateHelperAppPref();
-    } catch (e) { }
+      }
+    } catch (e) {}
     this.onUnload();
   },
 
   // onCancel:
   onCancel() {
     // Remove our web progress listener.
     this.mLauncher.setWebProgressListener(null);
 
     // Cancel app launcher.
     try {
       this.mLauncher.cancel(Cr.NS_BINDING_ABORTED);
-    } catch (exception) {
-    }
+    } catch (exception) {}
     this.onUnload();
   },
 
   onUnload() {
     this.mDialog.document.removeEventListener("dialogaccept", this);
     this.mDialog.document.removeEventListener("dialogcancel", this);
 
     // Unhook dialog from this object.
@@ -980,124 +1128,145 @@ nsUnknownContentTypeDialog.prototype = {
     if (this.chosenApp) {
       // Show the "handler" menulist since we have a (user-specified)
       // application now.
       this.dialogElement("modeDeck").setAttribute("selectedIndex", "0");
 
       // Update dialog.
       var otherHandler = this.dialogElement("otherHandler");
       otherHandler.removeAttribute("hidden");
-      otherHandler.setAttribute("path", this.getPath(this.chosenApp.executable));
-      if (AppConstants.platform == "win")
+      otherHandler.setAttribute(
+        "path",
+        this.getPath(this.chosenApp.executable)
+      );
+      if (AppConstants.platform == "win") {
         otherHandler.label = this.getFileDisplayName(this.chosenApp.executable);
-      else
+      } else {
         otherHandler.label = this.chosenApp.name;
+      }
       this.dialogElement("openHandler").selectedIndex = 1;
-      this.dialogElement("openHandler").setAttribute("lastSelectedItemID", "otherHandler");
+      this.dialogElement("openHandler").setAttribute(
+        "lastSelectedItemID",
+        "otherHandler"
+      );
 
       this.dialogElement("mode").selectedItem = this.dialogElement("open");
     } else {
       var openHandler = this.dialogElement("openHandler");
       var lastSelectedID = openHandler.getAttribute("lastSelectedItemID");
-      if (!lastSelectedID)
+      if (!lastSelectedID) {
         lastSelectedID = "defaultHandler";
+      }
       openHandler.selectedItem = this.dialogElement(lastSelectedID);
     }
   },
   // chooseApp:  Open file picker and prompt user for application.
   chooseApp() {
     if (AppConstants.platform == "win") {
       // Protect against the lack of an extension
       var fileExtension = "";
       try {
         fileExtension = this.mLauncher.MIMEInfo.primaryExtension;
-      } catch (ex) {
-      }
+      } catch (ex) {}
 
       // Try to use the pretty description of the type, if one is available.
       var typeString = this.mLauncher.MIMEInfo.description;
 
       if (!typeString) {
         // If there is none, use the extension to
         // identify the file, e.g. "ZIP file"
         if (fileExtension) {
-          typeString =
-            this.dialogElement("strings").
-            getFormattedString("fileType", [fileExtension.toUpperCase()]);
+          typeString = this.dialogElement("strings").getFormattedString(
+            "fileType",
+            [fileExtension.toUpperCase()]
+          );
         } else {
           // If we can't even do that, just give up and show the MIME type.
           typeString = this.mLauncher.MIMEInfo.MIMEType;
         }
       }
 
       var params = {};
-      params.title =
-        this.dialogElement("strings").getString("chooseAppFilePickerTitle");
+      params.title = this.dialogElement("strings").getString(
+        "chooseAppFilePickerTitle"
+      );
       params.description = typeString;
-      params.filename    = this.mLauncher.suggestedFileName;
-      params.mimeInfo    = this.mLauncher.MIMEInfo;
-      params.handlerApp  = null;
+      params.filename = this.mLauncher.suggestedFileName;
+      params.mimeInfo = this.mLauncher.MIMEInfo;
+      params.handlerApp = null;
 
-      this.mDialog.openDialog("chrome://global/content/appPicker.xul", null,
-                              "chrome,modal,centerscreen,titlebar,dialog=yes",
-                              params);
+      this.mDialog.openDialog(
+        "chrome://global/content/appPicker.xul",
+        null,
+        "chrome,modal,centerscreen,titlebar,dialog=yes",
+        params
+      );
 
-      if (params.handlerApp &&
-          params.handlerApp.executable &&
-          params.handlerApp.executable.isFile()) {
+      if (
+        params.handlerApp &&
+        params.handlerApp.executable &&
+        params.handlerApp.executable.isFile()
+      ) {
         // Remember the file they chose to run.
         this.chosenApp = params.handlerApp;
       }
     } else if ("@mozilla.org/applicationchooser;1" in Cc) {
       var nsIApplicationChooser = Ci.nsIApplicationChooser;
-      var appChooser = Cc["@mozilla.org/applicationchooser;1"]
-                         .createInstance(nsIApplicationChooser);
-      appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle"));
+      var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance(
+        nsIApplicationChooser
+      );
+      appChooser.init(
+        this.mDialog,
+        this.dialogElement("strings").getString("chooseAppFilePickerTitle")
+      );
       var contentTypeDialogObj = this;
       let appChooserCallback = function appChooserCallback_done(aResult) {
         if (aResult) {
-           contentTypeDialogObj.chosenApp = aResult.QueryInterface(Ci.nsILocalHandlerApp);
+          contentTypeDialogObj.chosenApp = aResult.QueryInterface(
+            Ci.nsILocalHandlerApp
+          );
         }
         contentTypeDialogObj.finishChooseApp();
       };
       appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
       // The finishChooseApp is called from appChooserCallback
       return;
     } else {
       var nsIFilePicker = Ci.nsIFilePicker;
-      var fp = Cc["@mozilla.org/filepicker;1"]
-                 .createInstance(nsIFilePicker);
-      fp.init(this.mDialog,
-              this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
-              nsIFilePicker.modeOpen);
+      var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
+      fp.init(
+        this.mDialog,
+        this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
+        nsIFilePicker.modeOpen
+      );
 
       fp.appendFilters(nsIFilePicker.filterApps);
 
       fp.open(aResult => {
         if (aResult == nsIFilePicker.returnOK && fp.file) {
           // Remember the file they chose to run.
-          var localHandlerApp =
-            Cc["@mozilla.org/uriloader/local-handler-app;1"].
-                       createInstance(Ci.nsILocalHandlerApp);
+          var localHandlerApp = Cc[
+            "@mozilla.org/uriloader/local-handler-app;1"
+          ].createInstance(Ci.nsILocalHandlerApp);
           localHandlerApp.executable = fp.file;
           this.chosenApp = localHandlerApp;
         }
         this.finishChooseApp();
       });
       // The finishChooseApp is called from fp.open() callback
       return;
     }
 
     this.finishChooseApp();
   },
 
   // Turn this on to get debugging messages.
   debug: false,
 
   // Dump text (if debug is on).
-  dump( text ) {
-    if ( this.debug ) {
-      dump( text );
+  dump(text) {
+    if (this.debug) {
+      dump(text);
     }
   },
 };
 
 var EXPORTED_SYMBOLS = ["nsUnknownContentTypeDialog"];
--- a/toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_delayedbutton.js
+++ b/toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_delayedbutton.js
@@ -1,34 +1,40 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm", this);
 
 const UCT_URI = "chrome://mozapps/content/downloads/unknownContentType.xul";
-const LOAD_URI = "http://mochi.test:8888/browser/toolkit/mozapps/downloads/tests/browser/unknownContentType_dialog_layout_data.txt";
+const LOAD_URI =
+  "http://mochi.test:8888/browser/toolkit/mozapps/downloads/tests/browser/unknownContentType_dialog_layout_data.txt";
 
-const DIALOG_DELAY = Services.prefs.getIntPref("security.dialog_enable_delay") + 200;
+const DIALOG_DELAY =
+  Services.prefs.getIntPref("security.dialog_enable_delay") + 200;
 
 let UCTObserver = {
   opened: PromiseUtils.defer(),
   closed: PromiseUtils.defer(),
 
   observe(aSubject, aTopic, aData) {
     let win = aSubject;
 
     switch (aTopic) {
       case "domwindowopened":
-        win.addEventListener("load", function onLoad(event) {
-          // Let the dialog initialize
-          SimpleTest.executeSoon(function() {
-          UCTObserver.opened.resolve(win);
-          });
-        }, {once: true});
+        win.addEventListener(
+          "load",
+          function onLoad(event) {
+            // Let the dialog initialize
+            SimpleTest.executeSoon(function() {
+              UCTObserver.opened.resolve(win);
+            });
+          },
+          { once: true }
+        );
         break;
 
       case "domwindowclosed":
         if (win.location == UCT_URI) {
           this.closed.resolve();
         }
         break;
     }
@@ -40,44 +46,47 @@ function waitDelay(delay) {
     /* eslint-disable mozilla/no-arbitrary-setTimeout */
     window.setTimeout(resolve, delay);
   });
 }
 
 add_task(async function test_unknownContentType_delayedbutton() {
   Services.ww.registerNotification(UCTObserver);
 
-  await BrowserTestUtils.withNewTab({
-    gBrowser,
-    url: LOAD_URI,
-  }, async function() {
-    let uctWindow = await UCTObserver.opened.promise;
-    let ok = uctWindow.document.documentElement.getButton("accept");
+  await BrowserTestUtils.withNewTab(
+    {
+      gBrowser,
+      url: LOAD_URI,
+    },
+    async function() {
+      let uctWindow = await UCTObserver.opened.promise;
+      let ok = uctWindow.document.documentElement.getButton("accept");
 
-    SimpleTest.is(ok.disabled, true, "button started disabled");
+      SimpleTest.is(ok.disabled, true, "button started disabled");
 
-    await waitDelay(DIALOG_DELAY);
+      await waitDelay(DIALOG_DELAY);
 
-    SimpleTest.is(ok.disabled, false, "button was enabled");
+      SimpleTest.is(ok.disabled, false, "button was enabled");
 
-    let focusOutOfDialog = SimpleTest.promiseFocus(window);
-    window.focus();
-    await focusOutOfDialog;
+      let focusOutOfDialog = SimpleTest.promiseFocus(window);
+      window.focus();
+      await focusOutOfDialog;
 
-    SimpleTest.is(ok.disabled, true, "button was disabled");
+      SimpleTest.is(ok.disabled, true, "button was disabled");
 
-    let focusOnDialog = SimpleTest.promiseFocus(uctWindow);
-    uctWindow.focus();
-    await focusOnDialog;
+      let focusOnDialog = SimpleTest.promiseFocus(uctWindow);
+      uctWindow.focus();
+      await focusOnDialog;
 
-    SimpleTest.is(ok.disabled, true, "button remained disabled");
+      SimpleTest.is(ok.disabled, true, "button remained disabled");
 
-    await waitDelay(DIALOG_DELAY);
-    SimpleTest.is(ok.disabled, false, "button re-enabled after delay");
+      await waitDelay(DIALOG_DELAY);
+      SimpleTest.is(ok.disabled, false, "button re-enabled after delay");
 
-    uctWindow.document.documentElement.cancelDialog();
-    await UCTObserver.closed.promise;
+      uctWindow.document.documentElement.cancelDialog();
+      await UCTObserver.closed.promise;
 
-    Services.ww.unregisterNotification(UCTObserver);
-    uctWindow = null;
-    UCTObserver = null;
-  });
+      Services.ww.unregisterNotification(UCTObserver);
+      uctWindow = null;
+      UCTObserver = null;
+    }
+  );
 });
--- a/toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_dialog_layout.js
+++ b/toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_dialog_layout.js
@@ -6,25 +6,29 @@
  * The unknownContentType popup can have two different layouts depending on
  * whether a helper application can be selected or not.
  * This tests that both layouts have correct collapsed elements.
  */
 
 const UCT_URI = "chrome://mozapps/content/downloads/unknownContentType.xul";
 
 let tests = [
-  { // This URL will trigger the simple UI, where only the Save an Cancel buttons are available
-    url: "http://mochi.test:8888/browser/toolkit/mozapps/downloads/tests/browser/unknownContentType_dialog_layout_data.pif",
+  {
+    // This URL will trigger the simple UI, where only the Save an Cancel buttons are available
+    url:
+      "http://mochi.test:8888/browser/toolkit/mozapps/downloads/tests/browser/unknownContentType_dialog_layout_data.pif",
     elements: {
       basicBox: { collapsed: false },
       normalBox: { collapsed: true },
     },
   },
-  { // This URL will trigger the full UI
-    url: "http://mochi.test:8888/browser/toolkit/mozapps/downloads/tests/browser/unknownContentType_dialog_layout_data.txt",
+  {
+    // This URL will trigger the full UI
+    url:
+      "http://mochi.test:8888/browser/toolkit/mozapps/downloads/tests/browser/unknownContentType_dialog_layout_data.txt",
     elements: {
       basicBox: { collapsed: true },
       normalBox: { collapsed: false },
     },
   },
 ];
 
 add_task(async function test_unknownContentType_dialog_layout() {
@@ -33,50 +37,64 @@ add_task(async function test_unknownCont
       opened: PromiseUtils.defer(),
       closed: PromiseUtils.defer(),
 
       observe(aSubject, aTopic, aData) {
         let win = aSubject;
 
         switch (aTopic) {
           case "domwindowopened":
-            win.addEventListener("load", function onLoad(event) {
-              // Let the dialog initialize
-              SimpleTest.executeSoon(function() {
-                UCTObserver.opened.resolve(win);
-              });
-            }, {once: true});
+            win.addEventListener(
+              "load",
+              function onLoad(event) {
+                // Let the dialog initialize
+                SimpleTest.executeSoon(function() {
+                  UCTObserver.opened.resolve(win);
+                });
+              },
+              { once: true }
+            );
             break;
 
           case "domwindowclosed":
             if (win.location == UCT_URI) {
               this.closed.resolve();
             }
             break;
         }
       },
     };
 
     Services.ww.registerNotification(UCTObserver);
-    await BrowserTestUtils.withNewTab({
-      gBrowser,
-      url: test.url,
-    }, async function() {
-      let uctWindow = await UCTObserver.opened.promise;
+    await BrowserTestUtils.withNewTab(
+      {
+        gBrowser,
+        url: test.url,
+      },
+      async function() {
+        let uctWindow = await UCTObserver.opened.promise;
 
-      for (let [id, props] of Object.entries(test.elements)) {
-        let elem = uctWindow.dialog.dialogElement(id);
-        for (let [prop, value] of Object.entries(props)) {
-          SimpleTest.is(elem[prop], value,
-             "Element with id " + id + " has property " +
-             prop + " set to " + value);
+        for (let [id, props] of Object.entries(test.elements)) {
+          let elem = uctWindow.dialog.dialogElement(id);
+          for (let [prop, value] of Object.entries(props)) {
+            SimpleTest.is(
+              elem[prop],
+              value,
+              "Element with id " +
+                id +
+                " has property " +
+                prop +
+                " set to " +
+                value
+            );
+          }
         }
+        let focusOnDialog = SimpleTest.promiseFocus(uctWindow);
+        uctWindow.focus();
+        await focusOnDialog;
+
+        uctWindow.document.documentElement.cancelDialog();
+        uctWindow = null;
+        Services.ww.unregisterNotification(UCTObserver);
       }
-      let focusOnDialog = SimpleTest.promiseFocus(uctWindow);
-      uctWindow.focus();
-      await focusOnDialog;
-
-      uctWindow.document.documentElement.cancelDialog();
-      uctWindow = null;
-      Services.ww.unregisterNotification(UCTObserver);
-    });
+    );
   }
 });
--- a/toolkit/mozapps/downloads/tests/unit/head_downloads.js
+++ b/toolkit/mozapps/downloads/tests/unit/head_downloads.js
@@ -1,5 +1,5 @@
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 registerCleanupFunction(function() {
   Services.obs.notifyObservers(null, "quit-application");
 });
--- a/toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js
+++ b/toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js
@@ -1,15 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-const {DownloadUtils} = ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm");
+const { DownloadUtils } = ChromeUtils.import(
+  "resource://gre/modules/DownloadUtils.jsm"
+);
 
-const gDecimalSymbol = Number(5.4).toLocaleString().match(/\D/);
+const gDecimalSymbol = Number(5.4)
+  .toLocaleString()
+  .match(/\D/);
 function _(str) {
   return str.replace(/\./g, gDecimalSymbol);
 }
 
 function testConvertByteUnits(aBytes, aValue, aUnit) {
   let [value, unit] = DownloadUtils.convertByteUnits(aBytes);
   Assert.equal(value, aValue);
   Assert.equal(unit, aUnit);
@@ -18,91 +22,131 @@ function testConvertByteUnits(aBytes, aV
 function testTransferTotal(aCurrBytes, aMaxBytes, aTransfer) {
   let transfer = DownloadUtils.getTransferTotal(aCurrBytes, aMaxBytes);
   Assert.equal(transfer, aTransfer);
 }
 
 // Get the em-dash character because typing it directly here doesn't work :(
 var gDash = DownloadUtils.getDownloadStatus(0)[0].match(/left (.) 0 bytes/)[1];
 
-var gVals = [0, 100, 2345, 55555, 982341, 23194134, 1482, 58, 9921949201, 13498132, Infinity];
+var gVals = [
+  0,
+  100,
+  2345,
+  55555,
+  982341,
+  23194134,
+  1482,
+  58,
+  9921949201,
+  13498132,
+  Infinity,
+];
 
 function testStatus(aFunc, aCurr, aMore, aRate, aTest) {
   dump("Status Test: " + [aCurr, aMore, aRate, aTest] + "\n");
   let curr = gVals[aCurr];
   let max = curr + gVals[aMore];
   let speed = gVals[aRate];
 
   let [status, last] = aFunc(curr, max, speed);
 
   if (0) {
-    dump("testStatus(" + aCurr + ", " + aMore + ", " + aRate + ", [\"" +
-      status.replace(gDash, "--") + "\", " + last.toFixed(3) + "]);\n");
+    dump(
+      "testStatus(" +
+        aCurr +
+        ", " +
+        aMore +
+        ", " +
+        aRate +
+        ', ["' +
+        status.replace(gDash, "--") +
+        '", ' +
+        last.toFixed(3) +
+        "]);\n"
+    );
   }
 
   // Make sure the status text matches
   Assert.equal(status, _(aTest[0].replace(/--/, gDash)));
 
   // Make sure the lastSeconds matches
-  if (last == Infinity)
+  if (last == Infinity) {
     Assert.equal(last, aTest[1]);
-  else
-    Assert.ok(Math.abs(last - aTest[1]) < .1);
+  } else {
+    Assert.ok(Math.abs(last - aTest[1]) < 0.1);
+  }
 }
 
 function testURI(aURI, aDisp, aHost) {
   dump("URI Test: " + [aURI, aDisp, aHost] + "\n");
 
   let [disp, host] = DownloadUtils.getURIHost(aURI);
 
   // Make sure we have the right display host and full host
   Assert.equal(disp, aDisp);
   Assert.equal(host, aHost);
 }
 
-
 function testGetReadableDates(aDate, aCompactValue) {
   const now = new Date(2000, 11, 31, 11, 59, 59);
 
   let [dateCompact] = DownloadUtils.getReadableDates(aDate, now);
   Assert.equal(dateCompact, aCompactValue);
 }
 
 function testAllGetReadableDates() {
   // This test cannot depend on the current date and time, or the date format.
   // It depends on being run with the English localization, however.
-  const today_11_30     = new Date(2000, 11, 31, 11, 30, 15);
-  const today_12_30     = new Date(2000, 11, 31, 12, 30, 15);
+  const today_11_30 = new Date(2000, 11, 31, 11, 30, 15);
+  const today_12_30 = new Date(2000, 11, 31, 12, 30, 15);
   const yesterday_11_30 = new Date(2000, 11, 30, 11, 30, 15);
   const yesterday_12_30 = new Date(2000, 11, 30, 12, 30, 15);
-  const twodaysago      = new Date(2000, 11, 29, 11, 30, 15);
-  const sixdaysago      = new Date(2000, 11, 25, 11, 30, 15);
-  const sevendaysago    = new Date(2000, 11, 24, 11, 30, 15);
+  const twodaysago = new Date(2000, 11, 29, 11, 30, 15);
+  const sixdaysago = new Date(2000, 11, 25, 11, 30, 15);
+  const sevendaysago = new Date(2000, 11, 24, 11, 30, 15);
 
   let cDtf = Services.intl.DateTimeFormat;
 
-  testGetReadableDates(today_11_30,
-                       (new cDtf(undefined, {timeStyle: "short"})).format(today_11_30));
-  testGetReadableDates(today_12_30,
-                       (new cDtf(undefined, {timeStyle: "short"})).format(today_12_30));
+  testGetReadableDates(
+    today_11_30,
+    new cDtf(undefined, { timeStyle: "short" }).format(today_11_30)
+  );
+  testGetReadableDates(
+    today_12_30,
+    new cDtf(undefined, { timeStyle: "short" }).format(today_12_30)
+  );
 
   testGetReadableDates(yesterday_11_30, "Yesterday");
   testGetReadableDates(yesterday_12_30, "Yesterday");
-  testGetReadableDates(twodaysago,
-                       twodaysago.toLocaleDateString(undefined, { weekday: "long" }));
-  testGetReadableDates(sixdaysago,
-                       sixdaysago.toLocaleDateString(undefined, { weekday: "long" }));
-  testGetReadableDates(sevendaysago,
-                       sevendaysago.toLocaleDateString(undefined, { month: "long" }) + " " +
-                       sevendaysago.getDate().toString().padStart(2, "0"));
+  testGetReadableDates(
+    twodaysago,
+    twodaysago.toLocaleDateString(undefined, { weekday: "long" })
+  );
+  testGetReadableDates(
+    sixdaysago,
+    sixdaysago.toLocaleDateString(undefined, { weekday: "long" })
+  );
+  testGetReadableDates(
+    sevendaysago,
+    sevendaysago.toLocaleDateString(undefined, { month: "long" }) +
+      " " +
+      sevendaysago
+        .getDate()
+        .toString()
+        .padStart(2, "0")
+  );
 
   let [, dateTimeFull] = DownloadUtils.getReadableDates(today_11_30);
 
   const dtOptions = { dateStyle: "long", timeStyle: "short" };
-  Assert.equal(dateTimeFull, (new cDtf(undefined, dtOptions)).format(today_11_30));
+  Assert.equal(
+    dateTimeFull,
+    new cDtf(undefined, dtOptions).format(today_11_30)
+  );
 }
 
 function run_test() {
   testConvertByteUnits(-1, "-1", "bytes");
   testConvertByteUnits(1, _("1"), "bytes");
   testConvertByteUnits(42, _("42"), "bytes");
   testConvertByteUnits(123, _("123"), "bytes");
   testConvertByteUnits(1024, _("1.0"), "KB");
@@ -127,87 +171,215 @@ function run_test() {
     for (let i = 0; i < 100; i++) {
       testStatus(r(), r(), r());
     }
   }
 
   // First, test with rates, via getDownloadStatus...
   let statusFunc = DownloadUtils.getDownloadStatus.bind(DownloadUtils);
 
-  testStatus(statusFunc, 2, 1, 7, ["A few seconds left -- 2.3 of 2.4 KB (58 bytes/sec)", 1.724]);
-  testStatus(statusFunc, 1, 2, 6, ["A few seconds left -- 100 bytes of 2.4 KB (1.4 KB/sec)", 1.582]);
-  testStatus(statusFunc, 4, 3, 9, ["A few seconds left -- 959 KB of 1.0 MB (12.9 MB/sec)", 0.004]);
-  testStatus(statusFunc, 2, 3, 8, ["A few seconds left -- 2.3 of 56.5 KB (9.2 GB/sec)", 0.000]);
+  testStatus(statusFunc, 2, 1, 7, [
+    "A few seconds left -- 2.3 of 2.4 KB (58 bytes/sec)",
+    1.724,
+  ]);
+  testStatus(statusFunc, 1, 2, 6, [
+    "A few seconds left -- 100 bytes of 2.4 KB (1.4 KB/sec)",
+    1.582,
+  ]);
+  testStatus(statusFunc, 4, 3, 9, [
+    "A few seconds left -- 959 KB of 1.0 MB (12.9 MB/sec)",
+    0.004,
+  ]);
+  testStatus(statusFunc, 2, 3, 8, [
+    "A few seconds left -- 2.3 of 56.5 KB (9.2 GB/sec)",
+    0.0,
+  ]);
 
-  testStatus(statusFunc, 8, 4, 3, ["17s left -- 9.2 of 9.2 GB (54.3 KB/sec)", 17.682]);
-  testStatus(statusFunc, 1, 3, 2, ["23s left -- 100 bytes of 54.4 KB (2.3 KB/sec)", 23.691]);
-  testStatus(statusFunc, 9, 3, 2, ["23s left -- 12.9 of 12.9 MB (2.3 KB/sec)", 23.691]);
-  testStatus(statusFunc, 5, 6, 7, ["25s left -- 22.1 of 22.1 MB (58 bytes/sec)", 25.552]);
+  testStatus(statusFunc, 8, 4, 3, [
+    "17s left -- 9.2 of 9.2 GB (54.3 KB/sec)",
+    17.682,
+  ]);
+  testStatus(statusFunc, 1, 3, 2, [
+    "23s left -- 100 bytes of 54.4 KB (2.3 KB/sec)",
+    23.691,
+  ]);
+  testStatus(statusFunc, 9, 3, 2, [
+    "23s left -- 12.9 of 12.9 MB (2.3 KB/sec)",
+    23.691,
+  ]);
+  testStatus(statusFunc, 5, 6, 7, [
+    "25s left -- 22.1 of 22.1 MB (58 bytes/sec)",
+    25.552,
+  ]);
 
-  testStatus(statusFunc, 3, 9, 3, ["4m left -- 54.3 KB of 12.9 MB (54.3 KB/sec)", 242.969]);
-  testStatus(statusFunc, 2, 3, 1, ["9m left -- 2.3 of 56.5 KB (100 bytes/sec)", 555.550]);
-  testStatus(statusFunc, 4, 3, 7, ["15m left -- 959 KB of 1.0 MB (58 bytes/sec)", 957.845]);
-  testStatus(statusFunc, 5, 3, 7, ["15m left -- 22.1 of 22.2 MB (58 bytes/sec)", 957.845]);
+  testStatus(statusFunc, 3, 9, 3, [
+    "4m left -- 54.3 KB of 12.9 MB (54.3 KB/sec)",
+    242.969,
+  ]);
+  testStatus(statusFunc, 2, 3, 1, [
+    "9m left -- 2.3 of 56.5 KB (100 bytes/sec)",
+    555.55,
+  ]);
+  testStatus(statusFunc, 4, 3, 7, [
+    "15m left -- 959 KB of 1.0 MB (58 bytes/sec)",
+    957.845,
+  ]);
+  testStatus(statusFunc, 5, 3, 7, [
+    "15m left -- 22.1 of 22.2 MB (58 bytes/sec)",
+    957.845,
+  ]);
 
-  testStatus(statusFunc, 1, 9, 2, ["1h 35m left -- 100 bytes of 12.9 MB (2.3 KB/sec)", 5756.133]);
-  testStatus(statusFunc, 2, 9, 6, ["2h 31m left -- 2.3 KB of 12.9 MB (1.4 KB/sec)", 9108.051]);
-  testStatus(statusFunc, 2, 4, 1, ["2h 43m left -- 2.3 of 962 KB (100 bytes/sec)", 9823.410]);
-  testStatus(statusFunc, 6, 4, 7, ["4h 42m left -- 1.4 of 961 KB (58 bytes/sec)", 16936.914]);
+  testStatus(statusFunc, 1, 9, 2, [
+    "1h 35m left -- 100 bytes of 12.9 MB (2.3 KB/sec)",
+    5756.133,
+  ]);
+  testStatus(statusFunc, 2, 9, 6, [
+    "2h 31m left -- 2.3 KB of 12.9 MB (1.4 KB/sec)",
+    9108.051,
+  ]);
+  testStatus(statusFunc, 2, 4, 1, [
+    "2h 43m left -- 2.3 of 962 KB (100 bytes/sec)",
+    9823.41,
+  ]);
+  testStatus(statusFunc, 6, 4, 7, [
+    "4h 42m left -- 1.4 of 961 KB (58 bytes/sec)",
+    16936.914,
+  ]);
 
-  testStatus(statusFunc, 6, 9, 1, ["1d 13h left -- 1.4 KB of 12.9 MB (100 bytes/sec)", 134981.320]);
-  testStatus(statusFunc, 3, 8, 3, ["2d 1h left -- 54.3 KB of 9.2 GB (54.3 KB/sec)", 178596.872]);
-  testStatus(statusFunc, 1, 8, 6, ["77d 11h left -- 100 bytes of 9.2 GB (1.4 KB/sec)", 6694972.470]);
-  testStatus(statusFunc, 6, 8, 7, ["1,979d 22h left -- 1.4 KB of 9.2 GB (58 bytes/sec)", 171068089.672]);
+  testStatus(statusFunc, 6, 9, 1, [
+    "1d 13h left -- 1.4 KB of 12.9 MB (100 bytes/sec)",
+    134981.32,
+  ]);
+  testStatus(statusFunc, 3, 8, 3, [
+    "2d 1h left -- 54.3 KB of 9.2 GB (54.3 KB/sec)",
+    178596.872,
+  ]);
+  testStatus(statusFunc, 1, 8, 6, [
+    "77d 11h left -- 100 bytes of 9.2 GB (1.4 KB/sec)",
+    6694972.47,
+  ]);
+  testStatus(statusFunc, 6, 8, 7, [
+    "1,979d 22h left -- 1.4 KB of 9.2 GB (58 bytes/sec)",
+    171068089.672,
+  ]);
 
-  testStatus(statusFunc, 0, 0, 5, ["Unknown time left -- 0 of 0 bytes (22.1 MB/sec)", Infinity]);
-  testStatus(statusFunc, 0, 6, 0, ["Unknown time left -- 0 bytes of 1.4 KB (0 bytes/sec)", Infinity]);
-  testStatus(statusFunc, 6, 6, 0, ["Unknown time left -- 1.4 of 2.9 KB (0 bytes/sec)", Infinity]);
-  testStatus(statusFunc, 8, 5, 0, ["Unknown time left -- 9.2 of 9.3 GB (0 bytes/sec)", Infinity]);
+  testStatus(statusFunc, 0, 0, 5, [
+    "Unknown time left -- 0 of 0 bytes (22.1 MB/sec)",
+    Infinity,
+  ]);
+  testStatus(statusFunc, 0, 6, 0, [
+    "Unknown time left -- 0 bytes of 1.4 KB (0 bytes/sec)",
+    Infinity,
+  ]);
+  testStatus(statusFunc, 6, 6, 0, [
+    "Unknown time left -- 1.4 of 2.9 KB (0 bytes/sec)",
+    Infinity,
+  ]);
+  testStatus(statusFunc, 8, 5, 0, [
+    "Unknown time left -- 9.2 of 9.3 GB (0 bytes/sec)",
+    Infinity,
+  ]);
 
   // With rate equal to Infinity
-  testStatus(statusFunc, 0, 0, 10, ["Unknown time left -- 0 of 0 bytes (Really fast)", Infinity]);
-  testStatus(statusFunc, 1, 2, 10, ["A few seconds left -- 100 bytes of 2.4 KB (Really fast)", 0]);
+  testStatus(statusFunc, 0, 0, 10, [
+    "Unknown time left -- 0 of 0 bytes (Really fast)",
+    Infinity,
+  ]);
+  testStatus(statusFunc, 1, 2, 10, [
+    "A few seconds left -- 100 bytes of 2.4 KB (Really fast)",
+    0,
+  ]);
 
   // Now test without rates, via getDownloadStatusNoRate.
   statusFunc = DownloadUtils.getDownloadStatusNoRate.bind(DownloadUtils);
 
-  testStatus(statusFunc, 2, 1, 7, ["A few seconds left -- 2.3 of 2.4 KB", 1.724]);
-  testStatus(statusFunc, 1, 2, 6, ["A few seconds left -- 100 bytes of 2.4 KB", 1.582]);
-  testStatus(statusFunc, 4, 3, 9, ["A few seconds left -- 959 KB of 1.0 MB", 0.004]);
-  testStatus(statusFunc, 2, 3, 8, ["A few seconds left -- 2.3 of 56.5 KB", 0.000]);
+  testStatus(statusFunc, 2, 1, 7, [
+    "A few seconds left -- 2.3 of 2.4 KB",
+    1.724,
+  ]);
+  testStatus(statusFunc, 1, 2, 6, [
+    "A few seconds left -- 100 bytes of 2.4 KB",
+    1.582,
+  ]);
+  testStatus(statusFunc, 4, 3, 9, [
+    "A few seconds left -- 959 KB of 1.0 MB",
+    0.004,
+  ]);
+  testStatus(statusFunc, 2, 3, 8, [
+    "A few seconds left -- 2.3 of 56.5 KB",
+    0.0,
+  ]);
 
   testStatus(statusFunc, 8, 4, 3, ["17s left -- 9.2 of 9.2 GB", 17.682]);
   testStatus(statusFunc, 1, 3, 2, ["23s left -- 100 bytes of 54.4 KB", 23.691]);
   testStatus(statusFunc, 9, 3, 2, ["23s left -- 12.9 of 12.9 MB", 23.691]);
   testStatus(statusFunc, 5, 6, 7, ["25s left -- 22.1 of 22.1 MB", 25.552]);
 
   testStatus(statusFunc, 3, 9, 3, ["4m left -- 54.3 KB of 12.9 MB", 242.969]);
-  testStatus(statusFunc, 2, 3, 1, ["9m left -- 2.3 of 56.5 KB", 555.550]);
+  testStatus(statusFunc, 2, 3, 1, ["9m left -- 2.3 of 56.5 KB", 555.55]);
   testStatus(statusFunc, 4, 3, 7, ["15m left -- 959 KB of 1.0 MB", 957.845]);
   testStatus(statusFunc, 5, 3, 7, ["15m left -- 22.1 of 22.2 MB", 957.845]);
 
-  testStatus(statusFunc, 1, 9, 2, ["1h 35m left -- 100 bytes of 12.9 MB", 5756.133]);
-  testStatus(statusFunc, 2, 9, 6, ["2h 31m left -- 2.3 KB of 12.9 MB", 9108.051]);
-  testStatus(statusFunc, 2, 4, 1, ["2h 43m left -- 2.3 of 962 KB", 9823.410]);
+  testStatus(statusFunc, 1, 9, 2, [
+    "1h 35m left -- 100 bytes of 12.9 MB",
+    5756.133,
+  ]);
+  testStatus(statusFunc, 2, 9, 6, [
+    "2h 31m left -- 2.3 KB of 12.9 MB",
+    9108.051,
+  ]);
+  testStatus(statusFunc, 2, 4, 1, ["2h 43m left -- 2.3 of 962 KB", 9823.41]);
   testStatus(statusFunc, 6, 4, 7, ["4h 42m left -- 1.4 of 961 KB", 16936.914]);
 
-  testStatus(statusFunc, 6, 9, 1, ["1d 13h left -- 1.4 KB of 12.9 MB", 134981.320]);
-  testStatus(statusFunc, 3, 8, 3, ["2d 1h left -- 54.3 KB of 9.2 GB", 178596.872]);
-  testStatus(statusFunc, 1, 8, 6, ["77d 11h left -- 100 bytes of 9.2 GB", 6694972.470]);
-  testStatus(statusFunc, 6, 8, 7, ["1,979d 22h left -- 1.4 KB of 9.2 GB", 171068089.672]);
+  testStatus(statusFunc, 6, 9, 1, [
+    "1d 13h left -- 1.4 KB of 12.9 MB",
+    134981.32,
+  ]);
+  testStatus(statusFunc, 3, 8, 3, [
+    "2d 1h left -- 54.3 KB of 9.2 GB",
+    178596.872,
+  ]);
+  testStatus(statusFunc, 1, 8, 6, [
+    "77d 11h left -- 100 bytes of 9.2 GB",
+    6694972.47,
+  ]);
+  testStatus(statusFunc, 6, 8, 7, [
+    "1,979d 22h left -- 1.4 KB of 9.2 GB",
+    171068089.672,
+  ]);
 
-  testStatus(statusFunc, 0, 0, 5, ["Unknown time left -- 0 of 0 bytes", Infinity]);
-  testStatus(statusFunc, 0, 6, 0, ["Unknown time left -- 0 bytes of 1.4 KB", Infinity]);
-  testStatus(statusFunc, 6, 6, 0, ["Unknown time left -- 1.4 of 2.9 KB", Infinity]);
-  testStatus(statusFunc, 8, 5, 0, ["Unknown time left -- 9.2 of 9.3 GB", Infinity]);
+  testStatus(statusFunc, 0, 0, 5, [
+    "Unknown time left -- 0 of 0 bytes",
+    Infinity,
+  ]);
+  testStatus(statusFunc, 0, 6, 0, [
+    "Unknown time left -- 0 bytes of 1.4 KB",
+    Infinity,
+  ]);
+  testStatus(statusFunc, 6, 6, 0, [
+    "Unknown time left -- 1.4 of 2.9 KB",
+    Infinity,
+  ]);
+  testStatus(statusFunc, 8, 5, 0, [
+    "Unknown time left -- 9.2 of 9.3 GB",
+    Infinity,
+  ]);
 
   testURI("http://www.mozilla.org/", "mozilla.org", "www.mozilla.org");
-  testURI("http://www.city.mikasa.hokkaido.jp/", "city.mikasa.hokkaido.jp", "www.city.mikasa.hokkaido.jp");
+  testURI(
+    "http://www.city.mikasa.hokkaido.jp/",
+    "city.mikasa.hokkaido.jp",
+    "www.city.mikasa.hokkaido.jp"
+  );
   testURI("data:text/html,Hello World", "data resource", "data resource");
-  testURI("jar:http://www.mozilla.com/file!/magic", "mozilla.com", "www.mozilla.com");
+  testURI(
+    "jar:http://www.mozilla.com/file!/magic",
+    "mozilla.com",
+    "www.mozilla.com"
+  );
   testURI("file:///C:/Cool/Stuff/", "local file", "local file");
   // Don't test for moz-icon if we don't have a protocol handler for it (e.g. b2g):
   if ("@mozilla.org/network/protocol;1?name=moz-icon" in Cc) {
     testURI("moz-icon:file:///test.extension", "local file", "local file");
     testURI("moz-icon://.extension", "moz-icon resource", "moz-icon resource");
   }
   testURI("about:config", "about resource", "about resource");
   testURI("invalid.uri", "", "");
--- a/toolkit/mozapps/downloads/tests/unit/test_lowMinutes.js
+++ b/toolkit/mozapps/downloads/tests/unit/test_lowMinutes.js
@@ -1,18 +1,20 @@
 /* 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/. */
 
 /**
  * Test bug 448344 to make sure when we're in low minutes, we show both minutes
  * and seconds; but continue to show only minutes when we have plenty.
  */
 
-const {DownloadUtils} = ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm");
+const { DownloadUtils } = ChromeUtils.import(
+  "resource://gre/modules/DownloadUtils.jsm"
+);
 
 /**
  * Print some debug message to the console. All arguments will be printed,
  * separated by spaces.
  *
  * @param [arg0, arg1, arg2, ...]
  *        Any number of arguments to print out
  * @usage _("Hello World") -> prints "Hello World"
--- a/toolkit/mozapps/downloads/tests/unit/test_syncedDownloadUtils.js
+++ b/toolkit/mozapps/downloads/tests/unit/test_syncedDownloadUtils.js
@@ -3,22 +3,26 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * Test bug 420482 by making sure multiple consumers of DownloadUtils gets the
  * same time remaining time if they provide the same time left but a different
  * "last time".
  */
 
-const {DownloadUtils} = ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm");
+const { DownloadUtils } = ChromeUtils.import(
+  "resource://gre/modules/DownloadUtils.jsm"
+);
 
 function run_test() {
   // Simulate having multiple downloads requesting time left
   let downloadTimes = {};
-  for (let time of [1, 30, 60, 3456, 9999])
+  for (let time of [1, 30, 60, 3456, 9999]) {
     downloadTimes[time] = DownloadUtils.getTimeLeft(time)[0];
+  }
 
   // Pretend we're a download status bar also asking for a time left, but we're
   // using a different "last sec". We need to make sure we get the same time.
   let lastSec = 314;
-  for (let [time, text] of Object.entries(downloadTimes))
+  for (let [time, text] of Object.entries(downloadTimes)) {
     Assert.equal(DownloadUtils.getTimeLeft(time, lastSec)[0], text);
+  }
 }
--- a/toolkit/mozapps/downloads/tests/unit/test_unspecified_arguments.js
+++ b/toolkit/mozapps/downloads/tests/unit/test_unspecified_arguments.js
@@ -2,22 +2,32 @@
  * 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/. */
 
 /**
  * Make sure passing null and nothing to various variable-arg DownloadUtils
  * methods provide the same result.
  */
 
-const {DownloadUtils} = ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm");
+const { DownloadUtils } = ChromeUtils.import(
+  "resource://gre/modules/DownloadUtils.jsm"
+);
 
 function run_test() {
-  Assert.equal(DownloadUtils.getDownloadStatus(1000, null, null, null) + "",
-               DownloadUtils.getDownloadStatus(1000) + "");
-  Assert.equal(DownloadUtils.getDownloadStatus(1000, null, null) + "",
-               DownloadUtils.getDownloadStatus(1000, null) + "");
+  Assert.equal(
+    DownloadUtils.getDownloadStatus(1000, null, null, null) + "",
+    DownloadUtils.getDownloadStatus(1000) + ""
+  );
+  Assert.equal(
+    DownloadUtils.getDownloadStatus(1000, null, null) + "",
+    DownloadUtils.getDownloadStatus(1000, null) + ""
+  );
 
-  Assert.equal(DownloadUtils.getTransferTotal(1000, null) + "",
-               DownloadUtils.getTransferTotal(1000) + "");
+  Assert.equal(
+    DownloadUtils.getTransferTotal(1000, null) + "",
+    DownloadUtils.getTransferTotal(1000) + ""
+  );
 
-  Assert.equal(DownloadUtils.getTimeLeft(1000, null) + "",
-               DownloadUtils.getTimeLeft(1000) + "");
+  Assert.equal(
+    DownloadUtils.getTimeLeft(1000, null) + "",
+    DownloadUtils.getTimeLeft(1000) + ""
+  );
 }
--- a/toolkit/mozapps/extensions/AbuseReporter.jsm
+++ b/toolkit/mozapps/extensions/AbuseReporter.jsm
@@ -1,35 +1,41 @@
 /* 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/. */
 
-const EXPORTED_SYMBOLS = [ "AbuseReporter", "AbuseReportError" ];
+const EXPORTED_SYMBOLS = ["AbuseReporter", "AbuseReportError"];
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 
 Cu.importGlobalProperties(["fetch"]);
 
-const PREF_ABUSE_REPORT_URL  = "extensions.abuseReport.url";
+const PREF_ABUSE_REPORT_URL = "extensions.abuseReport.url";
 
 // Maximum length of the string properties sent to the API endpoint.
 const MAX_STRING_LENGTH = 255;
 
 // Minimum time between report submissions (in ms).
 const MIN_MS_BETWEEN_SUBMITS = 30000;
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AddonManager: "resource://gre/modules/AddonManager.jsm",
   AMTelemetry: "resource://gre/modules/AddonManager.jsm",
   AppConstants: "resource://gre/modules/AppConstants.jsm",
   ClientID: "resource://gre/modules/ClientID.jsm",
   Services: "resource://gre/modules/Services.jsm",
 });
 
-XPCOMUtils.defineLazyPreferenceGetter(this, "ABUSE_REPORT_URL", PREF_ABUSE_REPORT_URL);
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "ABUSE_REPORT_URL",
+  PREF_ABUSE_REPORT_URL
+);
 
 const PRIVATE_REPORT_PROPS = Symbol("privateReportProps");
 
 const ERROR_TYPES = Object.freeze([
   "ERROR_ABORTED_SUBMIT",
   "ERROR_ADDON_NOTFOUND",
   "ERROR_CLIENT",
   "ERROR_NETWORK",
@@ -39,18 +45,17 @@ const ERROR_TYPES = Object.freeze([
 ]);
 
 class AbuseReportError extends Error {
   constructor(errorType, errorInfo = undefined) {
     if (!ERROR_TYPES.includes(errorType)) {
       throw new Error(`Unknown AbuseReportError type "${errorType}"`);
     }
 
-    let message = errorInfo ?
-      `${errorType} - ${errorInfo}` : errorType;
+    let message = errorInfo ? `${errorType} - ${errorInfo}` : errorType;
 
     super(message);
     this.name = "AbuseReportError";
     this.errorType = errorType;
     this.errorInfo = errorInfo;
   }
 }
 
@@ -88,17 +93,17 @@ const AbuseReporter = {
    * @param {object} options
    * @param {string} options.reportEntryPoint
    *        An identifier that represent the entry point for the report flow.
    *
    * @returns {AbuseReport}
    *          An instance of the AbuseReport class, which represent an ongoing
    *          report.
    */
-  async createAbuseReport(addonId, {reportEntryPoint} = {}) {
+  async createAbuseReport(addonId, { reportEntryPoint } = {}) {
     const addon = await AddonManager.getAddonByID(addonId);
 
     if (!addon) {
       AMTelemetry.recordReportEvent({
         addonId,
         errorType: "ERROR_ADDON_NOTFOUND",
         reportEntryPoint,
       });
@@ -123,34 +128,35 @@ const AbuseReporter = {
    *
    * @param {AddonWrapper} addon
    *        The addon object to collect the detail from.
    *
    * @return {object}
    *         An object that contains the collected details.
    */
   async getReportData(addon) {
-    const truncateString = (text) =>
+    const truncateString = text =>
       typeof text == "string" ? text.slice(0, MAX_STRING_LENGTH) : text;
 
     const data = {
       addon: addon.id,
       addon_version: addon.version,
       addon_name: truncateString(addon.name),
       addon_summary: truncateString(addon.description),
-      addon_install_origin: addon.sourceURI && truncateString(addon.sourceURI.spec),
+      addon_install_origin:
+        addon.sourceURI && truncateString(addon.sourceURI.spec),
       install_date: addon.installDate && addon.installDate.toISOString(),
     };
 
     // Map addon.installTelemetryInfo values to the supported addon_install_method
     // values supported by the API endpoint (See API endpoint docs at
     // https://addons-server.readthedocs.io/en/latest/topics/api/abuse.html).
     let install_method = "other";
     if (addon.installTelemetryInfo) {
-      const {source, method} = addon.installTelemetryInfo;
+      const { source, method } = addon.installTelemetryInfo;
       switch (source) {
         case "enterprise-policy":
         case "file-url":
         case "system-addon":
         case "temporary-addon":
           install_method = source.replace(/-/g, "_");
           break;
         case "distribution":
@@ -243,28 +249,28 @@ const AbuseReporter = {
  *        (May be null if the extension has not been found).
  * @param {object|null}       options.reportData
  *        An object which contains addon and environment details to send as part of a submission
  *        (may be null if the report has a createErrorType).
  * @param {string}            options.reportEntryPoint
  *        A string that identify how the report has been triggered.
  */
 class AbuseReport {
-  constructor({addon, createErrorType, reportData, reportEntryPoint}) {
+  constructor({ addon, createErrorType, reportData, reportEntryPoint }) {
     this[PRIVATE_REPORT_PROPS] = {
       aborted: false,
       abortController: new AbortController(),
       addon,
       reportData,
       reportEntryPoint,
     };
   }
 
   recordTelemetry(errorType) {
-    const {addon, reportEntryPoint} = this;
+    const { addon, reportEntryPoint } = this;
     AMTelemetry.recordReportEvent({
       addonId: addon.id,
       addonType: addon.type,
       errorType,
       reportEntryPoint,
     });
   }
 
@@ -277,25 +283,23 @@ class AbuseReport {
    * @params {string} [options.message]
    *         An optional string which contains a description for the reported issue.
    *
    * @returns {Promise<void>}
    *          Resolves once the report has been successfully submitted.
    *          It rejects with an AbuseReportError if the report couldn't be
    *          submitted for a known reason (or another Error type otherwise).
    */
-  async submit({reason, message}) {
-    const {
-      aborted, abortController,
-      reportData,
-      reportEntryPoint,
-    } = this[PRIVATE_REPORT_PROPS];
+  async submit({ reason, message }) {
+    const { aborted, abortController, reportData, reportEntryPoint } = this[
+      PRIVATE_REPORT_PROPS
+    ];
 
     // Record telemetry event and throw an AbuseReportError.
-    const rejectReportError = async (errorType, {response} = {}) => {
+    const rejectReportError = async (errorType, { response } = {}) => {
       this.recordTelemetry(errorType);
 
       let errorInfo;
       if (response) {
         try {
           errorInfo = JSON.stringify({
             status: response.status,
             responseText: await response.text().catch(err => ""),
@@ -320,17 +324,17 @@ class AbuseReport {
 
     let response;
     try {
       response = await fetch(ABUSE_REPORT_URL, {
         signal: abortController.signal,
         method: "POST",
         credentials: "omit",
         referrerPolicy: "no-referrer",
-        headers: {"Content-Type": "application/json"},
+        headers: { "Content-Type": "application/json" },
         body: JSON.stringify({
           ...reportData,
           report_entry_point: reportEntryPoint,
           message,
           reason,
         }),
       });
     } catch (err) {
@@ -350,32 +354,32 @@ class AbuseReport {
         throw err;
       }
       AbuseReporter.updateLastReportTimestamp();
       this.recordTelemetry();
       return undefined;
     }
 
     if (response.status >= 400 && response.status < 500) {
-      return rejectReportError("ERROR_CLIENT", {response});
+      return rejectReportError("ERROR_CLIENT", { response });
     }
 
     if (response.status >= 500 && response.status < 600) {
-      return rejectReportError("ERROR_SERVER", {response});
+      return rejectReportError("ERROR_SERVER", { response });
     }
 
     // We got an unexpected HTTP status code.
-    return rejectReportError("ERROR_UNKNOWN", {response});
+    return rejectReportError("ERROR_UNKNOWN", { response });
   }
 
   /**
    * Abort the report submission.
    */
   abort() {
-    const {abortController} = this[PRIVATE_REPORT_PROPS];
+    const { abortController } = this[PRIVATE_REPORT_PROPS];
     abortController.abort();
     this[PRIVATE_REPORT_PROPS].aborted = true;
   }
 
   get addon() {
     return this[PRIVATE_REPORT_PROPS].addon;
   }
 
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -12,84 +12,100 @@ if ("@mozilla.org/xre/app-info;1" in Cc)
   // eslint-disable-next-line mozilla/use-services
   let runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
   if (runtime.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
     // Refuse to run in child processes.
     throw new Error("You cannot use the AddonManager in child processes!");
   }
 }
 
-const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
-
-const MOZ_COMPATIBILITY_NIGHTLY = !["aurora", "beta", "release", "esr"].includes(AppConstants.MOZ_UPDATE_CHANNEL);
+const { AppConstants } = ChromeUtils.import(
+  "resource://gre/modules/AppConstants.jsm"
+);
+
+const MOZ_COMPATIBILITY_NIGHTLY = ![
+  "aurora",
+  "beta",
+  "release",
+  "esr",
+].includes(AppConstants.MOZ_UPDATE_CHANNEL);
 
 const PREF_BLOCKLIST_PINGCOUNTVERSION = "extensions.blocklist.pingCountVersion";
-const PREF_EM_UPDATE_ENABLED          = "extensions.update.enabled";
-const PREF_EM_LAST_APP_VERSION        = "extensions.lastAppVersion";
-const PREF_EM_LAST_PLATFORM_VERSION   = "extensions.lastPlatformVersion";
-const PREF_EM_AUTOUPDATE_DEFAULT      = "extensions.update.autoUpdateDefault";
-const PREF_EM_STRICT_COMPATIBILITY    = "extensions.strictCompatibility";
-const PREF_EM_CHECK_UPDATE_SECURITY   = "extensions.checkUpdateSecurity";
-const PREF_SYS_ADDON_UPDATE_ENABLED   = "extensions.systemAddon.update.enabled";
-
-const PREF_MIN_WEBEXT_PLATFORM_VERSION = "extensions.webExtensionsMinPlatformVersion";
-const PREF_WEBAPI_TESTING             = "extensions.webapi.testing";
-const PREF_WEBEXT_PERM_PROMPTS        = "extensions.webextPermissionPrompts";
-
-const UPDATE_REQUEST_VERSION          = 2;
-
-const BRANCH_REGEXP                   = /^([^\.]+\.[0-9]+[a-z]*).*/gi;
+const PREF_EM_UPDATE_ENABLED = "extensions.update.enabled";
+const PREF_EM_LAST_APP_VERSION = "extensions.lastAppVersion";
+const PREF_EM_LAST_PLATFORM_VERSION = "extensions.lastPlatformVersion";
+const PREF_EM_AUTOUPDATE_DEFAULT = "extensions.update.autoUpdateDefault";
+const PREF_EM_STRICT_COMPATIBILITY = "extensions.strictCompatibility";
+const PREF_EM_CHECK_UPDATE_SECURITY = "extensions.checkUpdateSecurity";
+const PREF_SYS_ADDON_UPDATE_ENABLED = "extensions.systemAddon.update.enabled";
+
+const PREF_MIN_WEBEXT_PLATFORM_VERSION =
+  "extensions.webExtensionsMinPlatformVersion";
+const PREF_WEBAPI_TESTING = "extensions.webapi.testing";
+const PREF_WEBEXT_PERM_PROMPTS = "extensions.webextPermissionPrompts";
+
+const UPDATE_REQUEST_VERSION = 2;
+
+const BRANCH_REGEXP = /^([^\.]+\.[0-9]+[a-z]*).*/gi;
 const PREF_EM_CHECK_COMPATIBILITY_BASE = "extensions.checkCompatibility";
-var PREF_EM_CHECK_COMPATIBILITY = MOZ_COMPATIBILITY_NIGHTLY ?
-                                  PREF_EM_CHECK_COMPATIBILITY_BASE + ".nightly" :
-                                  undefined;
+var PREF_EM_CHECK_COMPATIBILITY = MOZ_COMPATIBILITY_NIGHTLY
+  ? PREF_EM_CHECK_COMPATIBILITY_BASE + ".nightly"
+  : undefined;
 
 const VALID_TYPES_REGEXP = /^[\w\-]+$/;
 
 const WEBAPI_INSTALL_HOSTS = ["addons.mozilla.org"];
 const WEBAPI_TEST_INSTALL_HOSTS = [
-  "addons.allizom.org", "addons-dev.allizom.org",
+  "addons.allizom.org",
+  "addons-dev.allizom.org",
   "example.com",
 ];
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 // This global is overridden by xpcshell tests, and therefore cannot be
 // a const.
-var {AsyncShutdown} = ChromeUtils.import("resource://gre/modules/AsyncShutdown.jsm");
+var { AsyncShutdown } = ChromeUtils.import(
+  "resource://gre/modules/AsyncShutdown.jsm"
+);
 
 XPCOMUtils.defineLazyGlobalGetters(this, ["Element"]);
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AddonRepository: "resource://gre/modules/addons/AddonRepository.jsm",
   Extension: "resource://gre/modules/Extension.jsm",
 });
 
-XPCOMUtils.defineLazyPreferenceGetter(this, "WEBEXT_PERMISSION_PROMPTS",
-                                      PREF_WEBEXT_PERM_PROMPTS, false);
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "WEBEXT_PERMISSION_PROMPTS",
+  PREF_WEBEXT_PERM_PROMPTS,
+  false
+);
 
 // Initialize the WebExtension process script service as early as possible,
 // since it needs to be able to track things like new frameLoader globals that
 // are created before other framework code has been initialized.
 Services.ppmm.loadProcessScript(
   "data:,ChromeUtils.import('resource://gre/modules/ExtensionProcessScript.jsm')",
-  true);
+  true
+);
 
 const INTEGER = /^[1-9]\d*$/;
 
-var EXPORTED_SYMBOLS = [ "AddonManager", "AddonManagerPrivate", "AMTelemetry" ];
+var EXPORTED_SYMBOLS = ["AddonManager", "AddonManagerPrivate", "AMTelemetry"];
 
 const CATEGORY_PROVIDER_MODULE = "addon-provider-module";
 
 // A list of providers to load by default
-const DEFAULT_PROVIDERS = [
-  "resource://gre/modules/addons/XPIProvider.jsm",
-];
-
-const {Log} = ChromeUtils.import("resource://gre/modules/Log.jsm");
+const DEFAULT_PROVIDERS = ["resource://gre/modules/addons/XPIProvider.jsm"];
+
+const { Log } = ChromeUtils.import("resource://gre/modules/Log.jsm");
 // Configure a logger at the parent 'addons' level to format
 // messages for all the modules under addons.*
 const PARENT_LOGGER_ID = "addons";
 var parentLogger = Log.repository.getLogger(PARENT_LOGGER_ID);
 parentLogger.level = Log.Level.Warn;
 var formatter = new Log.BasicFormatter();
 // Set parent logger (and its children) to append to
 // the Javascript section of the Browser Console
@@ -119,35 +135,38 @@ function providerName(aProvider) {
 }
 
 /**
  * Preference listener which listens for a change in the
  * "extensions.logging.enabled" preference and changes the logging level of the
  * parent 'addons' level logger accordingly.
  */
 var PrefObserver = {
-    init() {
-      Services.prefs.addObserver(PREF_LOGGING_ENABLED, this);
-      Services.obs.addObserver(this, "xpcom-shutdown");
-      this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED);
-    },
-
-    observe(aSubject, aTopic, aData) {
-      if (aTopic == "xpcom-shutdown") {
-        Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this);
-        Services.obs.removeObserver(this, "xpcom-shutdown");
-      } else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
-        let debugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED, false);
-        if (debugLogEnabled) {
-          parentLogger.level = Log.Level.Debug;
-        } else {
-          parentLogger.level = Log.Level.Warn;
-        }
+  init() {
+    Services.prefs.addObserver(PREF_LOGGING_ENABLED, this);
+    Services.obs.addObserver(this, "xpcom-shutdown");
+    this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED);
+  },
+
+  observe(aSubject, aTopic, aData) {
+    if (aTopic == "xpcom-shutdown") {
+      Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this);
+      Services.obs.removeObserver(this, "xpcom-shutdown");
+    } else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
+      let debugLogEnabled = Services.prefs.getBoolPref(
+        PREF_LOGGING_ENABLED,
+        false
+      );
+      if (debugLogEnabled) {
+        parentLogger.level = Log.Level.Debug;
+      } else {
+        parentLogger.level = Log.Level.Warn;
       }
-    },
+    }
+  },
 };
 
 PrefObserver.init();
 
 /**
  * Calls a callback method consuming any thrown exception. Any parameters after
  * the callback parameter will be passed to the callback.
  *
@@ -181,18 +200,19 @@ function reportProviderError(aProvider, 
  *         The method name to call
  * @param  aDefault
  *         A default return value if the provider does not implement the named
  *         method or throws an error.
  * @return the return value from the provider, or aDefault if the provider does not
  *         implement method or throws an error
  */
 function callProvider(aProvider, aMethod, aDefault, ...aArgs) {
-  if (!(aMethod in aProvider))
+  if (!(aMethod in aProvider)) {
     return aDefault;
+  }
 
   try {
     return aProvider[aMethod].apply(aProvider, aArgs);
   } catch (e) {
     reportProviderError(aProvider, aMethod, e);
     return aDefault;
   }
 }
@@ -223,34 +243,42 @@ async function promiseCallProvider(aProv
 /**
  * Gets the currently selected locale for display.
  * @return  the selected locale or "en-US" if none is selected
  */
 function getLocale() {
   return Services.locale.requestedLocale || "en-US";
 }
 
-const WEB_EXPOSED_ADDON_PROPERTIES = [ "id", "version", "type", "name",
-                                       "description", "isActive" ];
+const WEB_EXPOSED_ADDON_PROPERTIES = [
+  "id",
+  "version",
+  "type",
+  "name",
+  "description",
+  "isActive",
+];
 
 function webAPIForAddon(addon) {
   if (!addon) {
     return null;
   }
 
   // These web-exposed Addon properties (see AddonManager.webidl)
   // just come directly from an Addon object.
   let result = {};
   for (let prop of WEB_EXPOSED_ADDON_PROPERTIES) {
     result[prop] = addon[prop];
   }
 
   // These properties are computed.
   result.isEnabled = !addon.userDisabled;
-  result.canUninstall = Boolean(addon.permissions & AddonManager.PERM_CAN_UNINSTALL);
+  result.canUninstall = Boolean(
+    addon.permissions & AddonManager.PERM_CAN_UNINSTALL
+  );
 
   return result;
 }
 
 /**
  * Listens for a browser changing origin and cancels the installs that were
  * started by it.
  */
@@ -268,49 +296,56 @@ function BrowserListener(aBrowser, aInst
 }
 
 BrowserListener.prototype = {
   browser: null,
   install: null,
   registered: false,
 
   unregister() {
-    if (!this.registered)
+    if (!this.registered) {
       return;
+    }
     this.registered = false;
 
     Services.obs.removeObserver(this, "message-manager-close");
     // The browser may have already been detached
-    if (this.browser.removeProgressListener)
+    if (this.browser.removeProgressListener) {
       this.browser.removeProgressListener(this);
+    }
 
     this.install.removeListener(this);
     this.install = null;
   },
 
   cancelInstall() {
     try {
       this.install.cancel();
     } catch (e) {
       // install may have already failed or been cancelled, ignore these
     }
   },
 
   observe(subject, topic, data) {
-    if (subject != this.browser.messageManager)
+    if (subject != this.browser.messageManager) {
       return;
+    }
 
     // The browser's message manager has closed and so the browser is
     // going away, cancel the install
     this.cancelInstall();
   },
 
   onLocationChange(webProgress, request, location) {
-    if (this.browser.contentPrincipal && this.principal.subsumes(this.browser.contentPrincipal))
+    if (
+      this.browser.contentPrincipal &&
+      this.principal.subsumes(this.browser.contentPrincipal)
+    ) {
       return;
+    }
 
     // The browser has navigated to a new origin so cancel the install
     this.cancelInstall();
   },
 
   onDownloadCancelled(install) {
     this.unregister();
   },
@@ -322,19 +357,21 @@ BrowserListener.prototype = {
   onInstallFailed(install) {
     this.unregister();
   },
 
   onInstallEnded(install) {
     this.unregister();
   },
 
-  QueryInterface: ChromeUtils.generateQI([Ci.nsISupportsWeakReference,
-                                          Ci.nsIWebProgressListener,
-                                          Ci.nsIObserver]),
+  QueryInterface: ChromeUtils.generateQI([
+    Ci.nsISupportsWeakReference,
+    Ci.nsIWebProgressListener,
+    Ci.nsIObserver,
+  ]),
 };
 
 /**
  * This represents an author of an add-on (e.g. creator or developer)
  *
  * @param  aName
  *         The name of the author
  * @param  aURL
@@ -368,25 +405,44 @@ AddonAuthor.prototype = {
  *         The URL to the thumbnail version of the screenshot
  * @param  aThumbnailWidth
  *         The width in pixels of the thumbnail version of the screenshot
  * @param  aThumbnailHeight
  *         The height in pixels of the thumbnail version of the screenshot
  * @param  aCaption
  *         The caption of the screenshot
  */
-function AddonScreenshot(aURL, aWidth, aHeight, aThumbnailURL,
-                         aThumbnailWidth, aThumbnailHeight, aCaption) {
+function AddonScreenshot(
+  aURL,
+  aWidth,
+  aHeight,
+  aThumbnailURL,
+  aThumbnailWidth,
+  aThumbnailHeight,
+  aCaption
+) {
   this.url = aURL;
-  if (aWidth) this.width = aWidth;
-  if (aHeight) this.height = aHeight;
-  if (aThumbnailURL) this.thumbnailURL = aThumbnailURL;
-  if (aThumbnailWidth) this.thumbnailWidth = aThumbnailWidth;
-  if (aThumbnailHeight) this.thumbnailHeight = aThumbnailHeight;
-  if (aCaption) this.caption = aCaption;
+  if (aWidth) {
+    this.width = aWidth;
+  }
+  if (aHeight) {
+    this.height = aHeight;
+  }
+  if (aThumbnailURL) {
+    this.thumbnailURL = aThumbnailURL;
+  }
+  if (aThumbnailWidth) {
+    this.thumbnailWidth = aThumbnailWidth;
+  }
+  if (aThumbnailHeight) {
+    this.thumbnailHeight = aThumbnailHeight;
+  }
+  if (aCaption) {
+    this.caption = aCaption;
+  }
 }
 
 AddonScreenshot.prototype = {
   url: null,
   width: null,
   height: null,
   thumbnailURL: null,
   thumbnailWidth: null,
@@ -394,35 +450,40 @@ AddonScreenshot.prototype = {
   caption: null,
 
   // Returns the screenshot URL, defaulting to the empty string
   toString() {
     return this.url || "";
   },
 };
 
-
 /**
  * This represents a compatibility override for an addon.
  *
  * @param  aType
  *         Override type - "compatible" or "incompatible"
  * @param  aMinVersion
  *         Minimum version of the addon to match
  * @param  aMaxVersion
  *         Maximum version of the addon to match
  * @param  aAppID
  *         Application ID used to match appMinVersion and appMaxVersion
  * @param  aAppMinVersion
  *         Minimum version of the application to match
  * @param  aAppMaxVersion
  *         Maximum version of the application to match
  */
-function AddonCompatibilityOverride(aType, aMinVersion, aMaxVersion, aAppID,
-                                    aAppMinVersion, aAppMaxVersion) {
+function AddonCompatibilityOverride(
+  aType,
+  aMinVersion,
+  aMaxVersion,
+  aAppID,
+  aAppMinVersion,
+  aAppMaxVersion
+) {
   this.type = aType;
   this.minVersion = aMinVersion;
   this.maxVersion = aMaxVersion;
   this.appID = aAppID;
   this.appMinVersion = aAppMinVersion;
   this.appMaxVersion = aAppMaxVersion;
 }
 
@@ -454,17 +515,16 @@ AddonCompatibilityOverride.prototype = {
   appMinVersion: null,
 
   /**
    * Max version of the application to match.
    */
   appMaxVersion: null,
 };
 
-
 /**
  * A type of add-on, used by the UI to determine how to display different types
  * of add-ons.
  *
  * @param  aID
  *         The add-on type ID
  * @param  aLocaleURI
  *         The URI of a localized properties file to get the displayable name
@@ -475,27 +535,44 @@ AddonCompatibilityOverride.prototype = {
  *         The optional type of view to use in the UI
  * @param  aUIPriority
  *         The priority is used by the UI to list the types in order. Lower
  *         values push the type higher in the list.
  * @param  aFlags
  *         An option set of flags that customize the display of the add-on in
  *         the UI.
  */
-function AddonType(aID, aLocaleURI, aLocaleKey, aViewType, aUIPriority, aFlags) {
-  if (!aID)
-    throw Components.Exception("An AddonType must have an ID", Cr.NS_ERROR_INVALID_ARG);
-
-  if (aViewType && aUIPriority === undefined)
-    throw Components.Exception("An AddonType with a defined view must have a set UI priority",
-                               Cr.NS_ERROR_INVALID_ARG);
-
-  if (!aLocaleKey)
-    throw Components.Exception("An AddonType must have a displayable name",
-                               Cr.NS_ERROR_INVALID_ARG);
+function AddonType(
+  aID,
+  aLocaleURI,
+  aLocaleKey,
+  aViewType,
+  aUIPriority,
+  aFlags
+) {
+  if (!aID) {
+    throw Components.Exception(
+      "An AddonType must have an ID",
+      Cr.NS_ERROR_INVALID_ARG
+    );
+  }
+
+  if (aViewType && aUIPriority === undefined) {
+    throw Components.Exception(
+      "An AddonType with a defined view must have a set UI priority",
+      Cr.NS_ERROR_INVALID_ARG
+    );
+  }
+
+  if (!aLocaleKey) {
+    throw Components.Exception(
+      "An AddonType must have a displayable name",
+      Cr.NS_ERROR_INVALID_ARG
+    );
+  }
 
   this.id = aID;
   this.uiPriority = aUIPriority;
   this.viewType = aViewType;
   this.flags = aFlags;
 
   if (aLocaleURI) {
     XPCOMUtils.defineLazyGetter(this, "name", () => {
@@ -556,193 +633,274 @@ var AddonManagerInternal = {
    * @param {string} aProvider - An add-on provider.
    * @param {boolean} aAppChanged - Whether or not the app version has changed since last session.
    * @param {string} aOldAppVersion - Previous application version, if changed.
    * @param {string} aOldPlatformVersion - Previous platform version, if changed.
    *
    * @private
    */
   _startProvider(aProvider, aAppChanged, aOldAppVersion, aOldPlatformVersion) {
-    if (!gStarted)
-      throw Components.Exception("AddonManager is not initialized",
-                                 Cr.NS_ERROR_NOT_INITIALIZED);
+    if (!gStarted) {
+      throw Components.Exception(
+        "AddonManager is not initialized",
+        Cr.NS_ERROR_NOT_INITIALIZED
+      );
+    }
 
     logger.debug(`Starting provider: ${providerName(aProvider)}`);
-    callProvider(aProvider, "startup", null, aAppChanged, aOldAppVersion, aOldPlatformVersion);
+    callProvider(
+      aProvider,
+      "startup",
+      null,
+      aAppChanged,
+      aOldAppVersion,
+      aOldPlatformVersion
+    );
     if ("shutdown" in aProvider) {
       let name = providerName(aProvider);
       let AMProviderShutdown = () => {
         // If the provider has been unregistered, it will have been removed from
         // this.providers. If it hasn't been unregistered, then this is a normal
         // shutdown - and we move it to this.pendingProviders in case we're
         // running in a test that will start AddonManager again.
         if (this.providers.has(aProvider)) {
           this.providers.delete(aProvider);
           this.pendingProviders.add(aProvider);
         }
 
         return new Promise((resolve, reject) => {
-            logger.debug("Calling shutdown blocker for " + name);
-            resolve(aProvider.shutdown());
-          })
-          .catch(err => {
-            logger.warn("Failure during shutdown of " + name, err);
-            AddonManagerPrivate.recordException("AMI", "Async shutdown of " + name, err);
-          });
+          logger.debug("Calling shutdown blocker for " + name);
+          resolve(aProvider.shutdown());
+        }).catch(err => {
+          logger.warn("Failure during shutdown of " + name, err);
+          AddonManagerPrivate.recordException(
+            "AMI",
+            "Async shutdown of " + name,
+            err
+          );
+        });
       };
       logger.debug("Registering shutdown blocker for " + name);
       this.providerShutdowns.set(aProvider, AMProviderShutdown);
       AddonManagerPrivate.finalShutdown.addBlocker(name, AMProviderShutdown);
     }
 
     this.pendingProviders.delete(aProvider);
     this.providers.add(aProvider);
     logger.debug(`Provider finished startup: ${providerName(aProvider)}`);
   },
 
   _getProviderByName(aName) {
     for (let provider of this.providers) {
-      if (providerName(provider) == aName)
+      if (providerName(provider) == aName) {
         return provider;
+      }
     }
     return undefined;
   },
 
   /**
    * Initializes the AddonManager, loading any known providers and initializing
    * them.
    */
   startup() {
     try {
-      if (gStarted)
+      if (gStarted) {
         return;
+      }
 
       this.recordTimestamp("AMI_startup_begin");
 
       // Enable the addonsManager telemetry event category.
       AMTelemetry.init();
 
       // clear this for xpcshell test restarts
-      for (let provider in this.telemetryDetails)
+      for (let provider in this.telemetryDetails) {
         delete this.telemetryDetails[provider];
+      }
 
       let appChanged = undefined;
 
       let oldAppVersion = null;
       try {
         oldAppVersion = Services.prefs.getCharPref(PREF_EM_LAST_APP_VERSION);
         appChanged = Services.appinfo.version != oldAppVersion;
-      } catch (e) { }
+      } catch (e) {}
 
       gBrowserUpdated = appChanged;
 
-      let oldPlatformVersion = Services.prefs.getCharPref(PREF_EM_LAST_PLATFORM_VERSION, "");
+      let oldPlatformVersion = Services.prefs.getCharPref(
+        PREF_EM_LAST_PLATFORM_VERSION,
+        ""
+      );
 
       if (appChanged !== false) {
         logger.debug("Application has been upgraded");
-        Services.prefs.setCharPref(PREF_EM_LAST_APP_VERSION,
-                                   Services.appinfo.version);
-        Services.prefs.setCharPref(PREF_EM_LAST_PLATFORM_VERSION,
-                                   Services.appinfo.platformVersion);
-        Services.prefs.setIntPref(PREF_BLOCKLIST_PINGCOUNTVERSION,
-                                  (appChanged === undefined ? 0 : -1));
+        Services.prefs.setCharPref(
+          PREF_EM_LAST_APP_VERSION,
+          Services.appinfo.version
+        );
+        Services.prefs.setCharPref(
+          PREF_EM_LAST_PLATFORM_VERSION,
+          Services.appinfo.platformVersion
+        );
+        Services.prefs.setIntPref(
+          PREF_BLOCKLIST_PINGCOUNTVERSION,
+          appChanged === undefined ? 0 : -1
+        );
       }
 
       if (!MOZ_COMPATIBILITY_NIGHTLY) {
-        PREF_EM_CHECK_COMPATIBILITY = PREF_EM_CHECK_COMPATIBILITY_BASE + "." +
-                                      Services.appinfo.version.replace(BRANCH_REGEXP, "$1");
+        PREF_EM_CHECK_COMPATIBILITY =
+          PREF_EM_CHECK_COMPATIBILITY_BASE +
+          "." +
+          Services.appinfo.version.replace(BRANCH_REGEXP, "$1");
       }
 
-      gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY,
-                                                       gCheckCompatibility);
+      gCheckCompatibility = Services.prefs.getBoolPref(
+        PREF_EM_CHECK_COMPATIBILITY,
+        gCheckCompatibility
+      );
       Services.prefs.addObserver(PREF_EM_CHECK_COMPATIBILITY, this);
 
-      gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY,
-                                                        gStrictCompatibility);
+      gStrictCompatibility = Services.prefs.getBoolPref(
+        PREF_EM_STRICT_COMPATIBILITY,
+        gStrictCompatibility
+      );
       Services.prefs.addObserver(PREF_EM_STRICT_COMPATIBILITY, this);
 
       let defaultBranch = Services.prefs.getDefaultBranch("");
-      gCheckUpdateSecurityDefault = defaultBranch.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY,
-                                                              gCheckUpdateSecurityDefault);
-
-      gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY,
-                                                        gCheckUpdateSecurity);
+      gCheckUpdateSecurityDefault = defaultBranch.getBoolPref(
+        PREF_EM_CHECK_UPDATE_SECURITY,
+        gCheckUpdateSecurityDefault
+      );
+
+      gCheckUpdateSecurity = Services.prefs.getBoolPref(
+        PREF_EM_CHECK_UPDATE_SECURITY,
+        gCheckUpdateSecurity
+      );
       Services.prefs.addObserver(PREF_EM_CHECK_UPDATE_SECURITY, this);
 
-      gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED, gUpdateEnabled);
+      gUpdateEnabled = Services.prefs.getBoolPref(
+        PREF_EM_UPDATE_ENABLED,
+        gUpdateEnabled
+      );
       Services.prefs.addObserver(PREF_EM_UPDATE_ENABLED, this);
 
-      gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT,
-                                                      gAutoUpdateDefault);
+      gAutoUpdateDefault = Services.prefs.getBoolPref(
+        PREF_EM_AUTOUPDATE_DEFAULT,
+        gAutoUpdateDefault
+      );
       Services.prefs.addObserver(PREF_EM_AUTOUPDATE_DEFAULT, this);
 
-      gWebExtensionsMinPlatformVersion =
-        Services.prefs.getCharPref(PREF_MIN_WEBEXT_PLATFORM_VERSION,
-                                   gWebExtensionsMinPlatformVersion);
+      gWebExtensionsMinPlatformVersion = Services.prefs.getCharPref(
+        PREF_MIN_WEBEXT_PLATFORM_VERSION,
+        gWebExtensionsMinPlatformVersion
+      );
       Services.prefs.addObserver(PREF_MIN_WEBEXT_PLATFORM_VERSION, this);
 
       // Ensure all default providers have had a chance to register themselves
       for (let url of DEFAULT_PROVIDERS) {
         try {
           let scope = {};
           ChromeUtils.import(url, scope);
           // Sanity check - make sure the provider exports a symbol that
           // has a 'startup' method
           let syms = Object.keys(scope);
-          if ((syms.length < 1) ||
-              (typeof scope[syms[0]].startup != "function")) {
+          if (syms.length < 1 || typeof scope[syms[0]].startup != "function") {
             logger.warn("Provider " + url + " has no startup()");
-            AddonManagerPrivate.recordException("AMI", "provider " + url, "no startup()");
+            AddonManagerPrivate.recordException(
+              "AMI",
+              "provider " + url,
+              "no startup()"
+            );
           }
-          logger.debug("Loaded provider scope for " + url + ": " + Object.keys(scope).toSource());
+          logger.debug(
+            "Loaded provider scope for " +
+              url +
+              ": " +
+              Object.keys(scope).toSource()
+          );
         } catch (e) {
-          AddonManagerPrivate.recordException("AMI", "provider " + url + " load failed", e);
-          logger.error("Exception loading default provider \"" + url + "\"", e);
+          AddonManagerPrivate.recordException(
+            "AMI",
+            "provider " + url + " load failed",
+            e
+          );
+          logger.error('Exception loading default provider "' + url + '"', e);
         }
       }
 
       // Load any providers registered in the category manager
-      for (let {entry, value: url} of Services.catMan.enumerateCategory(CATEGORY_PROVIDER_MODULE)) {
+      for (let { entry, value: url } of Services.catMan.enumerateCategory(
+        CATEGORY_PROVIDER_MODULE
+      )) {
         try {
           ChromeUtils.import(url, {});
           logger.debug(`Loaded provider scope for ${url}`);
         } catch (e) {
-          AddonManagerPrivate.recordException("AMI", "provider " + url + " load failed", e);
-          logger.error("Exception loading provider " + entry + " from category \"" +
-                url + "\"", e);
+          AddonManagerPrivate.recordException(
+            "AMI",
+            "provider " + url + " load failed",
+            e
+          );
+          logger.error(
+            "Exception loading provider " +
+              entry +
+              ' from category "' +
+              url +
+              '"',
+            e
+          );
         }
       }
 
       // Register our shutdown handler with the AsyncShutdown manager
-      gBeforeShutdownBarrier = new AsyncShutdown.Barrier("AddonManager: Waiting to start provider shutdown.");
-      gFinalShutdownBarrier = new AsyncShutdown.Barrier("AddonManager: Waiting for providers to shut down.");
-      AsyncShutdown.profileBeforeChange.addBlocker("AddonManager: shutting down.",
-                                                   this.shutdownManager.bind(this),
-                                                   {fetchState: this.shutdownState.bind(this)});
+      gBeforeShutdownBarrier = new AsyncShutdown.Barrier(
+        "AddonManager: Waiting to start provider shutdown."
+      );
+      gFinalShutdownBarrier = new AsyncShutdown.Barrier(
+        "AddonManager: Waiting for providers to shut down."
+      );
+      AsyncShutdown.profileBeforeChange.addBlocker(
+        "AddonManager: shutting down.",
+        this.shutdownManager.bind(this),
+        { fetchState: this.shutdownState.bind(this) }
+      );
 
       // Once we start calling providers we must allow all normal methods to work.
       gStarted = true;
 
       for (let provider of this.pendingProviders) {
-        this._startProvider(provider, appChanged, oldAppVersion, oldPlatformVersion);
+        this._startProvider(
+          provider,
+          appChanged,
+          oldAppVersion,
+          oldPlatformVersion
+        );
       }
 
       // If this is a new profile just pretend that there were no changes
       if (appChanged === undefined) {
-        for (let type in this.startupChanges)
+        for (let type in this.startupChanges) {
           delete this.startupChanges[type];
+        }
       }
 
       // Support for remote about:plugins. Note that this module isn't loaded
       // at the top because Services.appinfo is defined late in tests.
-      let { RemotePages } =
-        ChromeUtils.import("resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm");
+      let { RemotePages } = ChromeUtils.import(
+        "resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm"
+      );
 
       gPluginPageListener = new RemotePages("about:plugins");
-      gPluginPageListener.addMessageListener("RequestPlugins", this.requestPlugins);
+      gPluginPageListener.addMessageListener(
+        "RequestPlugins",
+        this.requestPlugins
+      );
 
       gStartupComplete = true;
       this.recordTimestamp("AMI_startup_end");
     } catch (e) {
       logger.error("startup failed", e);
       AddonManagerPrivate.recordException("AMI", "startup failed", e);
     }
 
@@ -752,23 +910,29 @@ var AddonManagerInternal = {
 
   /**
    * Registers a new AddonProvider.
    *
    * @param {string} aProvider -The provider to register
    * @param {string[]} [aTypes] - An optional array of add-on types
    */
   registerProvider(aProvider, aTypes) {
-    if (!aProvider || typeof aProvider != "object")
-      throw Components.Exception("aProvider must be specified",
-                                 Cr.NS_ERROR_INVALID_ARG);
-
-    if (aTypes && !Array.isArray(aTypes))
-      throw Components.Exception("aTypes must be an array or null",
-                                 Cr.NS_ERROR_INVALID_ARG);
+    if (!aProvider || typeof aProvider != "object") {
+      throw Components.Exception(
+        "aProvider must be specified",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
+
+    if (aTypes && !Array.isArray(aTypes)) {
+      throw Components.Exception(
+        "aTypes must be an array or null",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
 
     this.pendingProviders.add(aProvider);
 
     if (aTypes) {
       for (let type of aTypes) {
         if (!(type.id in this.types)) {
           if (!VALID_TYPES_REGEXP.test(type.id)) {
             logger.warn("Ignoring invalid type " + type.id);
@@ -776,18 +940,19 @@ var AddonManagerInternal = {
           }
 
           this.types[type.id] = {
             type,
             providers: [aProvider],
           };
 
           let typeListeners = new Set(this.typeListeners);
-          for (let listener of typeListeners)
+          for (let listener of typeListeners) {
             safeCall(() => listener.onTypeAdded(type));
+          }
         } else {
           this.types[type.id].providers.push(aProvider);
         }
       }
     }
 
     // If we're registering after startup call this provider's startup.
     if (gStarted) {
@@ -800,44 +965,52 @@ var AddonManagerInternal = {
    *
    * @param  aProvider
    *         The provider to unregister
    * @return Whatever the provider's 'shutdown' method returns (if anything).
    *         For providers that have async shutdown methods returning Promises,
    *         the caller should wait for that Promise to resolve.
    */
   unregisterProvider(aProvider) {
-    if (!aProvider || typeof aProvider != "object")
-      throw Components.Exception("aProvider must be specified",
-                                 Cr.NS_ERROR_INVALID_ARG);
+    if (!aProvider || typeof aProvider != "object") {
+      throw Components.Exception(
+        "aProvider must be specified",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
 
     this.providers.delete(aProvider);
     // The test harness will unregister XPIProvider *after* shutdown, which is
     // after the provider will have been moved from providers to
     // pendingProviders.
     this.pendingProviders.delete(aProvider);
 
     for (let type in this.types) {
-      this.types[type].providers = this.types[type].providers.filter(p => p != aProvider);
+      this.types[type].providers = this.types[type].providers.filter(
+        p => p != aProvider
+      );
       if (this.types[type].providers.length == 0) {
         let oldType = this.types[type].type;
         delete this.types[type];
 
         let typeListeners = new Set(this.typeListeners);
-        for (let listener of typeListeners)
+        for (let listener of typeListeners) {
           safeCall(() => listener.onTypeRemoved(oldType));
+        }
       }
     }
 
     // If we're unregistering after startup but before shutting down,
     // remove the blocker for this provider's shutdown and call it.
     // If we're already shutting down, just let gFinalShutdownBarrier
     // call it to avoid races.
     if (gStarted && !gShutdownInProgress) {
-      logger.debug("Unregistering shutdown blocker for " + providerName(aProvider));
+      logger.debug(
+        "Unregistering shutdown blocker for " + providerName(aProvider)
+      );
       let shutter = this.providerShutdowns.get(aProvider);
       if (shutter) {
         this.providerShutdowns.delete(aProvider);
         gFinalShutdownBarrier.client.removeBlocker(shutter);
         return shutter();
       }
     }
     return undefined;
@@ -854,23 +1027,27 @@ var AddonManagerInternal = {
    * useful if the provider wants to perform tasks that block startup, which
    * happen after its required initialization tasks and therefore when the
    * provider is in a safe state.
    *
    * @param aProvider Provider object to mark safe
    */
   markProviderSafe(aProvider) {
     if (!gStarted) {
-      throw Components.Exception("AddonManager is not initialized",
-                                 Cr.NS_ERROR_NOT_INITIALIZED);
+      throw Components.Exception(
+        "AddonManager is not initialized",
+        Cr.NS_ERROR_NOT_INITIALIZED
+      );
     }
 
     if (!aProvider || typeof aProvider != "object") {
-      throw Components.Exception("aProvider must be specified",
-                                 Cr.NS_ERROR_INVALID_ARG);
+      throw Components.Exception(
+        "aProvider must be specified",
+        Cr.NS_ERROR_INVALID_ARG
+      );
     }
 
     if (!this.pendingProviders.has(aProvider)) {
       return;
     }
 
     this.pendingProviders.delete(aProvider);
     this.providers.add(aProvider);
@@ -883,39 +1060,43 @@ var AddonManagerInternal = {
    * WARNING: Do not use for asynchronous calls; callProviders() does not
    * invoke callbacks if provider methods throw synchronous exceptions.
    *
    * @param  aMethod
    *         The method name to call
    * @see    callProvider
    */
   callProviders(aMethod, ...aArgs) {
-    if (!aMethod || typeof aMethod != "string")
-      throw Components.Exception("aMethod must be a non-empty string",
-                                 Cr.NS_ERROR_INVALID_ARG);
+    if (!aMethod || typeof aMethod != "string") {
+      throw Components.Exception(
+        "aMethod must be a non-empty string",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
 
     let providers = [...this.providers];
     for (let provider of providers) {
       try {
-        if (aMethod in provider)
+        if (aMethod in provider) {
           provider[aMethod].apply(provider, aArgs);
+        }
       } catch (e) {
         reportProviderError(provider, aMethod, e);
       }
     }
   },
 
   /**
    * Report the current state of asynchronous shutdown
    */
   shutdownState() {
     let state = [];
     for (let barrier of [gBeforeShutdownBarrier, gFinalShutdownBarrier]) {
       if (barrier) {
-        state.push({name: barrier.client.name, state: barrier.state});
+        state.push({ name: barrier.client.name, state: barrier.state });
       }
     }
     state.push({
       name: "AddonRepository: async shutdown",
       state: gRepoShutdownState,
     });
     return state;
   },
@@ -951,54 +1132,70 @@ var AddonManagerInternal = {
     let savedError = null;
     // Only shut down providers if they've been started.
     if (gStarted) {
       try {
         await gFinalShutdownBarrier.wait();
       } catch (err) {
         savedError = err;
         logger.error("Failure during wait for shutdown barrier", err);
-        AddonManagerPrivate.recordException("AMI", "Async shutdown of AddonManager providers", err);
+        AddonManagerPrivate.recordException(
+          "AMI",
+          "Async shutdown of AddonManager providers",
+          err
+        );
       }
     }
 
     // Shut down AddonRepository after providers (if any).
     try {
       gRepoShutdownState = "in progress";
       await AddonRepository.shutdown();
       gRepoShutdownState = "done";
     } catch (err) {
       savedError = err;
       logger.error("Failure during AddonRepository shutdown", err);
-      AddonManagerPrivate.recordException("AMI", "Async shutdown of AddonRepository", err);
+      AddonManagerPrivate.recordException(
+        "AMI",
+        "Async shutdown of AddonRepository",
+        err
+      );
     }
 
     logger.debug("Async provider shutdown done");
     this.managerListeners.clear();
     this.installListeners.clear();
     this.addonListeners.clear();
     this.typeListeners.clear();
     this.providerShutdowns.clear();
-    for (let type in this.startupChanges)
+    for (let type in this.startupChanges) {
       delete this.startupChanges[type];
+    }
     gStarted = false;
     gStartupComplete = false;
     gFinalShutdownBarrier = null;
     gBeforeShutdownBarrier = null;
     gShutdownInProgress = false;
     if (savedError) {
       throw savedError;
     }
   },
 
   async requestPlugins({ target: port }) {
     // Lists all the properties that plugins.html needs
-    const NEEDED_PROPS = ["name", "pluginLibraries", "pluginFullpath", "version",
-                          "isActive", "blocklistState", "description",
-                          "pluginMimeTypes"];
+    const NEEDED_PROPS = [
+      "name",
+      "pluginLibraries",
+      "pluginFullpath",
+      "version",
+      "isActive",
+      "blocklistState",
+      "description",
+      "pluginMimeTypes",
+    ];
     function filterProperties(plugin) {
       let filtered = {};
       for (let prop of NEEDED_PROPS) {
         filtered[prop] = plugin[prop];
       }
       return filtered;
     }
 
@@ -1010,61 +1207,81 @@ var AddonManagerInternal = {
    * Notified when a preference we're interested in has changed.
    *
    * @see nsIObserver
    */
   observe(aSubject, aTopic, aData) {
     switch (aData) {
       case PREF_EM_CHECK_COMPATIBILITY: {
         let oldValue = gCheckCompatibility;
-        gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY, true);
+        gCheckCompatibility = Services.prefs.getBoolPref(
+          PREF_EM_CHECK_COMPATIBILITY,
+          true
+        );
 
         this.callManagerListeners("onCompatibilityModeChanged");
 
-        if (gCheckCompatibility != oldValue)
+        if (gCheckCompatibility != oldValue) {
           this.updateAddonAppDisabledStates();
+        }
 
         break;
       }
       case PREF_EM_STRICT_COMPATIBILITY: {
         let oldValue = gStrictCompatibility;
-        gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY, true);
+        gStrictCompatibility = Services.prefs.getBoolPref(
+          PREF_EM_STRICT_COMPATIBILITY,
+          true
+        );
 
         this.callManagerListeners("onCompatibilityModeChanged");
 
-        if (gStrictCompatibility != oldValue)
+        if (gStrictCompatibility != oldValue) {
           this.updateAddonAppDisabledStates();
+        }
 
         break;
       }
       case PREF_EM_CHECK_UPDATE_SECURITY: {
         let oldValue = gCheckUpdateSecurity;
-        gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, true);
+        gCheckUpdateSecurity = Services.prefs.getBoolPref(
+          PREF_EM_CHECK_UPDATE_SECURITY,
+          true
+        );
 
         this.callManagerListeners("onCheckUpdateSecurityChanged");
 
-        if (gCheckUpdateSecurity != oldValue)
+        if (gCheckUpdateSecurity != oldValue) {
           this.updateAddonAppDisabledStates();
+        }
 
         break;
       }
       case PREF_EM_UPDATE_ENABLED: {
-        gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED, true);
+        gUpdateEnabled = Services.prefs.getBoolPref(
+          PREF_EM_UPDATE_ENABLED,
+          true
+        );
 
         this.callManagerListeners("onUpdateModeChanged");
         break;
       }
       case PREF_EM_AUTOUPDATE_DEFAULT: {
-        gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT, true);
+        gAutoUpdateDefault = Services.prefs.getBoolPref(
+          PREF_EM_AUTOUPDATE_DEFAULT,
+          true
+        );
 
         this.callManagerListeners("onUpdateModeChanged");
         break;
       }
       case PREF_MIN_WEBEXT_PLATFORM_VERSION: {
-        gWebExtensionsMinPlatformVersion = Services.prefs.getCharPref(PREF_MIN_WEBEXT_PLATFORM_VERSION);
+        gWebExtensionsMinPlatformVersion = Services.prefs.getCharPref(
+          PREF_MIN_WEBEXT_PLATFORM_VERSION
+        );
         break;
       }
     }
   },
 
   /**
    * Replaces %...% strings in an addon url (update and updateInfo) with
    * appropriate values.
@@ -1073,52 +1290,68 @@ var AddonManagerInternal = {
    *         The Addon representing the add-on
    * @param  aUri
    *         The string representation of the URI to escape
    * @param  aAppVersion
    *         The optional application version to use for %APP_VERSION%
    * @return The appropriately escaped URI.
    */
   escapeAddonURI(aAddon, aUri, aAppVersion) {
-    if (!aAddon || typeof aAddon != "object")
-      throw Components.Exception("aAddon must be an Addon object",
-                                 Cr.NS_ERROR_INVALID_ARG);
-
-    if (!aUri || typeof aUri != "string")
-      throw Components.Exception("aUri must be a non-empty string",
-                                 Cr.NS_ERROR_INVALID_ARG);
-
-    if (aAppVersion && typeof aAppVersion != "string")
-      throw Components.Exception("aAppVersion must be a string or null",
-                                 Cr.NS_ERROR_INVALID_ARG);
-
-    var addonStatus = aAddon.userDisabled || aAddon.softDisabled ? "userDisabled"
-                                                                 : "userEnabled";
-
-    if (!aAddon.isCompatible)
+    if (!aAddon || typeof aAddon != "object") {
+      throw Components.Exception(
+        "aAddon must be an Addon object",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
+
+    if (!aUri || typeof aUri != "string") {
+      throw Components.Exception(
+        "aUri must be a non-empty string",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
+
+    if (aAppVersion && typeof aAppVersion != "string") {
+      throw Components.Exception(
+        "aAppVersion must be a string or null",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
+
+    var addonStatus =
+      aAddon.userDisabled || aAddon.softDisabled
+        ? "userDisabled"
+        : "userEnabled";
+
+    if (!aAddon.isCompatible) {
       addonStatus += ",incompatible";
-
-    let {blocklistState} = aAddon;
-    if (blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED)
+    }
+
+    let { blocklistState } = aAddon;
+    if (blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED) {
       addonStatus += ",blocklisted";
-    if (blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED)
+    }
+    if (blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED) {
       addonStatus += ",softblocked";
-
-    let params = new Map(Object.entries({
-      ITEM_ID: aAddon.id,
-      ITEM_VERSION: aAddon.version,
-      ITEM_STATUS: addonStatus,
-      APP_ID: Services.appinfo.ID,
-      APP_VERSION: aAppVersion ? aAppVersion : Services.appinfo.version,
-      REQ_VERSION: UPDATE_REQUEST_VERSION,
-      APP_OS: Services.appinfo.OS,
-      APP_ABI: Services.appinfo.XPCOMABI,
-      APP_LOCALE: getLocale(),
-      CURRENT_APP_VERSION: Services.appinfo.version,
-    }));
+    }
+
+    let params = new Map(
+      Object.entries({
+        ITEM_ID: aAddon.id,
+        ITEM_VERSION: aAddon.version,
+        ITEM_STATUS: addonStatus,
+        APP_ID: Services.appinfo.ID,
+        APP_VERSION: aAppVersion ? aAppVersion : Services.appinfo.version,
+        REQ_VERSION: UPDATE_REQUEST_VERSION,
+        APP_OS: Services.appinfo.OS,
+        APP_ABI: Services.appinfo.XPCOMABI,
+        APP_LOCALE: getLocale(),
+        CURRENT_APP_VERSION: Services.appinfo.version,
+      })
+    );
 
     let uri = aUri.replace(/%([A-Z_]+)%/g, (m0, m1) => params.get(m1) || m0);
 
     // escape() does not properly encode + symbols in any embedded FVF strings.
     return uri.replace(/\+/g, "%2B");
   },
 
   _updatePromptHandler(info) {
@@ -1133,24 +1366,27 @@ var AddonManagerInternal = {
     let difference = Extension.comparePermissions(oldPerms, newPerms);
 
     // If there are no new permissions, just go ahead with the update
     if (difference.origins.length == 0 && difference.permissions.length == 0) {
       return Promise.resolve();
     }
 
     return new Promise((resolve, reject) => {
-      let subject = {wrappedJSObject: {
-        addon: info.addon,
-        permissions: difference,
-        resolve, reject,
-        // Reference to the related AddonInstall object (used in AMTelemetry to
-        // link the recorded event to the other events from the same install flow).
-        install: info.install,
-      }};
+      let subject = {
+        wrappedJSObject: {
+          addon: info.addon,
+          permissions: difference,
+          resolve,
+          reject,
+          // Reference to the related AddonInstall object (used in AMTelemetry to
+          // link the recorded event to the other events from the same install flow).
+          install: info.install,
+        },
+      };
       Services.obs.notifyObservers(subject, "webextension-update-permissions");
     });
   },
 
   // Returns true if System Addons should be updated
   systemUpdateEnabled() {
     if (!Services.prefs.getBoolPref(PREF_SYS_ADDON_UPDATE_ENABLED)) {
       return false;
@@ -1163,19 +1399,22 @@ var AddonManagerInternal = {
 
   /**
    * Performs a background update check by starting an update for all add-ons
    * that can be updated.
    * @return Promise{null} Resolves when the background update check is complete
    *                       (the resulting addon installations may still be in progress).
    */
   backgroundUpdateCheck() {
-    if (!gStarted)
-      throw Components.Exception("AddonManager is not initialized",
-                                 Cr.NS_ERROR_NOT_INITIALIZED);
+    if (!gStarted) {
+      throw Components.Exception(
+        "AddonManager is not initialized",
+        Cr.NS_ERROR_NOT_INITIALIZED
+      );
+    }
 
     let buPromise = (async () => {
       logger.debug("Background update check beginning");
 
       Services.obs.notifyObservers(null, "addons-background-update-start");
 
       if (this.updateEnabled) {
         // Keep track of all the async add-on updates happening in parallel
@@ -1190,52 +1429,64 @@ var AddonManagerInternal = {
         for (let addon of allAddons) {
           // Check all add-ons for updates so that any compatibility updates will
           // be applied
 
           if (!(addon.permissions & AddonManager.PERM_CAN_UPGRADE)) {
             continue;
           }
 
-          updates.push(new Promise((resolve, reject) => {
-            addon.findUpdates({
-              onUpdateAvailable(aAddon, aInstall) {
-                // Start installing updates when the add-on can be updated and
-                // background updates should be applied.
-                logger.debug("Found update for add-on ${id}", aAddon);
-                if (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE &&
-                    AddonManager.shouldAutoUpdate(aAddon)) {
-                  // XXX we really should resolve when this install is done,
-                  // not when update-available check completes, no?
-                  logger.debug(`Starting upgrade install of ${aAddon.id}`);
-                  if (WEBEXT_PERMISSION_PROMPTS) {
-                    aInstall.promptHandler = (...args) => AddonManagerInternal._updatePromptHandler(...args);
-                  }
-                  aInstall.install();
-                }
-              },
-
-              onUpdateFinished: aAddon => { logger.debug("onUpdateFinished for ${id}", aAddon); resolve(); },
-            }, AddonManager.UPDATE_WHEN_PERIODIC_UPDATE);
-          }));
+          updates.push(
+            new Promise((resolve, reject) => {
+              addon.findUpdates(
+                {
+                  onUpdateAvailable(aAddon, aInstall) {
+                    // Start installing updates when the add-on can be updated and
+                    // background updates should be applied.
+                    logger.debug("Found update for add-on ${id}", aAddon);
+                    if (
+                      aAddon.permissions & AddonManager.PERM_CAN_UPGRADE &&
+                      AddonManager.shouldAutoUpdate(aAddon)
+                    ) {
+                      // XXX we really should resolve when this install is done,
+                      // not when update-available check completes, no?
+                      logger.debug(`Starting upgrade install of ${aAddon.id}`);
+                      if (WEBEXT_PERMISSION_PROMPTS) {
+                        aInstall.promptHandler = (...args) =>
+                          AddonManagerInternal._updatePromptHandler(...args);
+                      }
+                      aInstall.install();
+                    }
+                  },
+
+                  onUpdateFinished: aAddon => {
+                    logger.debug("onUpdateFinished for ${id}", aAddon);
+                    resolve();
+                  },
+                },
+                AddonManager.UPDATE_WHEN_PERIODIC_UPDATE
+              );
+            })
+          );
         }
         await Promise.all(updates);
       }
 
       if (AddonManagerInternal.systemUpdateEnabled()) {
         try {
-          await AddonManagerInternal._getProviderByName("XPIProvider").updateSystemAddons();
+          await AddonManagerInternal._getProviderByName(
+            "XPIProvider"
+          ).updateSystemAddons();
         } catch (e) {
           logger.warn("Failed to update system addons", e);
         }
       }
 
       logger.debug("Background update check complete");
-      Services.obs.notifyObservers(null,
-                                   "addons-background-update-complete");
+      Services.obs.notifyObservers(null, "addons-background-update-complete");
     })();
     // Fork the promise chain so we can log the error and let our caller see it too.
     buPromise.catch(e => logger.warn("Error in background update", e));
     return buPromise;
   },
 
   /**
    * Adds a add-on to the list of detected changes for this startup. If
@@ -1245,155 +1496,206 @@ var AddonManagerInternal = {
    * @param  aType
    *         The type of change as a string. Providers can define their own
    *         types of changes or use the existing defined STARTUP_CHANGE_*
    *         constants
    * @param  aID
    *         The ID of the add-on
    */
   addStartupChange(aType, aID) {
-    if (!aType || typeof aType != "string")
-      throw Components.Exception("aType must be a non-empty string",
-                                 Cr.NS_ERROR_INVALID_ARG);
-
-    if (!aID || typeof aID != "string")
-      throw Components.Exception("aID must be a non-empty string",
-                                 Cr.NS_ERROR_INVALID_ARG);
-
-    if (gStartupComplete)
+    if (!aType || typeof aType != "string") {
+      throw Components.Exception(
+        "aType must be a non-empty string",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
+
+    if (!aID || typeof aID != "string") {
+      throw Components.Exception(
+        "aID must be a non-empty string",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
+
+    if (gStartupComplete) {
       return;
+    }
     logger.debug("Registering startup change '" + aType + "' for " + aID);
 
     // Ensure that an ID is only listed in one type of change
-    for (let type in this.startupChanges)
+    for (let type in this.startupChanges) {
       this.removeStartupChange(type, aID);
-
-    if (!(aType in this.startupChanges))
+    }
+
+    if (!(aType in this.startupChanges)) {
       this.startupChanges[aType] = [];
+    }
     this.startupChanges[aType].push(aID);
   },
 
   /**
    * Removes a startup change for an add-on.
    *
    * @param  aType
    *         The type of change
    * @param  aID
    *         The ID of the add-on
    */
   removeStartupChange(aType, aID) {
-    if (!aType || typeof aType != "string")
-      throw Components.Exception("aType must be a non-empty string",
-                                 Cr.NS_ERROR_INVALID_ARG);
-
-    if (!aID || typeof aID != "string")
-      throw Components.Exception("aID must be a non-empty string",
-                                 Cr.NS_ERROR_INVALID_ARG);
-
-    if (gStartupComplete)
+    if (!aType || typeof aType != "string") {
+      throw Components.Exception(
+        "aType must be a non-empty string",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
+
+    if (!aID || typeof aID != "string") {
+      throw Components.Exception(
+        "aID must be a non-empty string",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
+
+    if (gStartupComplete) {
       return;
-
-    if (!(aType in this.startupChanges))
+    }
+
+    if (!(aType in this.startupChanges)) {
       return;
-
-    this.startupChanges[aType] = this.startupChanges[aType].filter(aItem => aItem != aID);
+    }
+
+    this.startupChanges[aType] = this.startupChanges[aType].filter(
+      aItem => aItem != aID
+    );
   },
 
   /**
    * Calls all registered AddonManagerListeners with an event. Any parameters
    * after the method parameter are passed to the listener.
    *
    * @param  aMethod
    *         The method on the listeners to call
    */
   callManagerListeners(aMethod, ...aArgs) {
-    if (!gStarted)
-      throw Components.Exception("AddonManager is not initialized",
-                                 Cr.NS_ERROR_NOT_INITIALIZED);
-
-    if (!aMethod || typeof aMethod != "string")
-      throw Components.Exception("aMethod must be a non-empty string",
-                                 Cr.NS_ERROR_INVALID_ARG);
+    if (!gStarted) {
+      throw Components.Exception(
+        "AddonManager is not initialized",
+        Cr.NS_ERROR_NOT_INITIALIZED
+      );
+    }
+
+    if (!aMethod || typeof aMethod != "string") {
+      throw Components.Exception(
+        "aMethod must be a non-empty string",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
 
     let managerListeners = new Set(this.managerListeners);
     for (let listener of managerListeners) {
       try {
-        if (aMethod in listener)
+        if (aMethod in listener) {
           listener[aMethod].apply(listener, aArgs);
+        }
       } catch (e) {
-        logger.warn("AddonManagerListener threw exception when calling " + aMethod, e);
+        logger.warn(
+          "AddonManagerListener threw exception when calling " + aMethod,
+          e
+        );
       }
     }
   },
 
   /**
    * Calls all registered InstallListeners with an event. Any parameters after
    * the extraListeners parameter are passed to the listener.
    *
    * @param  aMethod
    *         The method on the listeners to call
    * @param  aExtraListeners
    *         An optional array of extra InstallListeners to also call
    * @return false if any of the listeners returned false, true otherwise
    */
-  callInstallListeners(aMethod,
-                                 aExtraListeners, ...aArgs) {
-    if (!gStarted)
-      throw Components.Exception("AddonManager is not initialized",
-                                 Cr.NS_ERROR_NOT_INITIALIZED);
-
-    if (!aMethod || typeof aMethod != "string")
-      throw Components.Exception("aMethod must be a non-empty string",
-                                 Cr.NS_ERROR_INVALID_ARG);
-
-    if (aExtraListeners && !Array.isArray(aExtraListeners))
-      throw Components.Exception("aExtraListeners must be an array or null",
-                                 Cr.NS_ERROR_INVALID_ARG);
+  callInstallListeners(aMethod, aExtraListeners, ...aArgs) {
+    if (!gStarted) {
+      throw Components.Exception(
+        "AddonManager is not initialized",
+        Cr.NS_ERROR_NOT_INITIALIZED
+      );
+    }
+
+    if (!aMethod || typeof aMethod != "string") {
+      throw Components.Exception(
+        "aMethod must be a non-empty string",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
+
+    if (aExtraListeners && !Array.isArray(aExtraListeners)) {
+      throw Components.Exception(
+        "aExtraListeners must be an array or null",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
 
     let result = true;
     let listeners;
-    if (aExtraListeners)
-      listeners = new Set(aExtraListeners.concat(Array.from(this.installListeners)));
-    else
+    if (aExtraListeners) {
+      listeners = new Set(
+        aExtraListeners.concat(Array.from(this.installListeners))
+      );
+    } else {
       listeners = new Set(this.installListeners);
+    }
 
     for (let listener of listeners) {
       try {
         if (aMethod in listener) {
-          if (listener[aMethod].apply(listener, aArgs) === false)
+          if (listener[aMethod].apply(listener, aArgs) === false) {
             result = false;
+          }
         }
       } catch (e) {
-        logger.warn("InstallListener threw exception when calling " + aMethod, e);
+        logger.warn(
+          "InstallListener threw exception when calling " + aMethod,
+          e
+        );
       }
     }
     return result;
   },
 
   /**
    * Calls all registered AddonListeners with an event. Any parameters after
    * the method parameter are passed to the listener.
    *
    * @param  aMethod
    *         The method on the listeners to call
    */
   callAddonListeners(aMethod, ...aArgs) {
-    if (!gStarted)
-      throw Components.Exception("AddonManager is not initialized",
-                                 Cr.NS_ERROR_NOT_INITIALIZED);
-
-    if (!aMethod || typeof aMethod != "string")
-      throw Components.Exception("aMethod must be a non-empty string",
-                                 Cr.NS_ERROR_INVALID_ARG);
+    if (!gStarted) {
+      throw Components.Exception(
+        "AddonManager is not initialized",
+        Cr.NS_ERROR_NOT_INITIALIZED
+      );
+    }
+
+    if (!aMethod || typeof aMethod != "string") {
+      throw Components.Exception(
+        "aMethod must be a non-empty string",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
 
     let addonListeners = new Set(this.addonListeners);
     for (let listener of addonListeners) {
       try {
-        if (aMethod in listener)
+        if (aMethod in listener) {
           listener[aMethod].apply(listener, aArgs);
+        }
       } catch (e) {
         logger.warn("AddonListener threw exception when calling " + aMethod, e);
       }
     }
   },
 
   /**
    * Notifies all providers that an add-on has been enabled when that type of
@@ -1404,69 +1706,91 @@ var AddonManagerInternal = {
    *         The ID of the enabled add-on
    * @param  aType
    *         The type of the enabled add-on
    * @param  aPendingRestart
    *         A boolean indicating if the change will only take place the next
    *         time the application is restarted
    */
   async notifyAddonChanged(aID, aType, aPendingRestart) {
-    if (!gStarted)
-      throw Components.Exception("AddonManager is not initialized",
-                                 Cr.NS_ERROR_NOT_INITIALIZED);
-
-    if (aID && typeof aID != "string")
-      throw Components.Exception("aID must be a string or null",
-                                 Cr.NS_ERROR_INVALID_ARG);
-
-    if (!aType || typeof aType != "string")
-      throw Components.Exception("aType must be a non-empty string",
-                                 Cr.NS_ERROR_INVALID_ARG);
+    if (!gStarted) {
+      throw Components.Exception(
+        "AddonManager is not initialized",
+        Cr.NS_ERROR_NOT_INITIALIZED
+      );
+    }
+
+    if (aID && typeof aID != "string") {
+      throw Components.Exception(
+        "aID must be a string or null",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
+
+    if (!aType || typeof aType != "string") {
+      throw Components.Exception(
+        "aType must be a non-empty string",
+        Cr.NS_ERROR_INVALID_ARG
+      );
+    }
 
     // Temporary hack until bug 520124 lands.
     // We can get here during synchronous startup, at which point it's
     // considered unsafe (and therefore disallowed by AddonManager.jsm) to
     // access providers that haven't been initialized yet. Since this is when
     // XPIProvider is starting up, XPIProvider can't access itself via APIs
     // going through AddonManager.jsm. Thankfully, this is the only use
     // of this API, and we know it's safe to use this API with both
     // providers; so we have this hack to allow bypassing the normal
     // safetey guard.
     // The notifyAddonChanged/addonChanged API will be unneeded and therefore
     // removed by bug 520124, so this is a temporary quick'n'dirty hack.
     let providers = [...this.providers, ...this.pendingProviders];
     for (let provider of providers) {
-      let result = callProvider(provider, "addonChanged", null, aID, aType, aPendingRestart);
+      let result = callProvider(
+        provider,
+        "addonChanged",
+        null,
+        aID,
+        aType,
+        aPendingRestart