Bug 1561435 - Format mobile/, a=automatic-formatting
authorVictor Porof <vporof@mozilla.com>
Fri, 05 Jul 2019 10:53:35 +0200
changeset 541061 d9ed067030a57dd50198c02044d999a51fe55591
parent 541060 5f1dccb626a04af3885507f110e446edad9f83a0
child 541062 d2c1fb7f1c917b6715f3bfe98c71a0f75ddebb7d
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 mobile/, a=automatic-formatting # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D35914
.eslintrc.js
.prettierignore
mobile/android/chrome/content/CastingApps.js
mobile/android/chrome/content/ConsoleAPI.js
mobile/android/chrome/content/EmbedRT.js
mobile/android/chrome/content/ExtensionPermissions.js
mobile/android/chrome/content/FeedHandler.js
mobile/android/chrome/content/Feedback.js
mobile/android/chrome/content/FindHelper.js
mobile/android/chrome/content/Linkify.js
mobile/android/chrome/content/MasterPassword.js
mobile/android/chrome/content/MemoryObserver.js
mobile/android/chrome/content/OfflineApps.js
mobile/android/chrome/content/PermissionsHelper.js
mobile/android/chrome/content/PresentationView.js
mobile/android/chrome/content/PrintHelper.js
mobile/android/chrome/content/Reader.js
mobile/android/chrome/content/RemoteDebugger.js
mobile/android/chrome/content/aboutAccounts.js
mobile/android/chrome/content/aboutAddons.js
mobile/android/chrome/content/aboutDownloads.js
mobile/android/chrome/content/aboutExperiments.js
mobile/android/chrome/content/aboutLogins.js
mobile/android/chrome/content/aboutPrivateBrowsing.js
mobile/android/chrome/content/browser.js
mobile/android/chrome/content/content.js
mobile/android/chrome/geckoview/ErrorPageEventHandler.js
mobile/android/chrome/geckoview/GeckoViewContentChild.js
mobile/android/chrome/geckoview/GeckoViewMediaChild.js
mobile/android/chrome/geckoview/GeckoViewNavigationChild.js
mobile/android/chrome/geckoview/GeckoViewProgressChild.js
mobile/android/chrome/geckoview/GeckoViewPromptChild.js
mobile/android/chrome/geckoview/GeckoViewScrollChild.js
mobile/android/chrome/geckoview/GeckoViewSelectionActionChild.js
mobile/android/chrome/geckoview/GeckoViewSettingsChild.js
mobile/android/chrome/geckoview/SessionStateAggregator.js
mobile/android/chrome/geckoview/config.js
mobile/android/chrome/geckoview/geckoview.js
mobile/android/components/AboutRedirector.js
mobile/android/components/AddonUpdateService.js
mobile/android/components/BlocklistPrompt.js
mobile/android/components/BrowserCLH.js
mobile/android/components/ColorPicker.js
mobile/android/components/ContentDispatchChooser.js
mobile/android/components/ContentPermissionPrompt.js
mobile/android/components/DirectoryProvider.js
mobile/android/components/FilePicker.js
mobile/android/components/FxAccountsPush.js
mobile/android/components/HelperAppDialog.js
mobile/android/components/ImageBlockingPolicy.js
mobile/android/components/LoginManagerPrompter.js
mobile/android/components/NSSDialogService.js
mobile/android/components/PersistentNotificationHandler.js
mobile/android/components/PresentationDevicePrompt.js
mobile/android/components/PresentationRequestUIGlue.js
mobile/android/components/PromptService.js
mobile/android/components/SessionStore.js
mobile/android/components/TabSource.js
mobile/android/components/XPIDialogService.js
mobile/android/components/extensions/ext-android.js
mobile/android/components/extensions/ext-browserAction.js
mobile/android/components/extensions/ext-browsingData.js
mobile/android/components/extensions/ext-c-android.js
mobile/android/components/extensions/ext-c-tabs.js
mobile/android/components/extensions/ext-pageAction.js
mobile/android/components/extensions/ext-tabs.js
mobile/android/components/extensions/ext-utils.js
mobile/android/components/extensions/test/mochitest/head.js
mobile/android/components/geckoview/GeckoViewExternalAppService.js
mobile/android/components/geckoview/GeckoViewPermission.js
mobile/android/components/geckoview/GeckoViewPrompt.js
mobile/android/components/geckoview/GeckoViewStartup.js
mobile/android/extensions/report-site-issue/background.js
mobile/android/extensions/report-site-issue/experimentalAPIs/aboutConfigPrefs.js
mobile/android/extensions/report-site-issue/experimentalAPIs/browserInfo.js
mobile/android/extensions/report-site-issue/experimentalAPIs/l10n.js
mobile/android/extensions/report-site-issue/experimentalAPIs/nativeMenu.js
mobile/android/extensions/report-site-issue/experimentalAPIs/snackbars.js
mobile/android/extensions/report-site-issue/experimentalAPIs/tabExtras.js
mobile/android/extensions/webcompat/AboutCompat.jsm
mobile/android/extensions/webcompat/aboutCompat.js
mobile/android/extensions/webcompat/aboutConfigPrefs.js
mobile/android/extensions/webcompat/aboutPage.js
mobile/android/extensions/webcompat/aboutPageProcessScript.js
mobile/android/extensions/webcompat/background.js
mobile/android/extensions/webcompat/injections.js
mobile/android/extensions/webcompat/injections/js/bug1452707-window.controllers-shim-ib.absa.co.za.js
mobile/android/extensions/webcompat/injections/js/bug1457335-histography.io-ua-change.js
mobile/android/extensions/webcompat/injections/js/bug1472075-bankofamerica.com-ua-change.js
mobile/android/extensions/webcompat/injections/js/bug1472081-election.gov.np-window.sidebar-shim.js
mobile/android/extensions/webcompat/injections/js/bug1482066-portalminasnet.com-window.sidebar-shim.js
mobile/android/extensions/webcompat/ua_overrides.js
mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/background-script.js
mobile/android/geckoview/src/androidTest/assets/web_extensions/extension-page-update/tabs.js
mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-content/messaging.js
mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging-iframe/messaging.js
mobile/android/geckoview/src/androidTest/assets/web_extensions/messaging/background.js
mobile/android/modules/Accounts.jsm
mobile/android/modules/ActionBarHandler.jsm
mobile/android/modules/BrowserActions.jsm
mobile/android/modules/DownloadNotifications.jsm
mobile/android/modules/FormAssistant.jsm
mobile/android/modules/FxAccountsWebChannel.jsm
mobile/android/modules/HelperApps.jsm
mobile/android/modules/Home.jsm
mobile/android/modules/HomeProvider.jsm
mobile/android/modules/InputWidgetHelper.jsm
mobile/android/modules/LightweightThemeConsumer.jsm
mobile/android/modules/MediaPlayerApp.jsm
mobile/android/modules/NetErrorHelper.jsm
mobile/android/modules/Notifications.jsm
mobile/android/modules/PageActions.jsm
mobile/android/modules/Prompt.jsm
mobile/android/modules/RuntimePermissions.jsm
mobile/android/modules/Sanitizer.jsm
mobile/android/modules/SelectHelper.jsm
mobile/android/modules/SharedPreferences.jsm
mobile/android/modules/Snackbars.jsm
mobile/android/modules/WebrtcUI.jsm
mobile/android/modules/WebsiteMetadata.jsm
mobile/android/modules/dbg-browser-actors.js
mobile/android/modules/geckoview/AndroidLog.jsm
mobile/android/modules/geckoview/ContentCrashHandler.jsm
mobile/android/modules/geckoview/DelayedInit.jsm
mobile/android/modules/geckoview/GeckoViewAccessibility.jsm
mobile/android/modules/geckoview/GeckoViewAutoFill.jsm
mobile/android/modules/geckoview/GeckoViewChildModule.jsm
mobile/android/modules/geckoview/GeckoViewConsole.jsm
mobile/android/modules/geckoview/GeckoViewContent.jsm
mobile/android/modules/geckoview/GeckoViewContentBlocking.jsm
mobile/android/modules/geckoview/GeckoViewMedia.jsm
mobile/android/modules/geckoview/GeckoViewModule.jsm
mobile/android/modules/geckoview/GeckoViewNavigation.jsm
mobile/android/modules/geckoview/GeckoViewProgress.jsm
mobile/android/modules/geckoview/GeckoViewRemoteDebugger.jsm
mobile/android/modules/geckoview/GeckoViewSettings.jsm
mobile/android/modules/geckoview/GeckoViewStorageController.jsm
mobile/android/modules/geckoview/GeckoViewTab.jsm
mobile/android/modules/geckoview/GeckoViewUtils.jsm
mobile/android/modules/geckoview/GeckoViewWebExtension.jsm
mobile/android/modules/geckoview/LoadURIDelegate.jsm
mobile/android/modules/geckoview/Messaging.jsm
mobile/android/tests/browser/chrome/head.js
mobile/android/tests/browser/chrome/head_scroll.js
mobile/android/tests/browser/chrome/head_search.js
mobile/android/tests/browser/robocop/robocop_head.js
mobile/android/tests/browser/robocop/robocop_testharness.js
mobile/android/tests/browser/robocop/roboextender/api.js
mobile/android/tests/browser/robocop/testAccessibleCarets.js
mobile/android/tests/browser/robocop/testActivityStreamPocketReferrer.js
mobile/android/tests/browser/robocop/testAndroidCastDeviceProvider.js
mobile/android/tests/browser/robocop/testBrowserDiscovery.js
mobile/android/tests/browser/robocop/testEventDispatcher.js
mobile/android/tests/browser/robocop/testFilePicker.js
mobile/android/tests/browser/robocop/testFindInPage.js
mobile/android/tests/browser/robocop/testHistoryService.js
mobile/android/tests/browser/robocop/testJavascriptBridge.js
mobile/android/tests/browser/robocop/testReaderCacheMigration.js
mobile/android/tests/browser/robocop/testReadingListCache.js
mobile/android/tests/browser/robocop/testRuntimePermissionsAPI.js
mobile/android/tests/browser/robocop/testSnackbarAPI.js
mobile/android/tests/browser/robocop/testThemeInstall.js
mobile/android/tests/browser/robocop/testTrackingProtection.js
mobile/android/tests/browser/robocop/testUITelemetry.js
mobile/android/tests/browser/robocop/testUnifiedTelemetryClientId.js
mobile/android/tests/browser/robocop/testVideoControls.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -40,17 +40,16 @@ module.exports = {
     "plugin:mozilla/recommended"
   ],
   "plugins": [
     "mozilla"
   ],
   "overrides": [{
       "files": [
         "devtools/**",
-        "mobile/**",
         "modules/**",
         "mozglue/**",
         "netwerk/**",
         "nsprpub/**",
         "other-licenses/**",
         "parser/**",
         "python/**",
         "remote/**",
--- a/.prettierignore
+++ b/.prettierignore
@@ -35,17 +35,16 @@ security/manager/ssl/security-prefs.js
 services/common/services-common.js
 services/sync/services-sync.js
 services/sync/tests/unit/prefs_test_prefs_store.js
 testing/marionette/prefs/marionette.js
 toolkit/components/telemetry/datareporting-prefs.js
 toolkit/components/telemetry/healthreport-prefs.js
 
 # Ignore all top-level directories for now.
-mobile/**
 modules/**
 mozglue/**
 netwerk/**
 nsprpub/**
 other-licenses/**
 parser/**
 python/**
 remote/**
--- a/mobile/android/chrome/content/CastingApps.js
+++ b/mobile/android/chrome/content/CastingApps.js
@@ -1,35 +1,42 @@
 // -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
 /* 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";
 
-ChromeUtils.defineModuleGetter(this, "PageActions",
-                               "resource://gre/modules/PageActions.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PageActions",
+  "resource://gre/modules/PageActions.jsm"
+);
 
 // Define service devices. We should consider moving these to their respective
 // JSM files, but we left them here to allow for better lazy JSM loading.
 var rokuDevice = {
   id: "roku:ecp",
   target: "roku:ecp",
   factory: function(aService) {
-    const {RokuApp} = ChromeUtils.import("resource://gre/modules/RokuApp.jsm");
+    const { RokuApp } = ChromeUtils.import(
+      "resource://gre/modules/RokuApp.jsm"
+    );
     return new RokuApp(aService);
   },
   types: ["video/mp4"],
   extensions: ["mp4"],
 };
 
 var mediaPlayerDevice = {
   id: "media:router",
   target: "media:router",
   factory: function(aService) {
-    const {MediaPlayerApp} = ChromeUtils.import("resource://gre/modules/MediaPlayerApp.jsm");
+    const { MediaPlayerApp } = ChromeUtils.import(
+      "resource://gre/modules/MediaPlayerApp.jsm"
+    );
     return new MediaPlayerApp(aService);
   },
   types: ["video/mp4", "video/webm", "application/x-mpegurl"],
   extensions: ["mp4", "webm", "m3u", "m3u8"],
   init: function() {
     GlobalEventDispatcher.registerListener(this, [
       "MediaPlayer:Added",
       "MediaPlayer:Changed",
@@ -99,30 +106,33 @@ var CastingApps = {
     Services.obs.addObserver(this, "application-foreground");
 
     BrowserApp.deck.addEventListener("TabSelect", this, true);
     BrowserApp.deck.addEventListener("pageshow", this, true);
     BrowserApp.deck.addEventListener("playing", this, true);
     BrowserApp.deck.addEventListener("ended", this, true);
     BrowserApp.deck.addEventListener("MozAutoplayMediaBlocked", this, true);
     // Note that the XBL binding is untrusted
-    BrowserApp.deck.addEventListener("MozNoControlsVideoBindingAttached", this, true, true);
+    BrowserApp.deck.addEventListener(
+      "MozNoControlsVideoBindingAttached",
+      this,
+      true,
+      true
+    );
   },
 
   _mirrorStarted: function(stopMirrorCallback) {
     this.stopMirrorCallback = stopMirrorCallback;
     NativeWindow.menu.update(this.mirrorStartMenuId, { visible: false });
     NativeWindow.menu.update(this.mirrorStopMenuId, { visible: true });
   },
 
-  serviceAdded: function(aService) {
-  },
+  serviceAdded: function(aService) {},
 
-  serviceLost: function(aService) {
-  },
+  serviceLost: function(aService) {},
 
   isCastingEnabled: function isCastingEnabled() {
     return Services.prefs.getBoolPref("browser.casting.enabled");
   },
 
   onEvent: function(event, message, callback) {
     switch (event) {
       case "Casting:Play":
@@ -175,87 +185,104 @@ var CastingApps = {
         this._updatePageActionForTab(tab, aEvent);
         break;
       }
       case "playing":
       case "ended": {
         let video = aEvent.target;
         if (video instanceof HTMLVideoElement) {
           // If playing, send the <video>, but if ended we send nothing to shutdown the pageaction
-          this._updatePageActionForVideo(aEvent.type === "playing" ? video : null);
+          this._updatePageActionForVideo(
+            aEvent.type === "playing" ? video : null
+          );
         }
         break;
       }
       case "MozAutoplayMediaBlocked": {
         if (this._bound && this._bound.has(aEvent.target)) {
-          aEvent.target.dispatchEvent(new aEvent.target.ownerGlobal.CustomEvent("MozNoControlsBlockedVideo"));
+          aEvent.target.dispatchEvent(
+            new aEvent.target.ownerGlobal.CustomEvent(
+              "MozNoControlsBlockedVideo"
+            )
+          );
         } else {
           if (!this._blocked) {
-            this._blocked = new WeakMap;
+            this._blocked = new WeakMap();
           }
           this._blocked.set(aEvent.target, true);
         }
         break;
       }
       case "MozNoControlsVideoBindingAttached": {
         if (!this._bound) {
-          this._bound = new WeakMap;
+          this._bound = new WeakMap();
         }
 
         let video = this._findVideoFromEventTarget(aEvent.target);
         if (!video) {
           return;
         }
 
         this._bound.set(video, true);
         if (this._blocked && this._blocked.has(video)) {
           this._blocked.delete(video);
-          video.dispatchEvent(new video.ownerGlobal.CustomEvent("MozNoControlsBlockedVideo"));
+          video.dispatchEvent(
+            new video.ownerGlobal.CustomEvent("MozNoControlsBlockedVideo")
+          );
         }
         break;
       }
     }
   },
 
-
   _findVideoFromEventTarget(aTarget) {
-    if (typeof ShadowRoot !== "undefined" &&
-        aTarget.parentNode instanceof ShadowRoot &&
-        aTarget.parentNode.host instanceof HTMLVideoElement) {
+    if (
+      typeof ShadowRoot !== "undefined" &&
+      aTarget.parentNode instanceof ShadowRoot &&
+      aTarget.parentNode.host instanceof HTMLVideoElement
+    ) {
       // aTarget is <div class="videocontrols"> inside UA Widget Shadow Root
       return aTarget.parentNode.host;
     }
 
     if (aTarget instanceof HTMLVideoElement) {
       // aTarget is <video>.
       return aTarget;
     }
 
     return null;
   },
 
   _sendEventToVideo: function _sendEventToVideo(aElement, aData) {
     let event = aElement.ownerDocument.createEvent("CustomEvent");
-    event.initCustomEvent("media-videoCasting", false, true, JSON.stringify(aData));
+    event.initCustomEvent(
+      "media-videoCasting",
+      false,
+      true,
+      JSON.stringify(aData)
+    );
     aElement.dispatchEvent(event);
   },
 
-  handleVideoBindingAttached: function handleVideoBindingAttached(aTab, aEvent) {
+  handleVideoBindingAttached: function handleVideoBindingAttached(
+    aTab,
+    aEvent
+  ) {
     // Let's figure out if we have everything needed to cast a video. The binding
     // defaults to |false| so we only need to send an event if |true|.
     let video = this._findVideoFromEventTarget(aEvent.target);
     if (!video) {
       return;
     }
 
     if (SimpleServiceDiscovery.services.length == 0) {
       return;
     }
 
-    this.getVideo(video, 0, 0, (aBundle) => {
+    this.getVideo(video, 0, 0, aBundle => {
       // Let the binding know casting is allowed
       if (aBundle) {
         this._sendEventToVideo(aBundle.element, { allow: true });
       }
     });
   },
 
   handleVideoBindingCast: function handleVideoBindingCast(aTab, aEvent) {
@@ -274,17 +301,19 @@ var CastingApps = {
     this.openExternal(video, 0, 0);
   },
 
   makeURI: function makeURI(aURL, aOriginCharset, aBaseURI) {
     return Services.io.newURI(aURL, aOriginCharset, aBaseURI);
   },
 
   allowableExtension: function(aURI, aExtensions) {
-    return (aURI instanceof Ci.nsIURL) && aExtensions.includes(aURI.fileExtension);
+    return (
+      aURI instanceof Ci.nsIURL && aExtensions.includes(aURI.fileExtension)
+    );
   },
 
   allowableMimeType: function(aType, aTypes) {
     return aTypes.includes(aType);
   },
 
   // This method will look at the aElement (or try to find a video at aX, aY) that has
   // a castable source. If found, aCallback will be called with a JSON meta bundle. If
@@ -306,17 +335,22 @@ var CastingApps = {
 
     // The context menu system will keep walking up the DOM giving us a chance
     // to find an element we match. When it hits <html> things can go BOOM.
     try {
       let elements = aElement.ownerDocument.querySelectorAll("video");
       for (let element of elements) {
         // Look for a video element contained in the overlay bounds
         let rect = element.getBoundingClientRect();
-        if (aY >= rect.top && aX >= rect.left && aY <= rect.bottom && aX <= rect.right) {
+        if (
+          aY >= rect.top &&
+          aX >= rect.left &&
+          aY <= rect.bottom &&
+          aX <= rect.right
+        ) {
           // Once we find a <video> under the overlay, we check it and exit.
           this._getVideo(element, types, extensions, aCallback);
           return;
         }
       }
     } catch (e) {}
   },
 
@@ -332,29 +366,33 @@ var CastingApps = {
       }
       channel = NetUtil.newChannel({
         uri: aURI,
         loadingNode: aElement,
         securityFlags: secFlags,
         contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_VIDEO,
       });
     } catch (e) {
-     aCallback(null);
-     return;
+      aCallback(null);
+      return;
     }
 
     let listener = {
       onStartRequest: function(request) {
         switch (channel.responseStatus) {
           case 301:
           case 302:
           case 303:
             request.cancel(0);
             let location = channel.getResponseHeader("Location");
-            CastingApps._getContentTypeForURI(CastingApps.makeURI(location), aElement, aCallback);
+            CastingApps._getContentTypeForURI(
+              CastingApps.makeURI(location),
+              aElement,
+              aCallback
+            );
             break;
           default:
             aCallback(channel.contentType);
             request.cancel(0);
             break;
         }
       },
       onStopRequest: function(request, statusCode) {},
@@ -382,68 +420,105 @@ var CastingApps = {
 
     // If empty, try the currentSrc
     if (!sourceURL) {
       sourceURL = aElement.currentSrc;
     }
 
     if (sourceURL) {
       // Use the file extension to guess the mime type
-      let sourceURI = this.makeURI(sourceURL, null, this.makeURI(aElement.baseURI));
+      let sourceURI = this.makeURI(
+        sourceURL,
+        null,
+        this.makeURI(aElement.baseURI)
+      );
       if (this.allowableExtension(sourceURI, aExtensions)) {
-        aCallback({ element: aElement, source: sourceURI.spec, poster: posterURL, sourceURI: sourceURI});
+        aCallback({
+          element: aElement,
+          source: sourceURI.spec,
+          poster: posterURL,
+          sourceURI: sourceURI,
+        });
         return;
       }
 
       if (aElement.type) {
         // Fast sync check
         if (this.allowableMimeType(aElement.type, aTypes)) {
-          aCallback({ element: aElement, source: sourceURI.spec, poster: posterURL, sourceURI: sourceURI, type: aElement.type });
+          aCallback({
+            element: aElement,
+            source: sourceURI.spec,
+            poster: posterURL,
+            sourceURI: sourceURI,
+            type: aElement.type,
+          });
           return;
         }
       }
 
       // Delay the async check until we sync scan all possible URIs
       asyncURIs.push(sourceURI);
     }
 
     // Next, look to see if there is a <source> child element that meets
     // our needs
     let sourceNodes = aElement.getElementsByTagName("source");
     for (let sourceNode of sourceNodes) {
-      let sourceURI = this.makeURI(sourceNode.src, null, this.makeURI(sourceNode.baseURI));
+      let sourceURI = this.makeURI(
+        sourceNode.src,
+        null,
+        this.makeURI(sourceNode.baseURI)
+      );
 
       // Using the type attribute is our ideal way to guess the mime type. Otherwise,
       // fallback to using the file extension to guess the mime type
       if (this.allowableExtension(sourceURI, aExtensions)) {
-        aCallback({ element: aElement, source: sourceURI.spec, poster: posterURL, sourceURI: sourceURI, type: sourceNode.type });
+        aCallback({
+          element: aElement,
+          source: sourceURI.spec,
+          poster: posterURL,
+          sourceURI: sourceURI,
+          type: sourceNode.type,
+        });
         return;
       }
 
       if (sourceNode.type) {
         // Fast sync check
         if (this.allowableMimeType(sourceNode.type, aTypes)) {
-          aCallback({ element: aElement, source: sourceURI.spec, poster: posterURL, sourceURI: sourceURI, type: sourceNode.type });
+          aCallback({
+            element: aElement,
+            source: sourceURI.spec,
+            poster: posterURL,
+            sourceURI: sourceURI,
+            type: sourceNode.type,
+          });
           return;
         }
       }
 
       // Delay the async check until we sync scan all possible URIs
       asyncURIs.push(sourceURI);
     }
 
     // Helper method that walks the array of possible URIs, fetching the mimetype as we go.
     // As soon as we find a good sourceURL, avoid firing the callback any further
-    var _getContentTypeForURIs = (aURIs) => {
+    var _getContentTypeForURIs = aURIs => {
       // Do an async fetch to figure out the mimetype of the source video
       let sourceURI = aURIs.pop();
-      this._getContentTypeForURI(sourceURI, aElement, (aType) => {
+      this._getContentTypeForURI(sourceURI, aElement, aType => {
         if (this.allowableMimeType(aType, aTypes)) {
           // We found a supported mimetype.
-          aCallback({ element: aElement, source: sourceURI.spec, poster: posterURL, sourceURI: sourceURI, type: aType });
+          aCallback({
+            element: aElement,
+            source: sourceURI.spec,
+            poster: posterURL,
+            sourceURI: sourceURI,
+            type: aType,
+          });
         } else if (aURIs.length > 0) {
           // This URI was not a supported mimetype, so let's try the next, if we have more.
           _getContentTypeForURIs(aURIs);
         } else {
           // We were not able to find a supported mimetype.
           aCallback(null);
         }
       });
@@ -468,32 +543,38 @@ var CastingApps = {
     // When it hits <html> things can go BOOM.
     try {
       // Maybe this is an overlay, with the video element under it
       // Use the (x, y) location to guess at a <video> element
       let elements = aElement.ownerDocument.querySelectorAll("video");
       for (let element of elements) {
         // Look for a video element contained in the overlay bounds
         let rect = element.getBoundingClientRect();
-        if (aY >= rect.top && aX >= rect.left && aY <= rect.bottom && aX <= rect.right) {
+        if (
+          aY >= rect.top &&
+          aX >= rect.left &&
+          aY <= rect.bottom &&
+          aX <= rect.right
+        ) {
           // Use the flag set when the <video> binding was created as the check
           return element.mozAllowCasting;
         }
       }
     } catch (e) {}
 
     return false;
   },
 
   filterCast: {
     matches: function(aElement, aX, aY) {
       // This behavior matches the pageaction: As long as a video is castable,
       // we can cast it, even if it's already being cast to a device.
-      if (SimpleServiceDiscovery.services.length == 0)
+      if (SimpleServiceDiscovery.services.length == 0) {
         return false;
+      }
       return CastingApps.isVideoCastable(aElement, aX, aY);
     },
   },
 
   pageAction: {
     click: function() {
       // Since this is a pageaction, we use the selected browser
       let browser = BrowserApp.selectedBrowser;
@@ -509,38 +590,38 @@ var CastingApps = {
           CastingApps.openExternal(video, 0, 0);
           return;
         }
       }
     },
   },
 
   _findCastableVideo: function _findCastableVideo(aBrowser) {
-      if (!aBrowser) {
-        return null;
+    if (!aBrowser) {
+      return null;
+    }
+
+    // Scan for a <video> being actively cast. Also look for a castable <video>
+    // on the page.
+    let castableVideo = null;
+    let videos = aBrowser.contentDocument.querySelectorAll("video");
+    for (let video of videos) {
+      if (video.mozIsCasting) {
+        // This <video> is cast-active. Break out of loop.
+        return video;
       }
 
-      // Scan for a <video> being actively cast. Also look for a castable <video>
-      // on the page.
-      let castableVideo = null;
-      let videos = aBrowser.contentDocument.querySelectorAll("video");
-      for (let video of videos) {
-        if (video.mozIsCasting) {
-          // This <video> is cast-active. Break out of loop.
-          return video;
-        }
+      if (!video.paused && video.mozAllowCasting) {
+        // This <video> is cast-ready. Keep looking so cast-active could be found.
+        castableVideo = video;
+      }
+    }
 
-        if (!video.paused && video.mozAllowCasting) {
-          // This <video> is cast-ready. Keep looking so cast-active could be found.
-          castableVideo = video;
-        }
-      }
-
-      // Could be null
-      return castableVideo;
+    // Could be null
+    return castableVideo;
   },
 
   _updatePageActionForTab: function _updatePageActionForTab(aTab, aEvent) {
     // We only care about events on the selected tab
     if (aTab != BrowserApp.selectedTab) {
       return;
     }
 
@@ -563,17 +644,20 @@ var CastingApps = {
     if (!aVideo) {
       aVideo = this._findCastableVideo(BrowserApp.selectedBrowser);
       if (!aVideo) {
         return;
       }
     }
 
     // We only show pageactions if the <video> is from the selected tab
-    if (BrowserApp.selectedTab != BrowserApp.getTabForWindow(aVideo.ownerGlobal.top)) {
+    if (
+      BrowserApp.selectedTab !=
+      BrowserApp.getTabForWindow(aVideo.ownerGlobal.top)
+    ) {
       return;
     }
 
     // We check for two state here:
     // 1. The video is actively being cast
     // 2. The video is allowed to be cast and is currently playing
     // Both states have the same action: Show the cast page action
     if (aVideo.mozIsCasting) {
@@ -611,22 +695,25 @@ var CastingApps = {
 
     if (items.length == 0) {
       return;
     }
 
     let prompt = new Prompt({
       window: aWindow,
       title: Strings.browser.GetStringFromName("casting.sendToDevice"),
-    }).setSingleChoiceItems(items).show(function(data) {
-      let selected = data.button;
-      let service = selected == -1 ? null : filteredServices[selected];
-      if (aCallback)
-        aCallback(service);
-    });
+    })
+      .setSingleChoiceItems(items)
+      .show(function(data) {
+        let selected = data.button;
+        let service = selected == -1 ? null : filteredServices[selected];
+        if (aCallback) {
+          aCallback(service);
+        }
+      });
   },
 
   handleContextMenu: function(aElement, aX, aY) {
     UITelemetry.addEvent("action.1", "contextmenu", null, "web_cast");
     UITelemetry.addEvent("cast.1", "contextmenu", null);
     this.openExternal(aElement, aX, aY);
   },
 
@@ -636,65 +723,74 @@ var CastingApps = {
   },
 
   _openExternal: function(aVideo) {
     if (!aVideo) {
       return;
     }
 
     function filterFunc(aService) {
-      return this.allowableExtension(aVideo.sourceURI, aService.extensions) || this.allowableMimeType(aVideo.type, aService.types);
+      return (
+        this.allowableExtension(aVideo.sourceURI, aService.extensions) ||
+        this.allowableMimeType(aVideo.type, aService.types)
+      );
     }
 
-    this.prompt(aVideo.element.ownerGlobal, aService => {
-      if (!aService)
-        return;
+    this.prompt(
+      aVideo.element.ownerGlobal,
+      aService => {
+        if (!aService) {
+          return;
+        }
 
-      // Make sure we have a player app for the given service
-      let app = SimpleServiceDiscovery.findAppForService(aService);
-      if (!app)
-        return;
-
-      if (aVideo.element) {
-        aVideo.title = aVideo.element.ownerGlobal.top.document.title;
+        // Make sure we have a player app for the given service
+        let app = SimpleServiceDiscovery.findAppForService(aService);
+        if (!app) {
+          return;
+        }
 
-        // If the video is currently playing on the device, pause it
-        if (!aVideo.element.paused) {
-          aVideo.element.pause();
-        }
-      }
+        if (aVideo.element) {
+          aVideo.title = aVideo.element.ownerGlobal.top.document.title;
 
-      app.stop(() => {
-        app.start(aStarted => {
-          if (!aStarted) {
-            dump("CastingApps: Unable to start app");
-            return;
+          // If the video is currently playing on the device, pause it
+          if (!aVideo.element.paused) {
+            aVideo.element.pause();
           }
+        }
 
-          app.remoteMedia(aRemoteMedia => {
-            if (!aRemoteMedia) {
-              dump("CastingApps: Failed to create remotemedia");
+        app.stop(() => {
+          app.start(aStarted => {
+            if (!aStarted) {
+              dump("CastingApps: Unable to start app");
               return;
             }
 
-            this.session = {
-              service: aService,
-              app: app,
-              remoteMedia: aRemoteMedia,
-              data: {
-                title: aVideo.title,
-                source: aVideo.source,
-                poster: aVideo.poster,
-              },
-              videoRef: Cu.getWeakReference(aVideo.element),
-            };
-          }, this);
+            app.remoteMedia(aRemoteMedia => {
+              if (!aRemoteMedia) {
+                dump("CastingApps: Failed to create remotemedia");
+                return;
+              }
+
+              this.session = {
+                service: aService,
+                app: app,
+                remoteMedia: aRemoteMedia,
+                data: {
+                  title: aVideo.title,
+                  source: aVideo.source,
+                  poster: aVideo.poster,
+                },
+                videoRef: Cu.getWeakReference(aVideo.element),
+              };
+            }, this);
+          });
         });
-      });
-    }, filterFunc.bind(this));
+      },
+      filterFunc.bind(this)
+    );
   },
 
   closeExternal: function() {
     if (!this.session) {
       return;
     }
 
     this.session.remoteMedia.shutdown();
@@ -719,18 +815,18 @@ var CastingApps = {
   // RemoteMedia callback API methods
   onRemoteMediaStart: function(aRemoteMedia) {
     if (!this.session) {
       return;
     }
 
     aRemoteMedia.load(this.session.data);
     GlobalEventDispatcher.sendRequest({
-        type: "Casting:Started",
-        device: this.session.service.friendlyName,
+      type: "Casting:Started",
+      device: this.session.service.friendlyName,
     });
 
     let video = this.session.videoRef.get();
     if (video) {
       this._sendEventToVideo(video, { active: true });
       this._updatePageAction(video);
     }
   },
--- a/mobile/android/chrome/content/ConsoleAPI.js
+++ b/mobile/android/chrome/content/ConsoleAPI.js
@@ -2,58 +2,104 @@
  * 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 ConsoleAPI = {
   observe: function observe(aMessage, aTopic, aData) {
     aMessage = aMessage.wrappedJSObject;
 
-    let mappedArguments = Array.from(aMessage.arguments, this.formatResult, this);
+    let mappedArguments = Array.from(
+      aMessage.arguments,
+      this.formatResult,
+      this
+    );
     let joinedArguments = mappedArguments.join(" ");
 
     if (aMessage.level == "error" || aMessage.level == "warn") {
-      let flag = (aMessage.level == "error" ? Ci.nsIScriptError.errorFlag : Ci.nsIScriptError.warningFlag);
-      let consoleMsg = Cc["@mozilla.org/scripterror;1"].createInstance(Ci.nsIScriptError);
-      consoleMsg.init(joinedArguments, null, null, 0, 0, flag, "content javascript");
+      let flag =
+        aMessage.level == "error"
+          ? Ci.nsIScriptError.errorFlag
+          : Ci.nsIScriptError.warningFlag;
+      let consoleMsg = Cc["@mozilla.org/scripterror;1"].createInstance(
+        Ci.nsIScriptError
+      );
+      consoleMsg.init(
+        joinedArguments,
+        null,
+        null,
+        0,
+        0,
+        flag,
+        "content javascript"
+      );
       Services.console.logMessage(consoleMsg);
     } else if (aMessage.level == "trace") {
-      let bundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
+      let bundle = Services.strings.createBundle(
+        "chrome://browser/locale/browser.properties"
+      );
       let args = aMessage.arguments;
       let filename = this.abbreviateSourceURL(args[0].filename);
-      let functionName = args[0].functionName || bundle.GetStringFromName("stacktrace.anonymousFunction");
+      let functionName =
+        args[0].functionName ||
+        bundle.GetStringFromName("stacktrace.anonymousFunction");
       let lineNumber = args[0].lineNumber;
 
-      let body = bundle.formatStringFromName("stacktrace.outputMessage", [filename, functionName, lineNumber]);
+      let body = bundle.formatStringFromName("stacktrace.outputMessage", [
+        filename,
+        functionName,
+        lineNumber,
+      ]);
       body += "\n";
       args.forEach(function(aFrame) {
-        let functionName = aFrame.functionName || bundle.GetStringFromName("stacktrace.anonymousFunction");
-        body += "  " + aFrame.filename + " :: " + functionName + " :: " + aFrame.lineNumber + "\n";
+        let functionName =
+          aFrame.functionName ||
+          bundle.GetStringFromName("stacktrace.anonymousFunction");
+        body +=
+          "  " +
+          aFrame.filename +
+          " :: " +
+          functionName +
+          " :: " +
+          aFrame.lineNumber +
+          "\n";
       });
 
       Services.console.logStringMessage(body);
     } else if (aMessage.level == "time" && aMessage.arguments) {
-      let bundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
-      let body = bundle.formatStringFromName("timer.start", [aMessage.arguments.name]);
+      let bundle = Services.strings.createBundle(
+        "chrome://browser/locale/browser.properties"
+      );
+      let body = bundle.formatStringFromName("timer.start", [
+        aMessage.arguments.name,
+      ]);
       Services.console.logStringMessage(body);
     } else if (aMessage.level == "timeEnd" && aMessage.arguments) {
-      let bundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
-      let body = bundle.formatStringFromName("timer.end", [aMessage.arguments.name, aMessage.arguments.duration]);
+      let bundle = Services.strings.createBundle(
+        "chrome://browser/locale/browser.properties"
+      );
+      let body = bundle.formatStringFromName("timer.end", [
+        aMessage.arguments.name,
+        aMessage.arguments.duration,
+      ]);
       Services.console.logStringMessage(body);
-    } else if (["group", "groupCollapsed", "groupEnd"].includes(aMessage.level)) {
+    } else if (
+      ["group", "groupCollapsed", "groupEnd"].includes(aMessage.level)
+    ) {
       // Do nothing yet
     } else {
       Services.console.logStringMessage(joinedArguments);
     }
   },
 
   getResultType: function getResultType(aResult) {
     let type = aResult === null ? "null" : typeof aResult;
-    if (type == "object" && aResult.constructor && aResult.constructor.name)
+    if (type == "object" && aResult.constructor && aResult.constructor.name) {
       type = aResult.constructor.name;
+    }
     return type.toLowerCase();
   },
 
   formatResult: function formatResult(aResult) {
     let output = "";
     let type = this.getResultType(aResult);
     switch (type) {
       case "string":
@@ -74,23 +120,26 @@ var ConsoleAPI = {
     }
 
     return output;
   },
 
   abbreviateSourceURL: function abbreviateSourceURL(aSourceURL) {
     // Remove any query parameters.
     let hookIndex = aSourceURL.indexOf("?");
-    if (hookIndex > -1)
+    if (hookIndex > -1) {
       aSourceURL = aSourceURL.substring(0, hookIndex);
+    }
 
     // Remove a trailing "/".
-    if (aSourceURL[aSourceURL.length - 1] == "/")
+    if (aSourceURL[aSourceURL.length - 1] == "/") {
       aSourceURL = aSourceURL.substring(0, aSourceURL.length - 1);
+    }
 
     // Remove all but the last path component.
     let slashIndex = aSourceURL.lastIndexOf("/");
-    if (slashIndex > -1)
+    if (slashIndex > -1) {
       aSourceURL = aSourceURL.substring(slashIndex + 1);
+    }
 
     return aSourceURL;
   },
 };
--- a/mobile/android/chrome/content/EmbedRT.js
+++ b/mobile/android/chrome/content/EmbedRT.js
@@ -1,15 +1,18 @@
 /* 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";
 
-ChromeUtils.defineModuleGetter(this, "ConsoleAPI",
-                               "resource://gre/modules/Console.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "ConsoleAPI",
+  "resource://gre/modules/Console.jsm"
+);
 
 /*
  * Collection of methods and features specific to using a GeckoView instance.
  * The code is isolated from browser.js for code size and performance reasons.
  */
 var EmbedRT = {
   _scopes: {},
 
@@ -24,41 +27,47 @@ var EmbedRT = {
   /*
    * Loads a script file into a sandbox and calls an optional load function
    */
   importScript: function(scriptURL) {
     if (scriptURL in this._scopes) {
       return;
     }
 
-    let principal = Cc["@mozilla.org/systemprincipal;1"].createInstance(Ci.nsIPrincipal);
+    let principal = Cc["@mozilla.org/systemprincipal;1"].createInstance(
+      Ci.nsIPrincipal
+    );
 
-    let sandbox = new Cu.Sandbox(principal,
-      {
-        sandboxName: scriptURL,
-        wantGlobalProperties: ["indexedDB"],
-      }
-    );
+    let sandbox = new Cu.Sandbox(principal, {
+      sandboxName: scriptURL,
+      wantGlobalProperties: ["indexedDB"],
+    });
 
     sandbox.console = new ConsoleAPI({ consoleID: "script/" + scriptURL });
 
     // As we don't want our caller to control the JS version used for the
     // script file, we run loadSubScript within the context of the
     // sandbox with the latest JS version set explicitly.
     sandbox.__SCRIPT_URI_SPEC__ = scriptURL;
-    Cu.evalInSandbox("Components.classes['@mozilla.org/moz/jssubscript-loader;1'].createInstance(Components.interfaces.mozIJSSubScriptLoader).loadSubScript(__SCRIPT_URI_SPEC__);", sandbox, "ECMAv5");
+    Cu.evalInSandbox(
+      "Components.classes['@mozilla.org/moz/jssubscript-loader;1'].createInstance(Components.interfaces.mozIJSSubScriptLoader).loadSubScript(__SCRIPT_URI_SPEC__);",
+      sandbox,
+      "ECMAv5"
+    );
 
     this._scopes[scriptURL] = sandbox;
 
     if ("load" in sandbox) {
       let params = {
         window: window,
         resourceURI: scriptURL,
       };
 
       try {
         sandbox.load(params);
       } catch (e) {
-        dump("Exception calling 'load' method in script: " + scriptURL + "\n" + e);
+        dump(
+          "Exception calling 'load' method in script: " + scriptURL + "\n" + e
+        );
       }
     }
   },
 };
--- a/mobile/android/chrome/content/ExtensionPermissions.js
+++ b/mobile/android/chrome/content/ExtensionPermissions.js
@@ -1,28 +1,34 @@
 "use strict";
 
-ChromeUtils.defineModuleGetter(this, "ExtensionData",
-                               "resource://gre/modules/Extension.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "ExtensionData",
+  "resource://gre/modules/Extension.jsm"
+);
 
 var ExtensionPermissions = {
   // id -> object containing update details (see applyUpdate() )
   updates: new Map(),
 
   // Prepare the strings needed for a permission notification.
   _prepareStrings(info) {
     let appName = Strings.brand.GetStringFromName("brandShortName");
-    let info2 = Object.assign({appName}, info);
+    let info2 = Object.assign({ appName }, info);
     let strings = ExtensionData.formatPermissionStrings(info2, Strings.browser);
 
     // We dump the main body of the dialog into a big android
     // TextView.  Build a big string with the full contents here.
     let message = "";
     if (strings.msgs.length > 0) {
-      message = [strings.listIntro, ...strings.msgs.map(s => `\u2022 ${s}`)].join("\n");
+      message = [
+        strings.listIntro,
+        ...strings.msgs.map(s => `\u2022 ${s}`),
+      ].join("\n");
     }
 
     return {
       header: strings.header.replace("<>", info.addonName),
       message,
       acceptText: strings.acceptText,
       cancelText: strings.cancelText,
     };
@@ -37,84 +43,94 @@ var ExtensionPermissions = {
 
     // If we can't render an icon, show the default
     return "DEFAULT";
   },
 
   async observe(subject, topic, data) {
     switch (topic) {
       case "webextension-permission-prompt": {
-        let {target, info} = subject.wrappedJSObject;
-        let stringInfo = Object.assign({addonName: info.addon.name}, info);
+        let { target, info } = subject.wrappedJSObject;
+        let stringInfo = Object.assign({ addonName: info.addon.name }, info);
         let details = this._prepareStrings(stringInfo);
         details.icon = this._prepareIcon(info.icon);
         details.type = "Extension:PermissionPrompt";
-        let accepted = await EventDispatcher.instance.sendRequestForResult(details);
+        let accepted = await EventDispatcher.instance.sendRequestForResult(
+          details
+        );
 
         if (accepted) {
           info.resolve();
         } else {
           info.reject();
         }
         break;
       }
 
       case "webextension-update-permissions":
         let info = subject.wrappedJSObject;
-        let {addon, resolve, reject} = info;
-        let stringInfo = Object.assign({
-          type: "update",
-          addonName: addon.name,
-        }, info);
+        let { addon, resolve, reject } = info;
+        let stringInfo = Object.assign(
+          {
+            type: "update",
+            addonName: addon.name,
+          },
+          info
+        );
 
         let details = this._prepareStrings(stringInfo);
 
         // If there are no promptable permissions, just apply the update
         if (details.message.length == 0) {
           resolve();
           return;
         }
 
         // Store all the details about the update until the user chooses to
         // look at update, at which point we will pick up in this.applyUpdate()
         details.icon = this._prepareIcon(addon.iconURL || "dummy.svg");
 
-        let first = (this.updates.size == 0);
-        this.updates.set(addon.id, {details, resolve, reject});
+        let first = this.updates.size == 0;
+        this.updates.set(addon.id, { details, resolve, reject });
 
         if (first) {
           EventDispatcher.instance.sendRequest({
             type: "Extension:ShowUpdateIcon",
             value: true,
           });
         }
         break;
 
       case "webextension-optional-permission-prompt": {
         let info = subject.wrappedJSObject;
-        let {name, resolve} = info;
-        let stringInfo = Object.assign({
-          type: "optional",
-          addonName: name,
-        }, info);
+        let { name, resolve } = info;
+        let stringInfo = Object.assign(
+          {
+            type: "optional",
+            addonName: name,
+          },
+          info
+        );
 
         let details = this._prepareStrings(stringInfo);
 
         // If there are no promptable permissions, just apply the update
         if (details.message.length == 0) {
           resolve(true);
           return;
         }
 
         // Store all the details about the update until the user chooses to
         // look at update, at which point we will pick up in this.applyUpdate()
         details.icon = this._prepareIcon(info.icon || "dummy.svg");
 
         details.type = "Extension:PermissionPrompt";
-        let accepted = await EventDispatcher.instance.sendRequestForResult(details);
+        let accepted = await EventDispatcher.instance.sendRequestForResult(
+          details
+        );
         resolve(accepted);
       }
     }
   },
 
   async applyUpdate(id) {
     if (!this.updates.has(id)) {
       return;
@@ -124,17 +140,17 @@ var ExtensionPermissions = {
     this.updates.delete(id);
     if (this.updates.size == 0) {
       EventDispatcher.instance.sendRequest({
         type: "Extension:ShowUpdateIcon",
         value: false,
       });
     }
 
-    let {details} = update;
+    let { details } = update;
     details.type = "Extension:PermissionPrompt";
 
     let accepted = await EventDispatcher.instance.sendRequestForResult(details);
     if (accepted) {
       update.resolve();
     } else {
       update.reject();
     }
--- a/mobile/android/chrome/content/FeedHandler.js
+++ b/mobile/android/chrome/content/FeedHandler.js
@@ -5,114 +5,143 @@
 
 var FeedHandler = {
   PREF_CONTENTHANDLERS_BRANCH: "browser.contentHandlers.types.",
   TYPE_MAYBE_FEED: "application/vnd.mozilla.maybe.feed",
 
   _contentTypes: null,
 
   getContentHandlers: function fh_getContentHandlers(contentType) {
-    if (!this._contentTypes)
+    if (!this._contentTypes) {
       this.loadContentHandlers();
+    }
 
-    if (!(contentType in this._contentTypes))
+    if (!(contentType in this._contentTypes)) {
       return [];
+    }
 
     return this._contentTypes[contentType];
   },
 
   loadContentHandlers: function fh_loadContentHandlers() {
     this._contentTypes = {};
 
-    let kids = Services.prefs.getBranch(this.PREF_CONTENTHANDLERS_BRANCH).getChildList("");
+    let kids = Services.prefs
+      .getBranch(this.PREF_CONTENTHANDLERS_BRANCH)
+      .getChildList("");
 
     // First get the numbers of the providers by getting all ###.uri prefs
     let nums = [];
     for (let i = 0; i < kids.length; i++) {
       let match = /^(\d+)\.uri$/.exec(kids[i]);
-      if (!match)
+      if (!match) {
         continue;
-      else
+      } else {
         nums.push(match[1]);
+      }
     }
 
     // Sort them, to get them back in order
-    nums.sort(function(a, b) { return a - b; });
+    nums.sort(function(a, b) {
+      return a - b;
+    });
 
     // Now register them
     for (let i = 0; i < nums.length; i++) {
-      let branch = Services.prefs.getBranch(this.PREF_CONTENTHANDLERS_BRANCH + nums[i] + ".");
+      let branch = Services.prefs.getBranch(
+        this.PREF_CONTENTHANDLERS_BRANCH + nums[i] + "."
+      );
       let vals = branch.getChildList("");
-      if (vals.length == 0)
+      if (vals.length == 0) {
         return;
+      }
 
       try {
         let type = branch.getCharPref("type");
         let uri = branch.getComplexValue("uri", Ci.nsIPrefLocalizedString).data;
-        let title = branch.getComplexValue("title", Ci.nsIPrefLocalizedString).data;
+        let title = branch.getComplexValue("title", Ci.nsIPrefLocalizedString)
+          .data;
 
-        if (!(type in this._contentTypes))
+        if (!(type in this._contentTypes)) {
           this._contentTypes[type] = [];
-        this._contentTypes[type].push({ contentType: type, uri: uri, name: title });
+        }
+        this._contentTypes[type].push({
+          contentType: type,
+          uri: uri,
+          name: title,
+        });
       } catch (ex) {}
     }
   },
 
   onEvent: function fh_onEvent(event, args, callback) {
     if (event === "Feeds:Subscribe") {
       let tab = BrowserApp.getTabForId(args.tabId);
-      if (!tab)
+      if (!tab) {
         return;
+      }
 
       let browser = tab.browser;
       let feeds = browser.feeds;
-      if (feeds == null)
+      if (feeds == null) {
         return;
+      }
 
       // First, let's decide on which feed to subscribe
       let feedIndex = -1;
       if (feeds.length > 1) {
         let p = new Prompt({
           window: browser.contentWindow,
           title: Strings.browser.GetStringFromName("feedHandler.chooseFeed"),
-        }).setSingleChoiceItems(feeds.map(function(feed) {
-          return { label: feed.title || feed.href };
-        })).show(data => {
-          feedIndex = data.button;
-          if (feedIndex == -1)
-            return;
+        })
+          .setSingleChoiceItems(
+            feeds.map(function(feed) {
+              return { label: feed.title || feed.href };
+            })
+          )
+          .show(data => {
+            feedIndex = data.button;
+            if (feedIndex == -1) {
+              return;
+            }
 
-          this.loadFeed(feeds[feedIndex], browser);
-        });
+            this.loadFeed(feeds[feedIndex], browser);
+          });
         return;
       }
 
       this.loadFeed(feeds[0], browser);
     }
   },
 
   loadFeed: function fh_loadFeed(aFeed, aBrowser) {
     let feedURL = aFeed.href;
 
     // Next, we decide on which service to send the feed
     let handlers = this.getContentHandlers(this.TYPE_MAYBE_FEED);
-    if (handlers.length == 0)
+    if (handlers.length == 0) {
       return;
+    }
 
     // JSON for Prompt
     let p = new Prompt({
       window: aBrowser.contentWindow,
       title: Strings.browser.GetStringFromName("feedHandler.subscribeWith"),
-    }).setSingleChoiceItems(handlers.map(function(handler) {
-      return { label: handler.name };
-    })).show(function(data) {
-      if (data.button == -1)
-        return;
+    })
+      .setSingleChoiceItems(
+        handlers.map(function(handler) {
+          return { label: handler.name };
+        })
+      )
+      .show(function(data) {
+        if (data.button == -1) {
+          return;
+        }
 
-      // Merge the handler URL and the feed URL
-      let readerURL = handlers[data.button].uri;
-      readerURL = readerURL.replace(/%s/gi, encodeURIComponent(feedURL));
+        // Merge the handler URL and the feed URL
+        let readerURL = handlers[data.button].uri;
+        readerURL = readerURL.replace(/%s/gi, encodeURIComponent(feedURL));
 
-      // Open the resultant URL in a new tab
-      BrowserApp.addTab(readerURL, { parentId: BrowserApp.selectedTab.id });
-    });
+        // Open the resultant URL in a new tab
+        BrowserApp.addTab(readerURL, { parentId: BrowserApp.selectedTab.id });
+      });
   },
 };
--- a/mobile/android/chrome/content/Feedback.js
+++ b/mobile/android/chrome/content/Feedback.js
@@ -1,43 +1,48 @@
 /* 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 Feedback = {
-
   get _feedbackURL() {
     delete this._feedbackURL;
-    return this._feedbackURL = Services.urlFormatter.formatURLPref("app.feedbackURL");
+    return (this._feedbackURL = Services.urlFormatter.formatURLPref(
+      "app.feedbackURL"
+    ));
   },
 
   onEvent: function(event, data, callback) {
     if (event !== "Feedback:Show") {
       return;
     }
 
     // Don't prompt for feedback in distribution builds.
     try {
       Services.prefs.getCharPref("distribution.id");
       return;
     } catch (e) {}
 
     let url = this._feedbackURL;
-    let browser = BrowserApp.selectOrAddTab(url, { parentId: BrowserApp.selectedTab.id }).browser;
+    let browser = BrowserApp.selectOrAddTab(url, {
+      parentId: BrowserApp.selectedTab.id,
+    }).browser;
 
     browser.addEventListener("FeedbackClose", this, false, true);
     browser.addEventListener("FeedbackMaybeLater", this, false, true);
 
     // Dispatch a custom event to the page content when feedback is prompted by the browser.
     // This will be used by the page to determine it's being loaded directly by the browser,
     // instead of by the user visiting the page, e.g. through browser history.
     function loadListener(event) {
       browser.removeEventListener("DOMContentLoaded", loadListener);
-      browser.contentDocument.dispatchEvent(new CustomEvent("FeedbackPrompted"));
+      browser.contentDocument.dispatchEvent(
+        new CustomEvent("FeedbackPrompted")
+      );
     }
     browser.addEventListener("DOMContentLoaded", loadListener);
   },
 
   handleEvent: function(event) {
     if (!this._isAllowed(event.target)) {
       return;
     }
--- a/mobile/android/chrome/content/FindHelper.js
+++ b/mobile/android/chrome/content/FindHelper.js
@@ -74,27 +74,30 @@ var FindHelper = {
     if (this._finder) {
       return;
     }
 
     this._targetTab = BrowserApp.selectedTab;
     try {
       this._finder = this._targetTab.browser.finder;
     } catch (e) {
-      throw new Error("FindHelper: " + e + "\n" +
-        "JS stack: \n" + (e.stack || Components.stack.formattedStack));
+      throw new Error(
+        "FindHelper: " +
+          e +
+          "\n" +
+          "JS stack: \n" +
+          (e.stack || Components.stack.formattedStack)
+      );
     }
 
     this._finder.addResultListener(this);
     this._initialViewport = JSON.stringify(this._targetTab.getViewport());
     this._viewportChanged = false;
 
-    WindowEventDispatcher.registerListener(this, [
-      "Tab:Selected",
-    ]);
+    WindowEventDispatcher.registerListener(this, ["Tab:Selected"]);
   },
 
   /**
    * Detach from the Finder instance (so stop listening for messages) and stop
    * tracking the active viewport.
    */
   _uninit: function() {
     // If there's no find in progress, there's nothing to clean up.
@@ -104,19 +107,17 @@ var FindHelper = {
 
     this._finder.removeSelection();
     this._finder.removeResultListener(this);
     this._finder = null;
     this._targetTab = null;
     this._initialViewport = null;
     this._viewportChanged = false;
 
-    WindowEventDispatcher.unregisterListener(this, [
-      "Tab:Selected",
-    ]);
+    WindowEventDispatcher.unregisterListener(this, ["Tab:Selected"]);
   },
 
   /**
    * When the FindInPageBar closes, it's time to stop listening for its messages.
    */
   _findClosed: function() {
     GlobalEventDispatcher.unregisterListener(this, [
       "FindInPage:Find",
@@ -173,19 +174,24 @@ var FindHelper = {
    *                        the following properties:
    *                        - {Number} total   The total amount of matches found
    *                        - {Number} current The index of current found range
    *                                           in the document
    */
   onMatchesCountResult: function(result) {
     this._result = result;
 
-    GlobalEventDispatcher.sendRequest(Object.assign({
-      type: "FindInPage:MatchesCountResult",
-    }, this._result));
+    GlobalEventDispatcher.sendRequest(
+      Object.assign(
+        {
+          type: "FindInPage:MatchesCountResult",
+        },
+        this._result
+      )
+    );
   },
 
   /**
    * When a find-in-page action finishes, this method is invoked. This is mainly
    * used at the moment to detect if the current viewport has changed, which might
    * be indicated by not finding a string in the current page.
    *
    * @param {Object} aData A dictionary, representing the find result, which
--- a/mobile/android/chrome/content/Linkify.js
+++ b/mobile/android/chrome/content/Linkify.js
@@ -10,18 +10,20 @@ function Linkifier() {
 }
 
 Linkifier.prototype = {
   _buildAnchor: function(aDoc, aNumberText) {
     let anchorNode = aDoc.createElement("a");
     let cleanedText = "";
     for (let i = 0; i < aNumberText.length; i++) {
       let c = aNumberText.charAt(i);
-      if ((c >= "0" && c <= "9") || c == "+") // assuming there is only the leading '+'.
+      if ((c >= "0" && c <= "9") || c == "+") {
+        // assuming there is only the leading '+'.
         cleanedText += c;
+      }
     }
     anchorNode.setAttribute("href", "tel:" + cleanedText);
     let nodeText = aDoc.createTextNode(aNumberText);
     anchorNode.appendChild(nodeText);
     return anchorNode;
   },
 
   _linkifyNodeNumbers: function(aNodeToProcess, aDoc) {
@@ -30,33 +32,43 @@ Linkifier.prototype = {
 
     // Replacing the original text node with a sequence of
     // |text before number|anchor with number|text after number nodes.
     // Each step a couple of (optional) text node and anchor node are appended.
     let anchorNode = null;
     let m = null;
     let startIndex = 0;
     let prevNode = null;
-    while (m = this._phoneRegex.exec(nodeText)) {
-      anchorNode = this._buildAnchor(aDoc, nodeText.substr(m.index, m[0].length));
+    while ((m = this._phoneRegex.exec(nodeText))) {
+      anchorNode = this._buildAnchor(
+        aDoc,
+        nodeText.substr(m.index, m[0].length)
+      );
 
-      let textExistsBeforeNumber = (m.index > startIndex);
+      let textExistsBeforeNumber = m.index > startIndex;
       let nodeToAdd = null;
-      if (textExistsBeforeNumber)
-        nodeToAdd = aDoc.createTextNode(nodeText.substr(startIndex, m.index - startIndex));
-      else
+      if (textExistsBeforeNumber) {
+        nodeToAdd = aDoc.createTextNode(
+          nodeText.substr(startIndex, m.index - startIndex)
+        );
+      } else {
         nodeToAdd = anchorNode;
+      }
 
-      if (!prevNode) // first time, need to replace the whole node with the first new one.
+      if (!prevNode) {
+        // first time, need to replace the whole node with the first new one.
         parent.replaceChild(nodeToAdd, aNodeToProcess);
-      else
-        parent.insertBefore(nodeToAdd, prevNode.nextSibling); // inserts after.
+      } else {
+        parent.insertBefore(nodeToAdd, prevNode.nextSibling);
+      } // inserts after.
 
-      if (textExistsBeforeNumber) // if we added the text node before the anchor, we still need to add the anchor node.
+      if (textExistsBeforeNumber) {
+        // if we added the text node before the anchor, we still need to add the anchor node.
         parent.insertBefore(anchorNode, nodeToAdd.nextSibling);
+      }
 
       // next nodes need to be appended to this node.
       prevNode = anchorNode;
       startIndex = m.index + m[0].length;
     }
 
     // if some text is remaining after the last anchor.
     if (startIndex > 0 && startIndex < nodeText.length) {
@@ -70,27 +82,35 @@ Linkifier.prototype = {
   linkifyNumbers: function(aDoc) {
     // Removing any installed timer in case the page has changed and a previous timer is still running.
     if (this._linkifyTimer) {
       clearTimeout(this._linkifyTimer);
       this._linkifyTimer = null;
     }
 
     let filterNode = function(node) {
-      if (node.parentNode.tagName != "A" &&
-         node.parentNode.tagName != "SCRIPT" &&
-         node.parentNode.tagName != "NOSCRIPT" &&
-         node.parentNode.tagName != "STYLE" &&
-         node.parentNode.tagName != "APPLET" &&
-         node.parentNode.tagName != "TEXTAREA")
+      if (
+        node.parentNode.tagName != "A" &&
+        node.parentNode.tagName != "SCRIPT" &&
+        node.parentNode.tagName != "NOSCRIPT" &&
+        node.parentNode.tagName != "STYLE" &&
+        node.parentNode.tagName != "APPLET" &&
+        node.parentNode.tagName != "TEXTAREA"
+      ) {
         return NodeFilter.FILTER_ACCEPT;
+      }
       return NodeFilter.FILTER_REJECT;
     };
 
-    let nodeWalker = aDoc.createTreeWalker(aDoc.body, NodeFilter.SHOW_TEXT, filterNode, false);
+    let nodeWalker = aDoc.createTreeWalker(
+      aDoc.body,
+      NodeFilter.SHOW_TEXT,
+      filterNode,
+      false
+    );
     let parseNode = () => {
       let node = nodeWalker.nextNode();
       if (!node) {
         this._linkifyTimer = null;
         return;
       }
       let lastAddedNode = this._linkifyNodeNumbers(node, aDoc);
       // we assign a different timeout whether the node was processed or not.
--- a/mobile/android/chrome/content/MasterPassword.js
+++ b/mobile/android/chrome/content/MasterPassword.js
@@ -1,21 +1,27 @@
 /* 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";
 
-ChromeUtils.defineModuleGetter(this, "Snackbars", "resource://gre/modules/Snackbars.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Snackbars",
+  "resource://gre/modules/Snackbars.jsm"
+);
 
 var MasterPassword = {
   pref: "privacy.masterpassword.enabled",
 
   get _pk11DB() {
     delete this._pk11DB;
-    return this._pk11DB = Cc["@mozilla.org/security/pk11tokendb;1"].getService(Ci.nsIPK11TokenDB);
+    return (this._pk11DB = Cc["@mozilla.org/security/pk11tokendb;1"].getService(
+      Ci.nsIPK11TokenDB
+    ));
   },
 
   get enabled() {
     let token = this._pk11DB.getInternalKeyToken();
     if (token) {
       return token.hasPassword;
     }
     return false;
@@ -42,12 +48,15 @@ var MasterPassword = {
       let token = this._pk11DB.getInternalKeyToken();
       if (token.checkPassword(aOldPassword)) {
         token.changePassword(aOldPassword, "");
         return true;
       }
     } catch (e) {
       dump("MasterPassword.removePassword: " + e + "\n");
     }
-    Snackbars.show(Strings.browser.GetStringFromName("masterPassword.incorrect"), Snackbars.LENGTH_LONG);
+    Snackbars.show(
+      Strings.browser.GetStringFromName("masterPassword.incorrect"),
+      Snackbars.LENGTH_LONG
+    );
     return false;
   },
 };
--- a/mobile/android/chrome/content/MemoryObserver.js
+++ b/mobile/android/chrome/content/MemoryObserver.js
@@ -23,47 +23,67 @@ var MemoryObserver = {
       this.handleEnoughMemory();
     } else if (aTopic == "Memory:Dump") {
       this.dumpMemoryStats(aData);
     }
   },
 
   handleLowMemory: function() {
     // do things to reduce memory usage here
-    if (!Services.prefs.getBoolPref("browser.tabs.disableBackgroundZombification")) {
+    if (
+      !Services.prefs.getBoolPref("browser.tabs.disableBackgroundZombification")
+    ) {
       let tabs = BrowserApp.tabs;
       let selected = BrowserApp.selectedTab;
       for (let i = 0; i < tabs.length; i++) {
         if (tabs[i] != selected && !tabs[i].playingAudio) {
           tabs[i].zombify();
         }
       }
     }
 
     // Change some preferences temporarily for only this session
     let defaults = Services.prefs.getDefaultBranch(null);
 
     // Stop using the bfcache
-    if (!Services.prefs.getBoolPref("browser.sessionhistory.bfcacheIgnoreMemoryPressure")) {
-      this._defaultMaxContentViewers = defaults.getIntPref(MAX_CONTENT_VIEWERS_PREF);
+    if (
+      !Services.prefs.getBoolPref(
+        "browser.sessionhistory.bfcacheIgnoreMemoryPressure"
+      )
+    ) {
+      this._defaultMaxContentViewers = defaults.getIntPref(
+        MAX_CONTENT_VIEWERS_PREF
+      );
       defaults.setIntPref(MAX_CONTENT_VIEWERS_PREF, 0);
     }
   },
 
   handleEnoughMemory: function() {
     // Re-enable the bfcache
     let defaults = Services.prefs.getDefaultBranch(null);
-    if (!Services.prefs.getBoolPref("browser.sessionhistory.bfcacheIgnoreMemoryPressure")) {
-      defaults.setIntPref(MAX_CONTENT_VIEWERS_PREF, this._defaultMaxContentViewers);
+    if (
+      !Services.prefs.getBoolPref(
+        "browser.sessionhistory.bfcacheIgnoreMemoryPressure"
+      )
+    ) {
+      defaults.setIntPref(
+        MAX_CONTENT_VIEWERS_PREF,
+        this._defaultMaxContentViewers
+      );
     }
   },
 
   gc: function() {
     window.windowUtils.garbageCollect();
     Cu.forceGC();
   },
 
   dumpMemoryStats: function(aLabel) {
-    let memDumper = Cc["@mozilla.org/memory-info-dumper;1"].getService(Ci.nsIMemoryInfoDumper);
-    memDumper.dumpMemoryInfoToTempDir(aLabel, /* anonymize = */ false,
-                                      /* minimize = */ false);
+    let memDumper = Cc["@mozilla.org/memory-info-dumper;1"].getService(
+      Ci.nsIMemoryInfoDumper
+    );
+    memDumper.dumpMemoryInfoToTempDir(
+      aLabel,
+      /* anonymize = */ false,
+      /* minimize = */ false
+    );
   },
 };
--- a/mobile/android/chrome/content/OfflineApps.js
+++ b/mobile/android/chrome/content/OfflineApps.js
@@ -1,78 +1,119 @@
 /* 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 OfflineApps = {
   offlineAppRequested: function(aContentWindow) {
-    if (!Services.prefs.getBoolPref("browser.offline-apps.notify"))
+    if (!Services.prefs.getBoolPref("browser.offline-apps.notify")) {
       return;
+    }
 
     let tab = BrowserApp.getTabForWindow(aContentWindow);
     let principal = aContentWindow.document.nodePrincipal;
     let currentURI = aContentWindow.document.documentURIObject;
 
     // Don't bother showing UI if the user has already made a decision
-    if (Services.perms.testExactPermissionFromPrincipal(principal, "offline-app") != Services.perms.UNKNOWN_ACTION)
+    if (
+      Services.perms.testExactPermissionFromPrincipal(
+        principal,
+        "offline-app"
+      ) != Services.perms.UNKNOWN_ACTION
+    ) {
       return;
+    }
 
     try {
       if (Services.prefs.getBoolPref("offline-apps.allow_by_default")) {
         // All pages can use offline capabilities, no need to ask the user
         return;
       }
     } catch (e) {
       // This pref isn't set by default, ignore failures
     }
 
     let host = currentURI.asciiHost;
     let notificationID = "offline-app-requested-" + host;
 
     let strings = Strings.browser;
-    let buttons = [{
-      label: strings.GetStringFromName("offlineApps.dontAllow2"),
-      callback: function(aChecked) {
-        if (aChecked)
-          OfflineApps.disallowSite(aContentWindow.document);
+    let buttons = [
+      {
+        label: strings.GetStringFromName("offlineApps.dontAllow2"),
+        callback: function(aChecked) {
+          if (aChecked) {
+            OfflineApps.disallowSite(aContentWindow.document);
+          }
+        },
+      },
+      {
+        label: strings.GetStringFromName("offlineApps.allow"),
+        callback: function() {
+          OfflineApps.allowSite(aContentWindow.document);
+        },
+        positive: true,
       },
-    },
-    {
-      label: strings.GetStringFromName("offlineApps.allow"),
-      callback: function() {
-        OfflineApps.allowSite(aContentWindow.document);
-      },
-      positive: true,
-    }];
+    ];
 
-    let requestor = BrowserApp.manifest ? "'" + BrowserApp.manifest.name + "'" : host;
+    let requestor = BrowserApp.manifest
+      ? "'" + BrowserApp.manifest.name + "'"
+      : host;
     let message = strings.formatStringFromName("offlineApps.ask", [requestor]);
-    let options = { checkbox: Strings.browser.GetStringFromName("offlineApps.dontAskAgain") };
-    NativeWindow.doorhanger.show(message, notificationID, buttons, tab.id, options);
+    let options = {
+      checkbox: Strings.browser.GetStringFromName("offlineApps.dontAskAgain"),
+    };
+    NativeWindow.doorhanger.show(
+      message,
+      notificationID,
+      buttons,
+      tab.id,
+      options
+    );
   },
 
   allowSite: function(aDocument) {
-    Services.perms.addFromPrincipal(aDocument.nodePrincipal, "offline-app", Services.perms.ALLOW_ACTION);
+    Services.perms.addFromPrincipal(
+      aDocument.nodePrincipal,
+      "offline-app",
+      Services.perms.ALLOW_ACTION
+    );
 
     // When a site is enabled while loading, manifest resources will
     // start fetching immediately.  This one time we need to do it
     // ourselves.
     this._startFetching(aDocument);
   },
 
   disallowSite: function(aDocument) {
-    Services.perms.addFromPrincipal(aDocument.nodePrincipal, "offline-app", Services.perms.DENY_ACTION);
+    Services.perms.addFromPrincipal(
+      aDocument.nodePrincipal,
+      "offline-app",
+      Services.perms.DENY_ACTION
+    );
   },
 
   _startFetching: function(aDocument) {
-    if (!aDocument.documentElement)
+    if (!aDocument.documentElement) {
       return;
+    }
 
     let manifest = aDocument.documentElement.getAttribute("manifest");
-    if (!manifest)
+    if (!manifest) {
       return;
+    }
 
-    let manifestURI = Services.io.newURI(manifest, aDocument.characterSet, aDocument.documentURIObject);
-    let updateService = Cc["@mozilla.org/offlinecacheupdate-service;1"].getService(Ci.nsIOfflineCacheUpdateService);
-    updateService.scheduleUpdate(manifestURI, aDocument.documentURIObject, aDocument.nodePrincipal, window);
+    let manifestURI = Services.io.newURI(
+      manifest,
+      aDocument.characterSet,
+      aDocument.documentURIObject
+    );
+    let updateService = Cc[
+      "@mozilla.org/offlinecacheupdate-service;1"
+    ].getService(Ci.nsIOfflineCacheUpdateService);
+    updateService.scheduleUpdate(
+      manifestURI,
+      aDocument.documentURIObject,
+      aDocument.nodePrincipal,
+      window
+    );
   },
 };
--- a/mobile/android/chrome/content/PermissionsHelper.js
+++ b/mobile/android/chrome/content/PermissionsHelper.js
@@ -1,48 +1,56 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 var PermissionsHelper = {
-  _permissonTypes: ["password", "geolocation", "popup", "indexedDB",
-                    "offline-app", "desktop-notification", "plugins", "native-intent"],
+  _permissonTypes: [
+    "password",
+    "geolocation",
+    "popup",
+    "indexedDB",
+    "offline-app",
+    "desktop-notification",
+    "plugins",
+    "native-intent",
+  ],
   _permissionStrings: {
-    "password": {
+    password: {
       label: "password.logins",
       allowed: "password.save",
       denied: "password.dontSave",
     },
-    "geolocation": {
+    geolocation: {
       label: "geolocation.location",
       allowed: "geolocation.allow",
       denied: "geolocation.dontAllow",
     },
-    "popup": {
+    popup: {
       label: "blockPopups.label2",
       allowed: "popup.show",
       denied: "popup.dontShow",
     },
-    "indexedDB": {
+    indexedDB: {
       label: "offlineApps.offlineData",
       allowed: "offlineApps.allow",
       denied: "offlineApps.dontAllow2",
     },
     "offline-app": {
       label: "offlineApps.offlineData",
       allowed: "offlineApps.allow",
       denied: "offlineApps.dontAllow2",
     },
     "desktop-notification": {
       label: "desktopNotification.notifications",
       allowed: "desktopNotification2.allow",
       denied: "desktopNotification2.dontAllow",
     },
-    "plugins": {
+    plugins: {
       label: "clickToPlayPlugins.plugins",
       allowed: "clickToPlayPlugins.activate",
       denied: "clickToPlayPlugins.dontActivate",
     },
     "native-intent": {
       label: "helperapps.openWithList2",
       allowed: "helperapps.always",
       denied: "helperapps.never",
@@ -51,43 +59,46 @@ var PermissionsHelper = {
 
   onEvent: function onEvent(event, data, callback) {
     let principal = BrowserApp.selectedBrowser.contentPrincipal;
     let check = false;
 
     switch (event) {
       case "Permissions:Check":
         check = true;
-        // fall-through
+      // fall-through
 
       case "Permissions:Get":
         let permissions = [];
         for (let i = 0; i < this._permissonTypes.length; i++) {
           let type = this._permissonTypes[i];
           let value = this.getPermission(principal, type);
 
           // Only add the permission if it was set by the user
-          if (value == Services.perms.UNKNOWN_ACTION)
+          if (value == Services.perms.UNKNOWN_ACTION) {
             continue;
+          }
 
           if (check) {
             GlobalEventDispatcher.sendRequest({
               type: "Permissions:CheckResult",
               hasPermissions: true,
             });
             return;
           }
           // Get the strings that correspond to the permission type
           let typeStrings = this._permissionStrings[type];
           let label = Strings.browser.GetStringFromName(typeStrings.label);
 
           // Get the key to look up the appropriate string entity
-          let valueKey = value == Services.perms.ALLOW_ACTION ?
-                         "allowed" : "denied";
-          let valueString = Strings.browser.GetStringFromName(typeStrings[valueKey]);
+          let valueKey =
+            value == Services.perms.ALLOW_ACTION ? "allowed" : "denied";
+          let valueString = Strings.browser.GetStringFromName(
+            typeStrings[valueKey]
+          );
 
           permissions.push({
             type: type,
             setting: label,
             value: valueString,
           });
         }
 
@@ -106,18 +117,19 @@ var PermissionsHelper = {
           type: "Permissions:Data",
           permissions: permissions,
         });
         break;
 
       case "Permissions:Clear":
         // An array of the indices of the permissions we want to clear
         let permissionsToClear = data.permissions;
-        let privacyContext = BrowserApp.selectedBrowser.docShell
-                               .QueryInterface(Ci.nsILoadContext);
+        let privacyContext = BrowserApp.selectedBrowser.docShell.QueryInterface(
+          Ci.nsILoadContext
+        );
 
         for (let i = 0; i < permissionsToClear.length; i++) {
           let indexToClear = permissionsToClear[i];
           let permissionType = this._currentPermissions[indexToClear].type;
           this.clearPermission(uri, permissionType, privacyContext);
         }
         break;
     }
@@ -133,29 +145,32 @@ var PermissionsHelper = {
    * @return A permission value defined in nsIPermissionManager.
    */
   getPermission: function getPermission(aPrincipal, aType) {
     // Password saving isn't a nsIPermissionManager permission type, so handle
     // it seperately.
     if (aType == "password") {
       // By default, login saving is enabled, so if it is disabled, the
       // user selected the never remember option
-      if (!Services.logins.getLoginSavingEnabled(aURI.displayPrePath))
+      if (!Services.logins.getLoginSavingEnabled(aURI.displayPrePath)) {
         return Services.perms.DENY_ACTION;
+      }
 
       // Check to see if the user ever actually saved a login
-      if (Services.logins.countLogins(aURI.displayPrePath, "", ""))
+      if (Services.logins.countLogins(aURI.displayPrePath, "", "")) {
         return Services.perms.ALLOW_ACTION;
+      }
 
       return Services.perms.UNKNOWN_ACTION;
     }
 
     // Geolocation consumers use testExactPermissionForPrincipal
-    if (aType == "geolocation")
+    if (aType == "geolocation") {
       return Services.perms.testExactPermissionForPrincipal(aPrincipal, aType);
+    }
 
     return Services.perms.testPermissionForPrincipal(aPrincipal, aType);
   },
 
   /**
    * Clears a user-set permission value for the site given a permission type.
    *
    * @param aType
@@ -173,12 +188,16 @@ var PermissionsHelper = {
       }
       // Re-set login saving to enabled
       Services.logins.setLoginSavingEnabled(aURI.displayPrePath, true);
     } else {
       Services.perms.removeFromPrincipal(aPrincipal, aType);
       // Clear content prefs set in ContentPermissionPrompt.js
       Cc["@mozilla.org/content-pref/service;1"]
         .getService(Ci.nsIContentPrefService2)
-        .removeByDomainAndName(aURI.spec, aType + ".request.remember", aContext);
+        .removeByDomainAndName(
+          aURI.spec,
+          aType + ".request.remember",
+          aContext
+        );
     }
   },
 };
--- a/mobile/android/chrome/content/PresentationView.js
+++ b/mobile/android/chrome/content/PresentationView.js
@@ -2,20 +2,21 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 const TOPIC_PRESENTATION_VIEW_READY = "presentation-view-ready";
 const TOPIC_PRESENTATION_RECEIVER_LAUNCH = "presentation-receiver:launch";
-const TOPIC_PRESENTATION_RECEIVER_LAUNCH_RESPONSE = "presentation-receiver:launch:response";
+const TOPIC_PRESENTATION_RECEIVER_LAUNCH_RESPONSE =
+  "presentation-receiver:launch:response";
 
 // globals Services
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function log(str) {
   // dump("-*- PresentationView.js -*-: " + str + "\n");
 }
 
 let PresentationView = {
   _id: null,
 
@@ -42,20 +43,22 @@ let PresentationView = {
     if (this._id != requestData.windowId) {
       return;
     }
 
     let browser = document.getElementById("content");
     browser.setAttribute("mozpresentation", requestData.url);
     try {
       browser.loadURI(requestData.url);
-      Services.obs.notifyObservers(browser,
-                                  TOPIC_PRESENTATION_RECEIVER_LAUNCH_RESPONSE,
-                                  JSON.stringify({ result: "success",
-                                                   requestId: requestData.requestId }));
+      Services.obs.notifyObservers(
+        browser,
+        TOPIC_PRESENTATION_RECEIVER_LAUNCH_RESPONSE,
+        JSON.stringify({ result: "success", requestId: requestData.requestId })
+      );
     } catch (e) {
-      Services.obs.notifyObservers(null,
-                                   TOPIC_PRESENTATION_RECEIVER_LAUNCH_RESPONSE,
-                                   JSON.stringify({ result: "error",
-                                                    reason: e.message }));
+      Services.obs.notifyObservers(
+        null,
+        TOPIC_PRESENTATION_RECEIVER_LAUNCH_RESPONSE,
+        JSON.stringify({ result: "error", reason: e.message })
+      );
     }
   },
 };
--- a/mobile/android/chrome/content/PrintHelper.js
+++ b/mobile/android/chrome/content/PrintHelper.js
@@ -1,59 +1,83 @@
 // -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
 /* 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";
 
-ChromeUtils.defineModuleGetter(this, "Snackbars", "resource://gre/modules/Snackbars.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Snackbars",
+  "resource://gre/modules/Snackbars.jsm"
+);
 
 var PrintHelper = {
   onEvent: function(event, data, callback) {
     let browser = BrowserApp.selectedBrowser;
 
     switch (event) {
       case "Print:PDF":
-        this.generatePDF(browser).then((data) => callback.onSuccess(data),
-                                       (error) => callback.onError(error));
+        this.generatePDF(browser).then(
+          data => callback.onSuccess(data),
+          error => callback.onError(error)
+        );
         break;
     }
   },
 
   generatePDF: function(aBrowser) {
     // Create the final destination file location
-    let fileName = ContentAreaUtils.getDefaultFileName(aBrowser.contentTitle, aBrowser.currentURI, null, null);
+    let fileName = ContentAreaUtils.getDefaultFileName(
+      aBrowser.contentTitle,
+      aBrowser.currentURI,
+      null,
+      null
+    );
     fileName = fileName.trim() + ".pdf";
 
     let file = Services.dirsvc.get("TmpD", Ci.nsIFile);
     file.append(fileName);
     file.createUnique(file.NORMAL_FILE_TYPE, parseInt("666", 8));
 
-    let printSettings = Cc["@mozilla.org/gfx/printsettings-service;1"].getService(Ci.nsIPrintSettingsService).newPrintSettings;
+    let printSettings = Cc[
+      "@mozilla.org/gfx/printsettings-service;1"
+    ].getService(Ci.nsIPrintSettingsService).newPrintSettings;
     printSettings.printSilent = true;
     printSettings.showPrintProgress = false;
     printSettings.printBGImages = false;
     printSettings.printBGColors = false;
     printSettings.printToFile = true;
     printSettings.toFileName = file.path;
     printSettings.outputFormat = Ci.nsIPrintSettings.kOutputFormatPDF;
 
-    let webBrowserPrint = aBrowser.contentWindow.getInterface(Ci.nsIWebBrowserPrint);
+    let webBrowserPrint = aBrowser.contentWindow.getInterface(
+      Ci.nsIWebBrowserPrint
+    );
 
     return new Promise((resolve, reject) => {
       webBrowserPrint.print(printSettings, {
         onStateChange: function(webProgress, request, stateFlags, status) {
           // We get two STATE_START calls, one for STATE_IS_DOCUMENT and one for STATE_IS_NETWORK
-          if (stateFlags & Ci.nsIWebProgressListener.STATE_START && stateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK) {
+          if (
+            stateFlags & Ci.nsIWebProgressListener.STATE_START &&
+            stateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK
+          ) {
             // Let the user know something is happening. Generating the PDF can take some time.
-            Snackbars.show(Strings.browser.GetStringFromName("alertPrintjobToast"), Snackbars.LENGTH_LONG);
+            Snackbars.show(
+              Strings.browser.GetStringFromName("alertPrintjobToast"),
+              Snackbars.LENGTH_LONG
+            );
           }
 
           // We get two STATE_STOP calls, one for STATE_IS_DOCUMENT and one for STATE_IS_NETWORK
-          if (stateFlags & Ci.nsIWebProgressListener.STATE_STOP && stateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK) {
+          if (
+            stateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
+            stateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK
+          ) {
             if (Components.isSuccessCode(status)) {
               // Send the details to Java
               resolve({ file: file.path, title: fileName });
             } else {
               reject();
             }
           }
         },
--- a/mobile/android/chrome/content/Reader.js
+++ b/mobile/android/chrome/content/Reader.js
@@ -1,30 +1,36 @@
 // -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-ChromeUtils.defineModuleGetter(this, "Snackbars", "resource://gre/modules/Snackbars.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Snackbars",
+  "resource://gre/modules/Snackbars.jsm"
+);
 
 /* globals MAX_URI_LENGTH, MAX_TITLE_LENGTH */
 
 var Reader = {
   // These values should match those defined in BrowserContract.java.
   STATUS_UNFETCHED: 0,
   STATUS_FETCH_FAILED_TEMPORARY: 1,
   STATUS_FETCH_FAILED_PERMANENT: 2,
   STATUS_FETCH_FAILED_UNSUPPORTED_FORMAT: 3,
   STATUS_FETCHED_ARTICLE: 4,
 
   get _hasUsedToolbar() {
     delete this._hasUsedToolbar;
-    return this._hasUsedToolbar = Services.prefs.getBoolPref("reader.has_used_toolbar");
+    return (this._hasUsedToolbar = Services.prefs.getBoolPref(
+      "reader.has_used_toolbar"
+    ));
   },
 
   /**
    * BackPressListener (listeners / ReaderView Ids).
    */
   _backPressListeners: [],
   _backPressViewIds: [],
 
@@ -47,96 +53,120 @@ var Reader = {
     }
   },
 
   /**
    * If the requested tab has a backPress listener, return its results, else false.
    */
   onBackPress: function(tabId) {
     let listener = this._backPressListeners[tabId];
-    return { handled: (listener ? listener() : false) };
+    return { handled: listener ? listener() : false };
   },
 
   onEvent: function Reader_onEvent(event, data, callback) {
     switch (event) {
       case "Reader:RemoveFromCache": {
-        ReaderMode.removeArticleFromCache(data.url).catch(e => Cu.reportError("Error removing article from cache: " + e));
+        ReaderMode.removeArticleFromCache(data.url).catch(e =>
+          Cu.reportError("Error removing article from cache: " + e)
+        );
         break;
       }
 
       case "Reader:AddToCache": {
         let tab = BrowserApp.getTabForId(data.tabID);
         if (!tab) {
-          throw new Error("No tab for tabID = " + data.tabID + " when trying to save reader view article");
+          throw new Error(
+            "No tab for tabID = " +
+              data.tabID +
+              " when trying to save reader view article"
+          );
         }
 
         // If the article is coming from reader mode, we must have fetched it already.
-        this._getArticleData(tab.browser).then((article) => {
-          ReaderMode.storeArticleInCache(article);
-        }).catch(e => Cu.reportError("Error storing article in cache: " + e));
+        this._getArticleData(tab.browser)
+          .then(article => {
+            ReaderMode.storeArticleInCache(article);
+          })
+          .catch(e => Cu.reportError("Error storing article in cache: " + e));
         break;
       }
     }
   },
 
   receiveMessage: function(message) {
     switch (message.name) {
       case "Reader:ArticleGet":
-        this._getArticle(message.data.url).then((article) => {
-          // Make sure the target browser is still alive before trying to send data back.
-          if (message.target.messageManager) {
-            message.target.messageManager.sendAsyncMessage("Reader:ArticleData", { article: article });
+        this._getArticle(message.data.url).then(
+          article => {
+            // Make sure the target browser is still alive before trying to send data back.
+            if (message.target.messageManager) {
+              message.target.messageManager.sendAsyncMessage(
+                "Reader:ArticleData",
+                { article: article }
+              );
+            }
+          },
+          e => {
+            if (e && e.newURL) {
+              message.target.loadURI(
+                "about:reader?url=" + encodeURIComponent(e.newURL)
+              );
+            }
           }
-        }, e => {
-          if (e && e.newURL) {
-            message.target.loadURI("about:reader?url=" + encodeURIComponent(e.newURL));
-          }
-        });
+        );
         break;
 
       // On DropdownClosed in ReaderView, we cleanup / clear existing BackPressListener.
       case "Reader:DropdownClosed": {
         this._removeBackPressListener(message.data);
         break;
       }
 
       // On DropdownOpened in ReaderView, we add BackPressListener to handle a subsequent BACK request.
       case "Reader:DropdownOpened": {
         let tabId = BrowserApp.selectedTab.id;
         this._addBackPressListener(tabId, message.data, () => {
           // User hit BACK key while ReaderView has the banner font-dropdown opened.
           // Close it and return prevent-default.
           if (message.target.messageManager) {
-            message.target.messageManager.sendAsyncMessage("Reader:CloseDropdown");
+            message.target.messageManager.sendAsyncMessage(
+              "Reader:CloseDropdown"
+            );
             return true;
           }
           // We can assume ReaderView banner's font-dropdown doesn't need to be closed.
           return false;
         });
 
         break;
       }
 
       case "Reader:FaviconRequest": {
         GlobalEventDispatcher.sendRequestForResult({
           type: "Reader:FaviconRequest",
           url: message.data.url,
         }).then(data => {
-          message.target.messageManager.sendAsyncMessage("Reader:FaviconReturn", data);
+          message.target.messageManager.sendAsyncMessage(
+            "Reader:FaviconReturn",
+            data
+          );
         });
         break;
       }
 
       case "Reader:SystemUIVisibility":
         this._showSystemUI(message.data.visible);
         break;
 
       case "Reader:ToolbarHidden":
         if (!this._hasUsedToolbar) {
-          Snackbars.show(Strings.browser.GetStringFromName("readerMode.toolbarTip"), Snackbars.LENGTH_LONG);
+          Snackbars.show(
+            Strings.browser.GetStringFromName("readerMode.toolbarTip"),
+            Snackbars.LENGTH_LONG
+          );
           Services.prefs.setBoolPref("reader.has_used_toolbar", true);
           this._hasUsedToolbar = true;
         }
         break;
 
       case "Reader:UpdateReaderButton": {
         let tab = BrowserApp.getTabForBrowser(message.target);
         tab.browser.isArticle = message.data.isArticle;
@@ -175,49 +205,57 @@ var Reader = {
         clickCallback: () => this.pageAction.readerModeCallback(browser),
         important: true,
         useTint: useTint,
       });
     };
 
     let browser = tab.browser;
     if (browser.currentURI.spec.startsWith("about:reader")) {
-      showPageAction("drawable://ic_readermode_on", Strings.reader.GetStringFromName("readerView.close"), false);
+      showPageAction(
+        "drawable://ic_readermode_on",
+        Strings.reader.GetStringFromName("readerView.close"),
+        false
+      );
       // Only start a reader session if the viewer is in the foreground. We do
       // not track background reader viewers.
       UITelemetry.startSession("reader.1", null);
       return;
     }
 
     // not in ReaderMode, to make sure System UI is visible, not dimmed.
     this._showSystemUI(true);
 
     // Only stop a reader session if the foreground viewer is not visible.
     UITelemetry.stopSession("reader.1", "", null);
 
     if (browser.isArticle) {
-      showPageAction("drawable://ic_readermode", Strings.reader.GetStringFromName("readerView.enter"), true);
+      showPageAction(
+        "drawable://ic_readermode",
+        Strings.reader.GetStringFromName("readerView.enter"),
+        true
+      );
       UITelemetry.addEvent("show.1", "button", null, "reader_available");
       this._sendMmaEvent("reader_available");
     } else {
       UITelemetry.addEvent("show.1", "button", null, "reader_unavailable");
     }
   },
 
   _sendMmaEvent: function(event) {
-      WindowEventDispatcher.sendRequest({
-          type: "Mma:" + event,
-      });
+    WindowEventDispatcher.sendRequest({
+      type: "Mma:" + event,
+    });
   },
 
   _showSystemUI: function(visibility) {
-      WindowEventDispatcher.sendRequest({
-          type: "SystemUI:Visibility",
-          visible: visibility,
-      });
+    WindowEventDispatcher.sendRequest({
+      type: "SystemUI:Visibility",
+      visible: visibility,
+    });
   },
 
   /**
    * Gets an article for a given URL. This method will download and parse a document
    * if it does not find the article in the cache.
    *
    * @param url The article URL.
    * @return {Promise}
@@ -244,26 +282,25 @@ var Reader = {
 
   _getArticleData: function(browser) {
     return new Promise((resolve, reject) => {
       if (browser == null) {
         reject("_getArticleData needs valid browser");
       }
 
       let mm = browser.messageManager;
-      let listener = (message) => {
+      let listener = message => {
         mm.removeMessageListener("Reader:StoredArticleData", listener);
         resolve(message.data.article);
       };
       mm.addMessageListener("Reader:StoredArticleData", listener);
       mm.sendAsyncMessage("Reader:GetStoredArticleData");
     });
   },
 
-
   /**
    * Migrates old indexedDB reader mode cache to new JSON cache.
    */
   async migrateCache() {
     let cacheDB = await new Promise((resolve, reject) => {
       let request = window.indexedDB.open("about:reader", 1);
       request.onsuccess = event => resolve(event.target.result);
       request.onerror = event => reject(request.error);
--- a/mobile/android/chrome/content/RemoteDebugger.js
+++ b/mobile/android/chrome/content/RemoteDebugger.js
@@ -21,23 +21,23 @@ XPCOMUtils.defineLazyGetter(this, "Socke
 
 var RemoteDebugger = {
   init(aWindow) {
     this._windowType = "navigator:browser";
 
     USBRemoteDebugger.init();
     WiFiRemoteDebugger.init();
 
-    const listener = (event) => {
+    const listener = event => {
       if (event.target !== aWindow) {
         return;
       }
 
-      const newType = (event.type === "activate") ? "navigator:browser"
-                                                  : "navigator:geckoview";
+      const newType =
+        event.type === "activate" ? "navigator:browser" : "navigator:geckoview";
       if (this._windowType === newType) {
         return;
       }
 
       this._windowType = newType;
       if (this.isAnyEnabled) {
         this.initServer();
       }
@@ -78,41 +78,45 @@ var RemoteDebugger = {
       return DebuggerServer.AuthenticationResult.DENY;
     }
 
     if (!session.server.port) {
       this._promptingForAllow = this._promptForUSB(session);
     } else {
       this._promptingForAllow = this._promptForTCP(session);
     }
-    this._promptingForAllow.then(() => this._promptingForAllow = null);
+    this._promptingForAllow.then(() => (this._promptingForAllow = null));
 
     return this._promptingForAllow;
   },
 
   _promptForUSB(session) {
     if (session.authentication !== "PROMPT") {
       // This dialog is not prepared for any other authentication method at
       // this time.
       return DebuggerServer.AuthenticationResult.DENY;
     }
 
     return new Promise(resolve => {
-      let title = Strings.browser.GetStringFromName("remoteIncomingPromptTitle");
+      let title = Strings.browser.GetStringFromName(
+        "remoteIncomingPromptTitle"
+      );
       let msg = Strings.browser.GetStringFromName("remoteIncomingPromptUSB");
-      let allow = Strings.browser.GetStringFromName("remoteIncomingPromptAllow");
+      let allow = Strings.browser.GetStringFromName(
+        "remoteIncomingPromptAllow"
+      );
       let deny = Strings.browser.GetStringFromName("remoteIncomingPromptDeny");
 
       // Make prompt. Note: button order is in reverse.
       let prompt = new Prompt({
         window: null,
         hint: "remotedebug",
         title: title,
         message: msg,
-        buttons: [ allow, deny ],
+        buttons: [allow, deny],
         priority: 1,
       });
 
       prompt.show(data => {
         let result = data.button;
         if (result === 0) {
           resolve(DebuggerServer.AuthenticationResult.ALLOW);
         } else {
@@ -125,32 +129,36 @@ var RemoteDebugger = {
   _promptForTCP(session) {
     if (session.authentication !== "OOB_CERT" || !session.client.cert) {
       // This dialog is not prepared for any other authentication method at
       // this time.
       return DebuggerServer.AuthenticationResult.DENY;
     }
 
     return new Promise(resolve => {
-      let title = Strings.browser.GetStringFromName("remoteIncomingPromptTitle");
-      let msg = Strings.browser.formatStringFromName("remoteIncomingPromptTCP", [
-        session.client.host,
-        session.client.port,
-      ]);
+      let title = Strings.browser.GetStringFromName(
+        "remoteIncomingPromptTitle"
+      );
+      let msg = Strings.browser.formatStringFromName(
+        "remoteIncomingPromptTCP",
+        [session.client.host, session.client.port]
+      );
       let scan = Strings.browser.GetStringFromName("remoteIncomingPromptScan");
-      let scanAndRemember = Strings.browser.GetStringFromName("remoteIncomingPromptScanAndRemember");
+      let scanAndRemember = Strings.browser.GetStringFromName(
+        "remoteIncomingPromptScanAndRemember"
+      );
       let deny = Strings.browser.GetStringFromName("remoteIncomingPromptDeny");
 
       // Make prompt. Note: button order is in reverse.
       let prompt = new Prompt({
         window: null,
         hint: "remotedebug",
         title: title,
         message: msg,
-        buttons: [ scan, scanAndRemember, deny ],
+        buttons: [scan, scanAndRemember, deny],
         priority: 1,
       });
 
       prompt.show(data => {
         let result = data.button;
         if (result === 0) {
           resolve(DebuggerServer.AuthenticationResult.ALLOW);
         } else if (result === 1) {
@@ -177,78 +185,90 @@ var RemoteDebugger = {
    */
   receiveOOB() {
     if (this._receivingOOB) {
       return this._receivingOOB;
     }
 
     this._receivingOOB = WindowEventDispatcher.sendRequestForResult({
       type: "DevToolsAuth:Scan",
-    }).then(data => {
-      return JSON.parse(data);
-    }, () => {
-      let title = Strings.browser.GetStringFromName("remoteQRScanFailedPromptTitle");
-      let msg = Strings.browser.GetStringFromName("remoteQRScanFailedPromptMessage");
-      let ok = Strings.browser.GetStringFromName("remoteQRScanFailedPromptOK");
-      let prompt = new Prompt({
-        window: null,
-        hint: "remotedebug",
-        title: title,
-        message: msg,
-        buttons: [ ok ],
-        priority: 1,
-      });
-      prompt.show();
-    });
+    }).then(
+      data => {
+        return JSON.parse(data);
+      },
+      () => {
+        let title = Strings.browser.GetStringFromName(
+          "remoteQRScanFailedPromptTitle"
+        );
+        let msg = Strings.browser.GetStringFromName(
+          "remoteQRScanFailedPromptMessage"
+        );
+        let ok = Strings.browser.GetStringFromName(
+          "remoteQRScanFailedPromptOK"
+        );
+        let prompt = new Prompt({
+          window: null,
+          hint: "remotedebug",
+          title: title,
+          message: msg,
+          buttons: [ok],
+          priority: 1,
+        });
+        prompt.show();
+      }
+    );
 
-    this._receivingOOB.then(() => this._receivingOOB = null);
+    this._receivingOOB.then(() => (this._receivingOOB = null));
 
     return this._receivingOOB;
   },
 
   initServer: function() {
     DebuggerServer.init();
 
     // Add browser and Fennec specific actors
     DebuggerServer.registerAllActors();
-    const { createRootActor } = require("resource://gre/modules/dbg-browser-actors.js");
+    const {
+      createRootActor,
+    } = require("resource://gre/modules/dbg-browser-actors.js");
     DebuggerServer.setRootActor(createRootActor);
 
     // Allow debugging of chrome for any process
     DebuggerServer.allowChromeProcess = true;
     DebuggerServer.chromeWindowType = this._windowType;
     // Force the Server to stay alive even if there are no connections at the moment.
     DebuggerServer.keepAlive = true;
   },
 };
 
-RemoteDebugger.allowConnection =
-  RemoteDebugger.allowConnection.bind(RemoteDebugger);
-RemoteDebugger.receiveOOB =
-  RemoteDebugger.receiveOOB.bind(RemoteDebugger);
+RemoteDebugger.allowConnection = RemoteDebugger.allowConnection.bind(
+  RemoteDebugger
+);
+RemoteDebugger.receiveOOB = RemoteDebugger.receiveOOB.bind(RemoteDebugger);
 
 var USBRemoteDebugger = {
-
   init() {
     Services.prefs.addObserver("devtools.", this);
 
     if (this.isEnabled) {
       this.start();
     }
   },
 
   observe(subject, topic, data) {
     if (topic != "nsPref:changed") {
       return;
     }
 
     switch (data) {
       case "devtools.remote.usb.enabled":
-        Services.prefs.setBoolPref("devtools.debugger.remote-enabled",
-                                   RemoteDebugger.isAnyEnabled);
+        Services.prefs.setBoolPref(
+          "devtools.debugger.remote-enabled",
+          RemoteDebugger.isAnyEnabled
+        );
         if (this.isEnabled) {
           this.start();
         } else {
           this.stop();
         }
         break;
 
       case "devtools.debugger.remote-port":
@@ -296,43 +316,45 @@ var USBRemoteDebugger = {
 
     try {
       this._listener.close();
       this._listener = null;
     } catch (e) {
       dump("Unable to stop USB debugger server: " + e);
     }
   },
-
 };
 
 var WiFiRemoteDebugger = {
-
   init() {
     Services.prefs.addObserver("devtools.", this);
 
     if (this.isEnabled) {
       this.start();
     }
   },
 
   observe(subject, topic, data) {
     if (topic != "nsPref:changed") {
       return;
     }
 
     switch (data) {
       case "devtools.remote.wifi.enabled":
-        Services.prefs.setBoolPref("devtools.debugger.remote-enabled",
-                                   RemoteDebugger.isAnyEnabled);
+        Services.prefs.setBoolPref(
+          "devtools.debugger.remote-enabled",
+          RemoteDebugger.isAnyEnabled
+        );
         // Allow remote debugging on non-local interfaces when WiFi debug is
         // enabled
         // TODO: Bug 1034411: Lock down to WiFi interface only
-        Services.prefs.setBoolPref("devtools.debugger.force-local",
-                                   !this.isEnabled);
+        Services.prefs.setBoolPref(
+          "devtools.debugger.force-local",
+          !this.isEnabled
+        );
         if (this.isEnabled) {
           this.start();
         } else {
           this.stop();
         }
         break;
     }
   },
@@ -376,10 +398,9 @@ var WiFiRemoteDebugger = {
 
     try {
       this._listener.close();
       this._listener = null;
     } catch (e) {
       dump("Unable to stop WiFi debugger server: " + e);
     }
   },
-
 };
--- a/mobile/android/chrome/content/aboutAccounts.js
+++ b/mobile/android/chrome/content/aboutAccounts.js
@@ -19,29 +19,40 @@
  * WebChannel LOADED messages produced by multiple about:accounts tabs.)
  *
  * We capture error conditions by accessing the inner nsIWebNavigation of the
  * iframe directly.
  */
 
 "use strict";
 
-const {Accounts} = ChromeUtils.import("resource://gre/modules/Accounts.jsm");
-const {PromiseUtils} = ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const { Accounts } = ChromeUtils.import("resource://gre/modules/Accounts.jsm");
+const { PromiseUtils } = ChromeUtils.import(
+  "resource://gre/modules/PromiseUtils.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 
 const ACTION_URL_PARAM = "action";
 
 const COMMAND_LOADED = "fxaccounts:loaded";
 
-const log = ChromeUtils.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.bind("FxAccounts");
+const log = ChromeUtils.import(
+  "resource://gre/modules/AndroidLog.jsm",
+  {}
+).AndroidLog.bind("FxAccounts");
 
-XPCOMUtils.defineLazyServiceGetter(this, "ParentalControls",
-  "@mozilla.org/parental-controls-service;1", "nsIParentalControlsService");
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "ParentalControls",
+  "@mozilla.org/parental-controls-service;1",
+  "nsIParentalControlsService"
+);
 
 // Shows the toplevel element with |id| to be shown - all other top-level
 // elements are hidden.
 // If |id| is 'spinner', then 'remote' is also shown, with opacity 0.
 function show(id) {
   let allTop = document.querySelectorAll(".toplevel");
   for (let elt of allTop) {
     if (elt.getAttribute("id") == id) {
@@ -61,25 +72,26 @@ function show(id) {
 var loadedDeferred = null;
 
 // We have a new load starting.  Replace the existing promise with a new one,
 // and queue up the transition to remote content.
 function deferTransitionToRemoteAfterLoaded() {
   log.d("Waiting for LOADED message.");
 
   loadedDeferred = PromiseUtils.defer();
-  loadedDeferred.promise.then(() => {
-    log.d("Got LOADED message!");
-    document.getElementById("remote").style.opacity = 0;
-    show("remote");
-    document.getElementById("remote").style.opacity = 1;
-  })
-  .catch((e) => {
-    log.w("Did not get LOADED message: " + e.toString());
-  });
+  loadedDeferred.promise
+    .then(() => {
+      log.d("Got LOADED message!");
+      document.getElementById("remote").style.opacity = 0;
+      show("remote");
+      document.getElementById("remote").style.opacity = 1;
+    })
+    .catch(e => {
+      log.w("Did not get LOADED message: " + e.toString());
+    });
 }
 
 function handleLoadedMessage(message) {
   loadedDeferred.resolve();
 }
 
 var wrapper = {
   iframe: null,
@@ -89,51 +101,60 @@ var wrapper = {
   init: function(url) {
     this.url = url;
     deferTransitionToRemoteAfterLoaded();
 
     let iframe = document.getElementById("remote");
     this.iframe = iframe;
     let docShell = this.iframe.frameLoader.docShell;
     docShell.QueryInterface(Ci.nsIWebProgress);
-    docShell.addProgressListener(this.iframeListener,
-                                 Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT |
-                                 Ci.nsIWebProgress.NOTIFY_LOCATION);
+    docShell.addProgressListener(
+      this.iframeListener,
+      Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT |
+        Ci.nsIWebProgress.NOTIFY_LOCATION
+    );
 
     // Set the iframe's location with loadURI/LOAD_FLAGS_BYPASS_HISTORY to
     // avoid having a new history entry being added.
-    let webNav = iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
+    let webNav = iframe.frameLoader.docShell.QueryInterface(
+      Ci.nsIWebNavigation
+    );
     let loadURIOptions = {
       triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
       loadFlags: Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY,
     };
     webNav.loadURI(url, loadURIOptions);
   },
 
   retry: function() {
     deferTransitionToRemoteAfterLoaded();
 
-    let webNav = this.iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
+    let webNav = this.iframe.frameLoader.docShell.QueryInterface(
+      Ci.nsIWebNavigation
+    );
     let loadURIOptions = {
       triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
       loadFlags: Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY,
     };
     webNav.loadURI(this.url, loadURIOptions);
   },
 
   iframeListener: {
-    QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener, Ci.nsISupportsWeakReference]),
+    QueryInterface: ChromeUtils.generateQI([
+      Ci.nsIWebProgressListener,
+      Ci.nsISupportsWeakReference,
+    ]),
 
     onStateChange: function(aWebProgress, aRequest, aState, aStatus) {
       let failure = false;
 
       // Captive portals sometimes redirect users
-      if ((aState & Ci.nsIWebProgressListener.STATE_REDIRECTING)) {
+      if (aState & Ci.nsIWebProgressListener.STATE_REDIRECTING) {
         failure = true;
-      } else if ((aState & Ci.nsIWebProgressListener.STATE_STOP)) {
+      } else if (aState & Ci.nsIWebProgressListener.STATE_STOP) {
         if (aRequest instanceof Ci.nsIHttpChannel) {
           try {
             failure = aRequest.responseStatus != 200;
           } catch (e) {
             failure = aStatus != Cr.NS_OK;
           }
         }
       }
@@ -148,43 +169,47 @@ var wrapper = {
         // from the Promises spec, but it is widely quoted.  Start with
         // http://stackoverflow.com/a/18218542.)
         loadedDeferred.reject(new Error("Failed in onStateChange!"));
         show("networkError");
       }
     },
 
     onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {
-      if (aRequest && aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) {
+      if (
+        aRequest &&
+        aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE
+      ) {
         aRequest.cancel(Cr.NS_BINDING_ABORTED);
         // As above, we're not concerned by multiple listener callbacks.
         loadedDeferred.reject(new Error("Failed in onLocationChange!"));
         show("networkError");
       }
     },
   },
 };
 
-
 function retry() {
   log.i("Retrying.");
   show("spinner");
   wrapper.retry();
 }
 
 function openPrefs() {
   log.i("Opening Sync preferences.");
   // If an Android Account exists, this will open the Status Activity.
   // Otherwise, it will begin the Get Started flow.  This should only be shown
   // when an Account actually exists.
   Accounts.launchSetup();
 }
 
 function getURLForAction(action, urlParams) {
-  let url = Services.urlFormatter.formatURLPref("identity.fxaccounts.remote.webchannel.uri");
+  let url = Services.urlFormatter.formatURLPref(
+    "identity.fxaccounts.remote.webchannel.uri"
+  );
   url = url + (url.endsWith("/") ? "" : "/") + action;
   const CONTEXT = "fx_fennec_v1";
   // The only service managed by Fennec, to date, is Firefox Sync.
   const SERVICE = "sync";
   urlParams = urlParams || new URLSearchParams("");
   urlParams.set("service", SERVICE);
   urlParams.set("context", CONTEXT);
   // Ideally we'd just merge urlParams with new URL(url).searchParams, but our
@@ -207,119 +232,126 @@ function init() {
   // Test for restrictions before getFirefoxAccount(), since that will fail if
   // we are restricted.
   if (!ParentalControls.isAllowed(ParentalControls.MODIFY_ACCOUNTS)) {
     // It's better to log and show an error message than to invite user
     // confusion by removing about:accounts entirely.  That is, if the user is
     // restricted, this way they'll discover as much and may be able to get
     // out of their restricted profile.  If we remove about:accounts entirely,
     // it will look like Fennec is buggy, and the user will be very confused.
-    log.e("This profile cannot connect to Firefox Accounts: showing restricted error.");
+    log.e(
+      "This profile cannot connect to Firefox Accounts: showing restricted error."
+    );
     show("restrictedError");
     return;
   }
 
-  Accounts.getFirefoxAccount().then(user => {
-    // It's possible for the window to start closing before getting the user
-    // completes.  Tests in particular can cause this.
-    if (window.closed) {
-      return;
-    }
-
-    updateDisplayedEmail(user);
-
-    // Ideally we'd use new URL(document.URL).searchParams, but for about: URIs,
-    // searchParams is empty.
-    let urlParams = new URLSearchParams(document.URL.split("?")[1] || "");
-    let action = urlParams.get(ACTION_URL_PARAM);
-    urlParams.delete(ACTION_URL_PARAM);
-
-    switch (action) {
-    case "signup":
-      if (user) {
-        // Asking to sign-up when already signed in just shows prefs.
-        show("prefs");
-      } else {
-        show("spinner");
-        wrapper.init(getURLForAction("signup", urlParams));
-      }
-      break;
-    case "signin":
-      if (user) {
-        // Asking to sign-in when already signed in just shows prefs.
-        show("prefs");
-      } else {
-        show("spinner");
-        wrapper.init(getURLForAction("signin", urlParams));
+  Accounts.getFirefoxAccount()
+    .then(user => {
+      // It's possible for the window to start closing before getting the user
+      // completes.  Tests in particular can cause this.
+      if (window.closed) {
+        return;
       }
-      break;
-    case "force_auth":
-      if (user) {
-        show("spinner");
-        urlParams.set("email", user.email); // In future, pin using the UID.
-        wrapper.init(getURLForAction("force_auth", urlParams));
-      } else {
-        show("spinner");
-        wrapper.init(getURLForAction("signup", urlParams));
-      }
-      break;
-    case "manage":
-      if (user) {
-        show("spinner");
-        urlParams.set("email", user.email); // In future, pin using the UID.
-        wrapper.init(getURLForAction("settings", urlParams));
-      } else {
-        show("spinner");
-        wrapper.init(getURLForAction("signup", urlParams));
+
+      updateDisplayedEmail(user);
+
+      // Ideally we'd use new URL(document.URL).searchParams, but for about: URIs,
+      // searchParams is empty.
+      let urlParams = new URLSearchParams(document.URL.split("?")[1] || "");
+      let action = urlParams.get(ACTION_URL_PARAM);
+      urlParams.delete(ACTION_URL_PARAM);
+
+      switch (action) {
+        case "signup":
+          if (user) {
+            // Asking to sign-up when already signed in just shows prefs.
+            show("prefs");
+          } else {
+            show("spinner");
+            wrapper.init(getURLForAction("signup", urlParams));
+          }
+          break;
+        case "signin":
+          if (user) {
+            // Asking to sign-in when already signed in just shows prefs.
+            show("prefs");
+          } else {
+            show("spinner");
+            wrapper.init(getURLForAction("signin", urlParams));
+          }
+          break;
+        case "force_auth":
+          if (user) {
+            show("spinner");
+            urlParams.set("email", user.email); // In future, pin using the UID.
+            wrapper.init(getURLForAction("force_auth", urlParams));
+          } else {
+            show("spinner");
+            wrapper.init(getURLForAction("signup", urlParams));
+          }
+          break;
+        case "manage":
+          if (user) {
+            show("spinner");
+            urlParams.set("email", user.email); // In future, pin using the UID.
+            wrapper.init(getURLForAction("settings", urlParams));
+          } else {
+            show("spinner");
+            wrapper.init(getURLForAction("signup", urlParams));
+          }
+          break;
+        case "avatar":
+          if (user) {
+            show("spinner");
+            urlParams.set("email", user.email); // In future, pin using the UID.
+            wrapper.init(getURLForAction("settings/avatar/change", urlParams));
+          } else {
+            show("spinner");
+            wrapper.init(getURLForAction("signup", urlParams));
+          }
+          break;
+        default:
+          // Unrecognized or no action specified.
+          if (action) {
+            log.w("Ignoring unrecognized action: " + action);
+          }
+          if (user) {
+            show("prefs");
+          } else {
+            show("spinner");
+            wrapper.init(getURLForAction("signup", urlParams));
+          }
+          break;
       }
-      break;
-    case "avatar":
-      if (user) {
-        show("spinner");
-        urlParams.set("email", user.email); // In future, pin using the UID.
-        wrapper.init(getURLForAction("settings/avatar/change", urlParams));
-      } else {
-        show("spinner");
-        wrapper.init(getURLForAction("signup", urlParams));
-      }
-      break;
-    default:
-      // Unrecognized or no action specified.
-      if (action) {
-        log.w("Ignoring unrecognized action: " + action);
-      }
-      if (user) {
-        show("prefs");
-      } else {
-        show("spinner");
-        wrapper.init(getURLForAction("signup", urlParams));
-      }
-      break;
-    }
-  }).catch(e => {
-    log.e("Failed to get the signed in user: " + e.toString());
-  });
+    })
+    .catch(e => {
+      log.e("Failed to get the signed in user: " + e.toString());
+    });
 }
 
-document.addEventListener("DOMContentLoaded", function() {
-  init();
-  var buttonRetry = document.getElementById("buttonRetry");
-  buttonRetry.addEventListener("click", retry);
+document.addEventListener(
+  "DOMContentLoaded",
+  function() {
+    init();
+    var buttonRetry = document.getElementById("buttonRetry");
+    buttonRetry.addEventListener("click", retry);
 
-  var buttonOpenPrefs = document.getElementById("buttonOpenPrefs");
-  buttonOpenPrefs.addEventListener("click", openPrefs);
-}, {capture: true, once: true});
+    var buttonOpenPrefs = document.getElementById("buttonOpenPrefs");
+    buttonOpenPrefs.addEventListener("click", openPrefs);
+  },
+  { capture: true, once: true }
+);
 
 // This window is contained in a XUL <browser> element.  Return the
 // messageManager of that <browser> element, or null.
 function getBrowserMessageManager() {
-  let browser = window
-        .docShell.rootTreeItem.domWindow
-        .BrowserApp
-        .getBrowserForDocument(document);
+  let browser = window.docShell.rootTreeItem.domWindow.BrowserApp.getBrowserForDocument(
+    document
+  );
   if (browser) {
     return browser.messageManager;
   }
   return null;
 }
 
 // Add a single listener for 'loaded' messages from the iframe in this
 // <browser>.  These 'loaded' messages are ferried from the WebChannel to just
--- a/mobile/android/chrome/content/aboutAddons.js
+++ b/mobile/android/chrome/content/aboutAddons.js
@@ -1,83 +1,119 @@
 /* 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";
 
 /* globals gChromeWin */
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {AddonManager} = ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-const {EventDispatcher} = ChromeUtils.import("resource://gre/modules/Messaging.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { AddonManager } = ChromeUtils.import(
+  "resource://gre/modules/AddonManager.jsm"
+);
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
+const { EventDispatcher } = ChromeUtils.import(
+  "resource://gre/modules/Messaging.jsm"
+);
 
 const AMO_ICON = "chrome://browser/skin/images/amo-logo.png";
 const UPDATE_INDICATOR = "chrome://browser/skin/images/extension-update.svg";
 
-var gStringBundle = Services.strings.createBundle("chrome://browser/locale/aboutAddons.properties");
+var gStringBundle = Services.strings.createBundle(
+  "chrome://browser/locale/aboutAddons.properties"
+);
 
 XPCOMUtils.defineLazyGetter(window, "gChromeWin", function() {
-  return window.docShell.rootTreeItem.domWindow
-           .QueryInterface(Ci.nsIDOMChromeWindow);
+  return window.docShell.rootTreeItem.domWindow.QueryInterface(
+    Ci.nsIDOMChromeWindow
+  );
 });
-ChromeUtils.defineModuleGetter(window, "Preferences",
-                               "resource://gre/modules/Preferences.jsm");
+ChromeUtils.defineModuleGetter(
+  window,
+  "Preferences",
+  "resource://gre/modules/Preferences.jsm"
+);
 
 var ContextMenus = {
   target: null,
 
   init: function() {
     document.addEventListener("contextmenu", this);
 
-    document.getElementById("contextmenu-enable").addEventListener("click", ContextMenus.enable.bind(this));
-    document.getElementById("contextmenu-disable").addEventListener("click", ContextMenus.disable.bind(this));
-    document.getElementById("contextmenu-uninstall").addEventListener("click", ContextMenus.uninstall.bind(this));
+    document
+      .getElementById("contextmenu-enable")
+      .addEventListener("click", ContextMenus.enable.bind(this));
+    document
+      .getElementById("contextmenu-disable")
+      .addEventListener("click", ContextMenus.disable.bind(this));
+    document
+      .getElementById("contextmenu-uninstall")
+      .addEventListener("click", ContextMenus.uninstall.bind(this));
 
     // XXX - Hack to fix bug 985867 for now
-    document.addEventListener("touchstart", function() { });
+    document.addEventListener("touchstart", function() {});
   },
 
   handleEvent: function(event) {
     // store the target of context menu events so that we know which app to act on
     this.target = event.target;
     while (!this.target.hasAttribute("contextmenu")) {
       this.target = this.target.parentNode;
     }
 
     if (!this.target) {
-      document.getElementById("contextmenu-enable").setAttribute("hidden", "true");
-      document.getElementById("contextmenu-disable").setAttribute("hidden", "true");
-      document.getElementById("contextmenu-uninstall").setAttribute("hidden", "true");
+      document
+        .getElementById("contextmenu-enable")
+        .setAttribute("hidden", "true");
+      document
+        .getElementById("contextmenu-disable")
+        .setAttribute("hidden", "true");
+      document
+        .getElementById("contextmenu-uninstall")
+        .setAttribute("hidden", "true");
       return;
     }
 
     let addon = this.target.addon;
     if (addon.scope == AddonManager.SCOPE_APPLICATION) {
-      document.getElementById("contextmenu-uninstall").setAttribute("hidden", "true");
+      document
+        .getElementById("contextmenu-uninstall")
+        .setAttribute("hidden", "true");
     } else {
-      document.getElementById("contextmenu-uninstall").removeAttribute("hidden");
+      document
+        .getElementById("contextmenu-uninstall")
+        .removeAttribute("hidden");
     }
 
     // Hide the enable/disable context menu items if the add-on was disabled by
     // Firefox (e.g. unsigned or blocklisted add-on).
     if (addon.appDisabled) {
-      document.getElementById("contextmenu-enable").setAttribute("hidden", "true");
-      document.getElementById("contextmenu-disable").setAttribute("hidden", "true");
+      document
+        .getElementById("contextmenu-enable")
+        .setAttribute("hidden", "true");
+      document
+        .getElementById("contextmenu-disable")
+        .setAttribute("hidden", "true");
       return;
     }
 
     let enabled = this.target.getAttribute("isDisabled") != "true";
     if (enabled) {
-      document.getElementById("contextmenu-enable").setAttribute("hidden", "true");
+      document
+        .getElementById("contextmenu-enable")
+        .setAttribute("hidden", "true");
       document.getElementById("contextmenu-disable").removeAttribute("hidden");
     } else {
       document.getElementById("contextmenu-enable").removeAttribute("hidden");
-      document.getElementById("contextmenu-disable").setAttribute("hidden", "true");
+      document
+        .getElementById("contextmenu-disable")
+        .setAttribute("hidden", "true");
     }
   },
 
   enable: function(event) {
     Addons.setEnabled(true, this.target.addon);
     this.target = null;
   },
 
@@ -117,17 +153,20 @@ function uninit() {
   AddonManager.removeInstallListener(Addons);
   AddonManager.removeAddonListener(Addons);
 
   Services.obs.removeObserver(sendEMPong, "EM-ping");
 }
 
 function openLink(url) {
   let BrowserApp = gChromeWin.BrowserApp;
-  BrowserApp.addTab(url, { selected: true, parentId: BrowserApp.selectedTab.id });
+  BrowserApp.addTab(url, {
+    selected: true,
+    parentId: BrowserApp.selectedTab.id,
+  });
 }
 
 function openOptionsInTab(url) {
   let BrowserApp = gChromeWin.BrowserApp;
   BrowserApp.selectOrAddTab(url, {
     startsWith: true,
     selected: true,
     parentId: BrowserApp.selectedTab.id,
@@ -168,17 +207,19 @@ function showAddons() {
   // Hide the addon options and show the addons list
   let details = document.querySelector("#addons-details");
   details.classList.add("hidden");
   let list = document.querySelector("#addons-list");
   list.classList.remove("hidden");
   document.documentElement.removeAttribute("details");
 
   // Clean the optionsBox content when switching to the add-ons list view.
-  let optionsBox = document.querySelector("#addons-details > .addon-item .options-box");
+  let optionsBox = document.querySelector(
+    "#addons-details > .addon-item .options-box"
+  );
   optionsBox.innerHTML = "";
 }
 
 function showAddonOptions() {
   // Hide the addon list and show the addon options
   let list = document.querySelector("#addons-list");
   list.classList.add("hidden");
   let details = document.querySelector("#addons-details");
@@ -190,20 +231,24 @@ var Addons = {
   _restartCount: 0,
 
   _createItem: function _createItem(aAddon) {
     let outer = document.createElement("div");
     outer.setAttribute("addonID", aAddon.id);
     outer.className = "addon-item list-item";
     outer.setAttribute("role", "button");
     outer.setAttribute("contextmenu", "addonmenu");
-    outer.addEventListener("click", () => {
-      this.showDetails(outer);
-      history.pushState({ id: aAddon.id }, document.title);
-    }, true);
+    outer.addEventListener(
+      "click",
+      () => {
+        this.showDetails(outer);
+        history.pushState({ id: aAddon.id }, document.title);
+      },
+      true
+    );
 
     let img = document.createElement("img");
     img.className = "icon";
     img.setAttribute("src", aAddon.iconURL || AMO_ICON);
     outer.appendChild(img);
 
     let inner = document.createElement("div");
     inner.className = "inner";
@@ -238,23 +283,31 @@ var Addons = {
 
     return outer;
   },
 
   _createBrowseItem: function _createBrowseItem() {
     let outer = document.createElement("div");
     outer.className = "addon-item list-item";
     outer.setAttribute("role", "button");
-    outer.addEventListener("click", function(event) {
-      try {
-        openLink(Services.urlFormatter.formatURLPref("extensions.getAddons.browseAddons"));
-      } catch (e) {
-        Cu.reportError(e);
-      }
-    }, true);
+    outer.addEventListener(
+      "click",
+      function(event) {
+        try {
+          openLink(
+            Services.urlFormatter.formatURLPref(
+              "extensions.getAddons.browseAddons"
+            )
+          );
+        } catch (e) {
+          Cu.reportError(e);
+        }
+      },
+      true
+    );
 
     let img = document.createElement("img");
     img.className = "icon";
     img.setAttribute("src", AMO_ICON);
     outer.appendChild(img);
 
     let inner = document.createElement("div");
     inner.className = "inner";
@@ -269,29 +322,34 @@ var Addons = {
     return outer;
   },
 
   // Ensure we get a localized string by using the previous title as a fallback
   // if the new one has not yet been translated.
   _getAmoTitle: function _getAmoTitle() {
     const initialTitleUS = "Browse all Firefox Add-ons";
     const updatedTitleUS = "Browse Firefox’s Recommended Extensions";
-    const initialTitleLocalized = gStringBundle.GetStringFromName("addons.browseAll");
-    const updatedTitleLocalized = gStringBundle.GetStringFromName("addons.browseRecommended");
+    const initialTitleLocalized = gStringBundle.GetStringFromName(
+      "addons.browseAll"
+    );
+    const updatedTitleLocalized = gStringBundle.GetStringFromName(
+      "addons.browseRecommended"
+    );
     let title = initialTitleLocalized;
 
     const titleWasLocalized = updatedTitleLocalized !== updatedTitleUS;
-    const localeIsDefaultUS = updatedTitleLocalized === updatedTitleUS &&
-                              initialTitleLocalized === initialTitleUS;
+    const localeIsDefaultUS =
+      updatedTitleLocalized === updatedTitleUS &&
+      initialTitleLocalized === initialTitleUS;
 
     if (titleWasLocalized || localeIsDefaultUS) {
-        title = updatedTitleLocalized;
+      title = updatedTitleLocalized;
     }
 
-    EventDispatcher.instance.dispatch("about:addons", {amoTitle: title} );
+    EventDispatcher.instance.dispatch("about:addons", { amoTitle: title });
     return title;
   },
 
   _createItemForAddon: function _createItemForAddon(aAddon) {
     let opType = this._getOpTypeForOperations(aAddon.pendingOperations);
     let hasUpdate = this._addonHasUpdate(aAddon);
 
     let optionsURL = aAddon.optionsURL || "";
@@ -306,30 +364,34 @@ var Addons = {
         break;
       case Ci.nsIBlocklistService.STATE_OUTDATED:
         blocked = "outdated";
         break;
     }
 
     let item = this._createItem(aAddon);
     item.setAttribute("isDisabled", !aAddon.isActive);
-    item.setAttribute("isUnsigned", aAddon.signedState <= AddonManager.SIGNEDSTATE_MISSING);
+    item.setAttribute(
+      "isUnsigned",
+      aAddon.signedState <= AddonManager.SIGNEDSTATE_MISSING
+    );
     item.setAttribute("opType", opType);
-    if (blocked)
+    if (blocked) {
       item.setAttribute("blockedStatus", blocked);
+    }
     item.setAttribute("optionsURL", optionsURL);
     item.setAttribute("hasUpdate", hasUpdate);
     item.addon = aAddon;
 
     return item;
   },
 
   _getElementForAddon: function(aKey) {
     let list = document.getElementById("addons-list");
-    let element = list.querySelector("div[addonID=\"" + CSS.escape(aKey) + "\"]");
+    let element = list.querySelector('div[addonID="' + CSS.escape(aKey) + '"]');
     return element;
   },
 
   _addonHasUpdate(addon) {
     return gChromeWin.ExtensionPermissions.updates.has(addon.id);
   },
 
   init: async function init() {
@@ -340,64 +402,88 @@ var Addons = {
     list.innerHTML = "";
 
     aAddons.sort(function(a, b) {
       return a.name.localeCompare(b.name);
     });
 
     for (let i = 0; i < aAddons.length; i++) {
       // Don't create item for system add-ons.
-      if (aAddons[i].isSystem)
+      if (aAddons[i].isSystem) {
         continue;
+      }
 
       let item = this._createItemForAddon(aAddons[i]);
       list.appendChild(item);
     }
 
     // Add a "Browse all Firefox Add-ons" item to the bottom of the list.
     let browseItem = this._createBrowseItem();
     list.appendChild(browseItem);
 
-    document.getElementById("update-btn").addEventListener("click", Addons.updateCurrent.bind(this));
-    document.getElementById("uninstall-btn").addEventListener("click", Addons.uninstallCurrent.bind(this));
-    document.getElementById("cancel-btn").addEventListener("click", Addons.cancelUninstall.bind(this));
-    document.getElementById("disable-btn").addEventListener("click", Addons.disable.bind(this));
-    document.getElementById("enable-btn").addEventListener("click", Addons.enable.bind(this));
+    document
+      .getElementById("update-btn")
+      .addEventListener("click", Addons.updateCurrent.bind(this));
+    document
+      .getElementById("uninstall-btn")
+      .addEventListener("click", Addons.uninstallCurrent.bind(this));
+    document
+      .getElementById("cancel-btn")
+      .addEventListener("click", Addons.cancelUninstall.bind(this));
+    document
+      .getElementById("disable-btn")
+      .addEventListener("click", Addons.disable.bind(this));
+    document
+      .getElementById("enable-btn")
+      .addEventListener("click", Addons.enable.bind(this));
 
-    document.getElementById("unsigned-learn-more").addEventListener("click", function() {
-      openLink(Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons");
-    });
+    document
+      .getElementById("unsigned-learn-more")
+      .addEventListener("click", function() {
+        openLink(
+          Services.urlFormatter.formatURLPref("app.support.baseURL") +
+            "unsigned-addons"
+        );
+      });
   },
 
   _getOpTypeForOperations: function _getOpTypeForOperations(aOperations) {
-    if (aOperations & AddonManager.PENDING_UNINSTALL)
+    if (aOperations & AddonManager.PENDING_UNINSTALL) {
       return "needs-uninstall";
-    if (aOperations & AddonManager.PENDING_ENABLE)
+    }
+    if (aOperations & AddonManager.PENDING_ENABLE) {
       return "needs-enable";
-    if (aOperations & AddonManager.PENDING_DISABLE)
+    }
+    if (aOperations & AddonManager.PENDING_DISABLE) {
       return "needs-disable";
+    }
     return "";
   },
 
   showDetails: function showDetails(aListItem) {
     let detailItem = document.querySelector("#addons-details > .addon-item");
     detailItem.setAttribute("isDisabled", aListItem.getAttribute("isDisabled"));
     detailItem.setAttribute("isUnsigned", aListItem.getAttribute("isUnsigned"));
     detailItem.setAttribute("opType", aListItem.getAttribute("opType"));
     detailItem.setAttribute("optionsURL", aListItem.getAttribute("optionsURL"));
-    let addon = detailItem.addon = aListItem.addon;
+    let addon = (detailItem.addon = aListItem.addon);
 
     let favicon = document.querySelector("#addons-details > .addon-item .icon");
     favicon.setAttribute("src", addon.iconURL || AMO_ICON);
 
     detailItem.querySelector(".title").textContent = addon.name;
     detailItem.querySelector(".version").textContent = addon.version;
-    detailItem.querySelector(".description-full").textContent = addon.description;
-    detailItem.querySelector(".status-uninstalled").textContent =
-      gStringBundle.formatStringFromName("addonStatus.uninstalled", [addon.name]);
+    detailItem.querySelector(".description-full").textContent =
+      addon.description;
+    detailItem.querySelector(
+      ".status-uninstalled"
+    ).textContent = gStringBundle.formatStringFromName(
+      "addonStatus.uninstalled",
+      [addon.name]
+    );
 
     let updateBtn = document.getElementById("update-btn");
     if (this._addonHasUpdate(addon)) {
       updateBtn.removeAttribute("hidden");
     } else {
       updateBtn.setAttribute("hidden", true);
     }
 
@@ -463,61 +549,66 @@ var Addons = {
 
     button.onclick = async () => {
       if (addon.isWebExtension) {
         // WebExtensions are loaded asynchronously and the optionsURL
         // may not be available until the addon has been started.
         await addon.startupPromise;
       }
 
-      const {optionsURL} = addon;
+      const { optionsURL } = addon;
       openOptionsInTab(optionsURL);
     };
 
     // Ensure that the Addon Options are visible (the options box will be hidden if the optionsURL
     // attribute is an empty string, which happens when a WebExtensions is still loading).
     detailItem.removeAttribute("optionsURL");
   },
 
   createWebExtensionOptions: async function(destination, addon, detailItem) {
     // WebExtensions are loaded asynchronously and the optionsURL
     // may not be available until the addon has been started.
     await addon.startupPromise;
 
-    const {optionsURL, optionsBrowserStyle} = addon;
+    const { optionsURL, optionsBrowserStyle } = addon;
     let frame = destination.querySelector("iframe#addon-options");
 
     if (!frame) {
       let originalHeight;
       frame = document.createElement("iframe");
       frame.setAttribute("id", "addon-options");
       frame.setAttribute("mozbrowser", "true");
       frame.setAttribute("style", "width: 100%; overflow: hidden;");
 
       // Adjust iframe height to the iframe content (also between navigation of multiple options
       // files).
-      frame.onload = (evt) => {
+      frame.onload = evt => {
         if (evt.target !== frame) {
           return;
         }
 
-        const {document} = frame.contentWindow;
+        const { document } = frame.contentWindow;
         const bodyScrollHeight = document.body && document.body.scrollHeight;
         const documentScrollHeight = document.documentElement.scrollHeight;
 
         // Set the iframe height to the maximum between the body and the document
         // scrollHeight values.
-        frame.style.height = Math.max(bodyScrollHeight, documentScrollHeight) + "px";
+        frame.style.height =
+          Math.max(bodyScrollHeight, documentScrollHeight) + "px";
 
         // Restore the original iframe height between option page loads,
         // so that we don't force the new document to have the same size
         // of the previosuly loaded option page.
-        frame.contentWindow.addEventListener("unload", () => {
-          frame.style.height = originalHeight + "px";
-        }, {once: true});
+        frame.contentWindow.addEventListener(
+          "unload",
+          () => {
+            frame.style.height = originalHeight + "px";
+          },
+          { once: true }
+        );
       };
 
       destination.appendChild(frame);
       originalHeight = frame.getBoundingClientRect().height;
     }
 
     // Loading the URL this way prevents the native back
     // button from applying to the iframe.
@@ -526,18 +617,19 @@ var Addons = {
     // Ensure that the Addon Options are visible (the options box will be hidden if the optionsURL
     // attribute is an empty string, which happens when a WebExtensions is still loading).
     detailItem.removeAttribute("optionsURL");
   },
 
   setEnabled: function setEnabled(aValue, aAddon) {
     let detailItem = document.querySelector("#addons-details > .addon-item");
     let addon = aAddon || detailItem.addon;
-    if (!addon)
+    if (!addon) {
       return;
+    }
 
     let listItem = this._getElementForAddon(addon.id);
 
     function setDisabled(addon, value) {
       if (value) {
         return addon.disable();
       }
       return addon.enable();
@@ -545,102 +637,114 @@ var Addons = {
 
     function updateOtherThemeStateInUI(item) {
       if (aValue) {
         // Mark the previously enabled theme as disabled.
         if (item.addon.isActive) {
           item.setAttribute("isDisabled", true);
           return true;
         }
-      // The current theme is being disabled - enable the default theme.
+        // The current theme is being disabled - enable the default theme.
       } else if (item.addon.id == "default-theme@mozilla.org") {
         item.removeAttribute("isDisabled");
         return true;
       }
       return false;
     }
 
     let opType;
     if (addon.type == "theme") {
       // Themes take care of themselves to make sure only one is active at the
       // same time, but we need to fix up the state of other themes in the UI.
       let list = document.getElementById("addons-list");
       let item = list.firstElementChild;
       while (item) {
-        if (item.addon && (item.addon.type == "theme") &&
-            updateOtherThemeStateInUI(item)) {
+        if (
+          item.addon &&
+          item.addon.type == "theme" &&
+          updateOtherThemeStateInUI(item)
+        ) {
           break;
         }
         item = item.nextSibling;
       }
       setDisabled(addon, !aValue);
     } else if (addon.type == "locale") {
       setDisabled(addon, !aValue);
     } else {
       setDisabled(addon, !aValue);
       opType = this._getOpTypeForOperations(addon.pendingOperations);
 
-      if ((addon.pendingOperations & AddonManager.PENDING_ENABLE) ||
-          (addon.pendingOperations & AddonManager.PENDING_DISABLE)) {
+      if (
+        addon.pendingOperations & AddonManager.PENDING_ENABLE ||
+        addon.pendingOperations & AddonManager.PENDING_DISABLE
+      ) {
         this.showRestart();
-      } else if (listItem && /needs-(enable|disable)/.test(listItem.getAttribute("opType"))) {
+      } else if (
+        listItem &&
+        /needs-(enable|disable)/.test(listItem.getAttribute("opType"))
+      ) {
         this.hideRestart();
       }
     }
 
     if (addon == detailItem.addon) {
       detailItem.setAttribute("isDisabled", !aValue);
-      if (opType)
+      if (opType) {
         detailItem.setAttribute("opType", opType);
-      else
+      } else {
         detailItem.removeAttribute("opType");
+      }
 
       // Remove any addon options iframe if the currently selected addon has been disabled.
       if (!aValue) {
         const addonOptionsIframe = document.querySelector("#addon-options");
         if (addonOptionsIframe) {
           addonOptionsIframe.remove();
         }
       }
     }
 
     // Sync to the list item
     if (listItem) {
       listItem.setAttribute("isDisabled", !aValue);
-      if (opType)
+      if (opType) {
         listItem.setAttribute("opType", opType);
-      else
+      } else {
         listItem.removeAttribute("opType");
+      }
     }
   },
 
   enable: function enable() {
     this.setEnabled(true);
   },
 
   disable: function disable() {
     this.setEnabled(false);
   },
 
   updateCurrent() {
     let detailItem = document.querySelector("#addons-details > .addon-item");
 
     let addon = detailItem.addon;
-    if (!addon)
+    if (!addon) {
       return;
+    }
 
     gChromeWin.ExtensionPermissions.applyUpdate(addon.id);
   },
 
   uninstallCurrent: function uninstallCurrent() {
     let detailItem = document.querySelector("#addons-details > .addon-item");
 
     let addon = detailItem.addon;
-    if (!addon)
+    if (!addon) {
       return;
+    }
 
     this.uninstall(addon);
   },
 
   uninstall: function uninstall(aAddon) {
     if (!aAddon) {
       return;
     }
@@ -649,29 +753,31 @@ var Addons = {
     aAddon.uninstall();
 
     if (aAddon.pendingOperations & AddonManager.PENDING_UNINSTALL) {
       this.showRestart();
 
       // A disabled addon doesn't need a restart so it has no pending ops and
       // can't be cancelled
       let opType = this._getOpTypeForOperations(aAddon.pendingOperations);
-      if (!aAddon.isActive && opType == "")
+      if (!aAddon.isActive && opType == "") {
         opType = "needs-uninstall";
+      }
 
       detailItem.setAttribute("opType", opType);
       listItem.setAttribute("opType", opType);
     }
   },
 
   cancelUninstall: function ev_cancelUninstall() {
     let detailItem = document.querySelector("#addons-details > .addon-item");
     let addon = detailItem.addon;
-    if (!addon)
+    if (!addon) {
       return;
+    }
 
     addon.cancelUninstall();
     this.hideRestart();
 
     let opType = this._getOpTypeForOperations(addon.pendingOperations);
     detailItem.setAttribute("opType", opType);
 
     let listItem = this._getElementForAddon(addon.id);
@@ -680,48 +786,56 @@ var Addons = {
 
   showRestart: function showRestart() {
     this._restartCount++;
     gChromeWin.XPInstallObserver.showRestartPrompt();
   },
 
   hideRestart: function hideRestart() {
     this._restartCount--;
-    if (this._restartCount == 0)
+    if (this._restartCount == 0) {
       gChromeWin.XPInstallObserver.hideRestartPrompt();
+    }
   },
 
   onEnabled: function(aAddon) {
     let listItem = this._getElementForAddon(aAddon.id);
-    if (!listItem)
+    if (!listItem) {
       return;
+    }
 
     // Reload the details to pick up any options now that it's enabled.
     listItem.setAttribute("optionsURL", aAddon.optionsURL || "");
     let detailItem = document.querySelector("#addons-details > .addon-item");
-    if (aAddon == detailItem.addon)
+    if (aAddon == detailItem.addon) {
       this.showDetails(listItem);
+    }
   },
 
   onInstallEnded: function(aInstall, aAddon) {
     let needsRestart = false;
-    if (aInstall.existingAddon && (aInstall.existingAddon.pendingOperations & AddonManager.PENDING_UPGRADE))
+    if (
+      aInstall.existingAddon &&
+      aInstall.existingAddon.pendingOperations & AddonManager.PENDING_UPGRADE
+    ) {
       needsRestart = true;
-    else if (aAddon.pendingOperations & AddonManager.PENDING_INSTALL)
+    } else if (aAddon.pendingOperations & AddonManager.PENDING_INSTALL) {
       needsRestart = true;
+    }
 
     let list = document.getElementById("addons-list");
     let element = this._getElementForAddon(aAddon.id);
     if (!element) {
       element = this._createItemForAddon(aAddon);
       list.insertBefore(element, list.firstElementChild);
     }
 
-    if (needsRestart)
+    if (needsRestart) {
       element.setAttribute("opType", "needs-restart");
+    }
   },
 
   onInstalled: function(aAddon) {
     let list = document.getElementById("addons-list");
     let element = this._getElementForAddon(aAddon.id);
     if (element) {
       // Upgrade of an existing addon, update version and description in
       // list item and detail view, plus indicators about a pending update.
@@ -733,26 +847,27 @@ var Addons = {
       }
 
       element.setAttribute("hasUpdate", false);
       document.getElementById("update-btn").setAttribute("hidden", true);
 
       element = document.querySelector("#addons-details > .addon-item");
       if (element.addon && element.addon.id == aAddon.id) {
         element.querySelector(".version").textContent = aAddon.version;
-        element.querySelector(".description-full").textContent = aAddon.description;
+        element.querySelector(".description-full").textContent =
+          aAddon.description;
       }
     } else {
       element = this._createItemForAddon(aAddon);
 
       // Themes aren't considered active on install, so set existing as disabled, and new one enabled.
       if (aAddon.type == "theme") {
         let item = list.firstElementChild;
         while (item) {
-          if (item.addon && (item.addon.type == "theme")) {
+          if (item.addon && item.addon.type == "theme") {
             item.setAttribute("isDisabled", true);
           }
           item = item.nextSibling;
         }
         element.setAttribute("isDisabled", false);
       }
 
       list.insertBefore(element, list.firstElementChild);
@@ -766,23 +881,19 @@ var Addons = {
 
     // Go back if we're in the detail view of the add-on that was uninstalled.
     let detailItem = document.querySelector("#addons-details > .addon-item");
     if (detailItem.addon.id == aAddon.id) {
       history.back();
     }
   },
 
-  onInstallFailed: function(aInstall) {
-  },
+  onInstallFailed: function(aInstall) {},
 
-  onDownloadProgress: function xpidm_onDownloadProgress(aInstall) {
-  },
+  onDownloadProgress: function xpidm_onDownloadProgress(aInstall) {},
 
-  onDownloadFailed: function(aInstall) {
-  },
+  onDownloadFailed: function(aInstall) {},
 
-  onDownloadCancelled: function(aInstall) {
-  },
+  onDownloadCancelled: function(aInstall) {},
 };
 
 window.addEventListener("load", init);
 window.addEventListener("unload", uninit);
--- a/mobile/android/chrome/content/aboutDownloads.js
+++ b/mobile/android/chrome/content/aboutDownloads.js
@@ -1,77 +1,118 @@
 /* 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";
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm", this);
 
-ChromeUtils.defineModuleGetter(this, "Downloads", "resource://gre/modules/Downloads.jsm");
-ChromeUtils.defineModuleGetter(this, "DownloadUtils", "resource://gre/modules/DownloadUtils.jsm");
-ChromeUtils.defineModuleGetter(this, "EventDispatcher", "resource://gre/modules/Messaging.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Downloads",
+  "resource://gre/modules/Downloads.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "DownloadUtils",
+  "resource://gre/modules/DownloadUtils.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "EventDispatcher",
+  "resource://gre/modules/Messaging.jsm"
+);
 ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
-ChromeUtils.defineModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm");
-ChromeUtils.defineModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PluralForm",
+  "resource://gre/modules/PluralForm.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "Services",
+  "resource://gre/modules/Services.jsm"
+);
 
-var gStrings = Services.strings.createBundle("chrome://browser/locale/aboutDownloads.properties");
-XPCOMUtils.defineLazyGetter(this, "strings",
-                            () => Services.strings.createBundle("chrome://browser/locale/aboutDownloads.properties"));
+var gStrings = Services.strings.createBundle(
+  "chrome://browser/locale/aboutDownloads.properties"
+);
+XPCOMUtils.defineLazyGetter(this, "strings", () =>
+  Services.strings.createBundle(
+    "chrome://browser/locale/aboutDownloads.properties"
+  )
+);
 
 function deleteDownload(download) {
   download.finalize(true).catch(Cu.reportError);
   OS.File.remove(download.target.path).catch(ex => {
     if (!(ex instanceof OS.File.Error && ex.becauseNoSuchFile)) {
       Cu.reportError(ex);
     }
   });
 }
 
 var contextMenu = {
   _items: [],
   _targetDownload: null,
 
   init: function() {
     let element = document.getElementById("downloadmenu");
-    element.addEventListener("click",
-                             event => event.download = this._targetDownload,
-                             true);
+    element.addEventListener(
+      "click",
+      event => (event.download = this._targetDownload),
+      true
+    );
     this._items = [
-      new ContextMenuItem("open",
-                          download => download.succeeded,
-                          download => download.launch().catch(Cu.reportError)),
-      new ContextMenuItem("retry",
-                          download => download.error ||
-                                      (download.canceled && !download.hasPartialData),
-                          download => download.start().catch(Cu.reportError)),
-      new ContextMenuItem("remove",
-                          download => download.stopped,
-                          download => {
-                            Downloads.getList(Downloads.ALL)
-                                     .then(list => list.remove(download))
-                                     .catch(Cu.reportError);
-                            deleteDownload(download);
-                          }),
-      new ContextMenuItem("pause",
-                          download => !download.stopped && download.hasPartialData,
-                          download => download.cancel().catch(Cu.reportError)),
-      new ContextMenuItem("resume",
-                          download => download.canceled && download.hasPartialData,
-                          download => download.start().catch(Cu.reportError)),
-      new ContextMenuItem("cancel",
-                          download => !download.stopped ||
-                                      (download.canceled && download.hasPartialData),
-                          download => {
-                            download.cancel().catch(Cu.reportError);
-                            download.removePartialData().catch(Cu.reportError);
-                          }),
+      new ContextMenuItem(
+        "open",
+        download => download.succeeded,
+        download => download.launch().catch(Cu.reportError)
+      ),
+      new ContextMenuItem(
+        "retry",
+        download =>
+          download.error || (download.canceled && !download.hasPartialData),
+        download => download.start().catch(Cu.reportError)
+      ),
+      new ContextMenuItem(
+        "remove",
+        download => download.stopped,
+        download => {
+          Downloads.getList(Downloads.ALL)
+            .then(list => list.remove(download))
+            .catch(Cu.reportError);
+          deleteDownload(download);
+        }
+      ),
+      new ContextMenuItem(
+        "pause",
+        download => !download.stopped && download.hasPartialData,
+        download => download.cancel().catch(Cu.reportError)
+      ),
+      new ContextMenuItem(
+        "resume",
+        download => download.canceled && download.hasPartialData,
+        download => download.start().catch(Cu.reportError)
+      ),
+      new ContextMenuItem(
+        "cancel",
+        download =>
+          !download.stopped || (download.canceled && download.hasPartialData),
+        download => {
+          download.cancel().catch(Cu.reportError);
+          download.removePartialData().catch(Cu.reportError);
+        }
+      ),
       // following menu item is a global action
-      new ContextMenuItem("removeall",
-                          () => downloadLists.finished.length > 0,
-                          () => downloadLists.removeFinished()),
+      new ContextMenuItem(
+        "removeall",
+        () => downloadLists.finished.length > 0,
+        () => downloadLists.removeFinished()
+      ),
     ];
   },
 
   addContextMenuEventListener: function(element) {
     element.addEventListener("contextmenu", this.onContextMenu.bind(this));
   },
 
   onContextMenu: function(event) {
@@ -108,23 +149,23 @@ ContextMenuItem.prototype = {
 
 function DownloadListView(type, listElementId) {
   this.listElement = document.getElementById(listElementId);
   contextMenu.addContextMenuEventListener(this.listElement);
 
   this.items = new Map();
 
   Downloads.getList(type)
-           .then(list => list.addView(this))
-           .catch(Cu.reportError);
+    .then(list => list.addView(this))
+    .catch(Cu.reportError);
 
   window.addEventListener("unload", event => {
     Downloads.getList(type)
-             .then(list => list.removeView(this))
-             .catch(Cu.reportError);
+      .then(list => list.removeView(this))
+      .catch(Cu.reportError);
   });
 }
 
 DownloadListView.prototype = {
   get finished() {
     let finished = [];
     for (let download of this.items.keys()) {
       if (download.stopped && (!download.hasPartialData || download.error)) {
@@ -141,17 +182,20 @@ DownloadListView.prototype = {
       if (a.stopped != b.stopped) {
         return b.stopped ? -1 : 1;
       }
       // most recent downloads first
       return b.startTime - a.startTime;
     };
 
     let insertLocation = this.listElement.firstChild;
-    while (insertLocation && compare(item.download, insertLocation.download) > 0) {
+    while (
+      insertLocation &&
+      compare(item.download, insertLocation.download) > 0
+    ) {
       insertLocation = insertLocation.nextElementSibling;
     }
     this.listElement.insertBefore(item.element, insertLocation);
   },
 
   onDownloadAdded: function(download) {
     let item = new DownloadItem(download);
     this.items.set(download, item);
@@ -186,54 +230,64 @@ DownloadListView.prototype = {
       type: "Download:Remove",
       path: download.target.path,
     });
   },
 };
 
 var downloadLists = {
   init: function() {
-    this.publicDownloads = new DownloadListView(Downloads.PUBLIC, "public-downloads-list");
-    this.privateDownloads = new DownloadListView(Downloads.PRIVATE, "private-downloads-list");
+    this.publicDownloads = new DownloadListView(
+      Downloads.PUBLIC,
+      "public-downloads-list"
+    );
+    this.privateDownloads = new DownloadListView(
+      Downloads.PRIVATE,
+      "private-downloads-list"
+    );
   },
 
   get finished() {
     return this.publicDownloads.finished.concat(this.privateDownloads.finished);
   },
 
   removeFinished: function() {
     let finished = this.finished;
     if (finished.length == 0) {
       return;
     }
 
     let title = strings.GetStringFromName("downloadAction.deleteAll");
     let messageForm = strings.GetStringFromName("downloadMessage.deleteAll");
-    let message = PluralForm.get(finished.length, messageForm).replace("#1", finished.length);
+    let message = PluralForm.get(finished.length, messageForm).replace(
+      "#1",
+      finished.length
+    );
 
     if (Services.prompt.confirm(null, title, message)) {
-      Downloads.getList(Downloads.ALL)
-               .then(list => {
-                 for (let download of finished) {
-                   list.remove(download).catch(Cu.reportError);
-                   deleteDownload(download);
-                 }
-               }, Cu.reportError);
+      Downloads.getList(Downloads.ALL).then(list => {
+        for (let download of finished) {
+          list.remove(download).catch(Cu.reportError);
+          deleteDownload(download);
+        }
+      }, Cu.reportError);
     }
   },
 };
 
 function DownloadItem(download) {
   this._download = download;
   this._updateFromDownload();
 
   this._domain = DownloadUtils.getURIHost(download.source.url)[0];
   this._fileName = this._htmlEscape(OS.Path.basename(download.target.path));
   this._iconUrl = "moz-icon://" + this._fileName + "?size=64";
-  this._startDate = this._htmlEscape(DownloadUtils.getReadableDates(download.startTime)[0]);
+  this._startDate = this._htmlEscape(
+    DownloadUtils.getReadableDates(download.startTime)[0]
+  );
 
   this._element = this.createElement();
 }
 
 const kDownloadStatePropertyNames = [
   "stopped",
   "succeeded",
   "canceled",
@@ -249,24 +303,26 @@ DownloadItem.prototype = {
     s = s.replace(/"/g, "&quot;");
     s = s.replace(/'/g, "&apos;");
     return s;
   },
 
   _updateFromDownload: function() {
     this._state = {};
     kDownloadStatePropertyNames.forEach(
-      name => this._state[name] = this._download[name],
-      this);
+      name => (this._state[name] = this._download[name]),
+      this
+    );
   },
 
   get stateChanged() {
     return kDownloadStatePropertyNames.some(
       name => this._state[name] != this._download[name],
-      this);
+      this
+    );
   },
 
   get download() {
     return this._download;
   },
   get element() {
     return this._element;
   },
@@ -361,11 +417,11 @@ DownloadItem.prototype = {
     if (name) {
       return strings.GetStringFromName(name);
     }
     return "";
   },
 };
 
 window.addEventListener("DOMContentLoaded", event => {
-    contextMenu.init();
-    downloadLists.init();
+  contextMenu.init();
+  downloadLists.init();
 });
--- a/mobile/android/chrome/content/aboutExperiments.js
+++ b/mobile/android/chrome/content/aboutExperiments.js
@@ -1,49 +1,59 @@
 /* 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";
 
-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"
+);
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AndroidLog: "resource://gre/modules/AndroidLog.jsm",
   EventDispatcher: "resource://gre/modules/Messaging.jsm",
 });
 
 const LOGTAG = "Experiments";
-const EXPERIMENTS_CONFIGURATION = "https://firefox.settings.services.mozilla.com/v1/buckets/fennec/collections/experiments/records";
-const Experiments = Services.wm.getMostRecentWindow("navigator:browser").Experiments;
+const EXPERIMENTS_CONFIGURATION =
+  "https://firefox.settings.services.mozilla.com/v1/buckets/fennec/collections/experiments/records";
+const Experiments = Services.wm.getMostRecentWindow("navigator:browser")
+  .Experiments;
 
 document.addEventListener("DOMContentLoaded", initList);
 
 function log(msg) {
   AndroidLog.d(LOGTAG, msg);
 }
 
 function initList() {
   const list = document.getElementById("list");
   list.addEventListener("click", toggleOverride);
 
-  Promise.all([promiseEnabledExperiments(), promiseExperimentsConfiguration()]).then(values => {
+  Promise.all([
+    promiseEnabledExperiments(),
+    promiseExperimentsConfiguration(),
+  ]).then(values => {
     const enabledExperiments = values[0];
     const serverConfiguration = values[1];
 
     serverConfiguration.data.forEach(function(experiment) {
       try {
         let item = document.createElement("li");
         item.textContent = experiment.name;
         item.setAttribute("name", experiment.name);
-        item.setAttribute("isEnabled", enabledExperiments.includes(experiment.name));
+        item.setAttribute(
+          "isEnabled",
+          enabledExperiments.includes(experiment.name)
+        );
         list.appendChild(item);
       } catch (e) {
-          log(`Error while setting experiments list: ${e.error}`);
+        log(`Error while setting experiments list: ${e.error}`);
       }
     });
   });
 }
 
 function toggleOverride(experiment) {
   const item = experiment.originalTarget;
   const name = item.getAttribute("name");
@@ -56,22 +66,24 @@ function toggleOverride(experiment) {
 }
 
 /**
  * Get the list of locally enabled experiments.
  */
 function promiseEnabledExperiments() {
   log("Getting the locally enabled experiments");
 
-  return EventDispatcher.instance.sendRequestForResult({
-    type: "Experiments:GetActive",
-  }).then(experiments => {
-    log("List of locally enabled experiments ready");
-    return experiments;
-  });
+  return EventDispatcher.instance
+    .sendRequestForResult({
+      type: "Experiments:GetActive",
+    })
+    .then(experiments => {
+      log("List of locally enabled experiments ready");
+      return experiments;
+    });
 }
 
 /**
  * Fetch the list of experiments from server configuration.
  */
 function promiseExperimentsConfiguration() {
   log("Fetching server experiments");
 
@@ -95,17 +107,19 @@ function promiseExperimentsConfiguration
           try {
             resolve(JSON.parse(xhr.responseText));
           } catch (e) {
             const errorMessage = `Error while parsing request: ${e}`;
             log(errorMessage);
             reject(errorMessage);
           }
         } else {
-          const errorMessage = `Request to ${url} returned status ${xhr.status}`;
+          const errorMessage = `Request to ${url} returned status ${
+            xhr.status
+          }`;
           log(errorMessage);
           reject(errorMessage);
         }
       }
       log("Finished fetching server experiments");
     };
 
     xhr.send(null);
--- a/mobile/android/chrome/content/aboutLogins.js
+++ b/mobile/android/chrome/content/aboutLogins.js
@@ -1,39 +1,63 @@
 /* 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/. */
 
-ChromeUtils.import("resource://services-common/utils.js"); /* global: CommonUtils */
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-const {Accounts} = ChromeUtils.import("resource://gre/modules/Accounts.jsm");
+ChromeUtils.import(
+  "resource://services-common/utils.js"
+); /* global: CommonUtils */
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
+const { Accounts } = ChromeUtils.import("resource://gre/modules/Accounts.jsm");
 
 XPCOMUtils.defineLazyGetter(window, "gChromeWin", () =>
-  window.docShell.rootTreeItem.domWindow
-    .QueryInterface(Ci.nsIDOMChromeWindow));
+  window.docShell.rootTreeItem.domWindow.QueryInterface(Ci.nsIDOMChromeWindow)
+);
 
-ChromeUtils.defineModuleGetter(this, "EventDispatcher",
-                               "resource://gre/modules/Messaging.jsm");
-ChromeUtils.defineModuleGetter(this, "Snackbars", "resource://gre/modules/Snackbars.jsm");
-ChromeUtils.defineModuleGetter(this, "Prompt",
-                               "resource://gre/modules/Prompt.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "EventDispatcher",
+  "resource://gre/modules/Messaging.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "Snackbars",
+  "resource://gre/modules/Snackbars.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "Prompt",
+  "resource://gre/modules/Prompt.jsm"
+);
 
-var debug = ChromeUtils.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.d.bind(null, "AboutLogins");
+var debug = ChromeUtils.import(
+  "resource://gre/modules/AndroidLog.jsm",
+  {}
+).AndroidLog.d.bind(null, "AboutLogins");
 
-var gStringBundle = Services.strings.createBundle("chrome://browser/locale/aboutLogins.properties");
+var gStringBundle = Services.strings.createBundle(
+  "chrome://browser/locale/aboutLogins.properties"
+);
 
 function copyStringShowSnackbar(string, notifyString) {
   try {
-    let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper);
+    let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(
+      Ci.nsIClipboardHelper
+    );
     clipboard.copyString(string);
     Snackbars.show(notifyString, Snackbars.LENGTH_LONG);
   } catch (e) {
     debug("Error copying from about:logins");
-    Snackbars.show(gStringBundle.GetStringFromName("loginsDetails.copyFailed"), Snackbars.LENGTH_LONG);
+    Snackbars.show(
+      gStringBundle.GetStringFromName("loginsDetails.copyFailed"),
+      Snackbars.LENGTH_LONG
+    );
   }
 }
 
 // Delay filtering while typing in MS
 const FILTER_DELAY = 500;
 
 var Logins = {
   _logins: [],
@@ -59,25 +83,27 @@ var Logins = {
 
     let getAllLogins = () => {
       let logins = [];
       try {
         logins = Services.logins.getAllLogins();
       } catch (e) {
         // It's likely that the Master Password was not entered; give
         // a hint to the next person.
-        throw new Error("Possible Master Password permissions error: " + e.toString());
+        throw new Error(
+          "Possible Master Password permissions error: " + e.toString()
+        );
       }
 
       logins.sort((a, b) => a.origin.localeCompare(b.origin));
 
       return logins;
     };
 
-    let hideSpinner = (logins) => {
+    let hideSpinner = logins => {
       this._toggleListBody(false);
 
       if (!logins.length) {
         contentBody.classList.add("hidden");
         filterIcon.classList.add("hidden");
         emptyBody.classList.remove("hidden");
       } else {
         contentBody.classList.remove("hidden");
@@ -113,21 +139,21 @@ var Logins = {
       .then(getAllLogins)
       .then(hideSpinner);
   },
 
   // Reload the logins list, displaying interstitial UI while loading.
   // Update the stored and displayed list upon completion.
   _reloadList: function() {
     this._promiseLogins()
-      .then((logins) => {
+      .then(logins => {
         this._logins = logins;
         this._loadList(logins);
       })
-      .catch((e) => {
+      .catch(e => {
         // There's no way to recover from errors, sadly.  Log and make
         // it obvious that something is up.
         this._logins = [];
         debug("Failed to _reloadList!");
         Cu.reportError(e);
       });
   },
 
@@ -143,45 +169,51 @@ var Logins = {
       contentBody.classList.remove("hidden");
     }
   },
 
   init: function() {
     window.addEventListener("popstate", this);
 
     Services.obs.addObserver(this, "passwordmgr-storage-changed");
-    document.getElementById("update-btn").addEventListener("click", this._onSaveEditLogin.bind(this));
-    document.getElementById("password-btn").addEventListener("click", this._onPasswordBtn.bind(this));
+    document
+      .getElementById("update-btn")
+      .addEventListener("click", this._onSaveEditLogin.bind(this));
+    document
+      .getElementById("password-btn")
+      .addEventListener("click", this._onPasswordBtn.bind(this));
 
     let filterInput = document.getElementById("filter-input");
     let filterContainer = document.getElementById("filter-input-container");
 
-    filterInput.addEventListener("input", (event) => {
+    filterInput.addEventListener("input", event => {
       // Stop any in-progress filter timer
       if (this._filterTimer) {
         clearTimeout(this._filterTimer);
         this._filterTimer = null;
       }
 
       // Start a new timer
       this._filterTimer = setTimeout(() => {
         this._filter(event);
       }, FILTER_DELAY);
     });
 
-    filterInput.addEventListener("blur", (event) => {
+    filterInput.addEventListener("blur", event => {
       filterContainer.setAttribute("hidden", true);
     });
 
-    document.getElementById("filter-button").addEventListener("click", (event) => {
-      filterContainer.removeAttribute("hidden");
-      filterInput.focus();
-    });
+    document
+      .getElementById("filter-button")
+      .addEventListener("click", event => {
+        filterContainer.removeAttribute("hidden");
+        filterInput.focus();
+      });
 
-    document.getElementById("filter-clear").addEventListener("click", (event) => {
+    document.getElementById("filter-clear").addEventListener("click", event => {
       // Stop any in-progress filter timer
       if (this._filterTimer) {
         clearTimeout(this._filterTimer);
         this._filterTimer = null;
       }
 
       filterInput.blur();
       filterInput.value = "";
@@ -247,73 +279,89 @@ var Logins = {
     passwordField.value = login.password;
     let domainField = document.getElementById("origin");
     domainField.value = login.origin;
 
     let img = document.getElementById("favicon");
     this._loadFavicon(img, login.origin);
 
     let headerText = document.getElementById("edit-login-header-text");
-    if (login.origin && (login.origin != "")) {
+    if (login.origin && login.origin != "") {
       headerText.textContent = login.origin;
     } else {
-      headerText.textContent = gStringBundle.GetStringFromName("editLogin.fallbackTitle");
+      headerText.textContent = gStringBundle.GetStringFromName(
+        "editLogin.fallbackTitle"
+      );
     }
 
-    passwordField.addEventListener("input", (event) => {
+    passwordField.addEventListener("input", event => {
       let newPassword = passwordField.value;
       let updateBtn = document.getElementById("update-btn");
 
       if (newPassword === "") {
         updateBtn.disabled = true;
         updateBtn.classList.add("disabled-btn");
-      } else if ((newPassword !== "") && (updateBtn.disabled === true)) {
+      } else if (newPassword !== "" && updateBtn.disabled === true) {
         updateBtn.disabled = false;
         updateBtn.classList.remove("disabled-btn");
       }
     });
   },
 
   _onSaveEditLogin: function() {
     let newUsername = document.getElementById("username").value;
     let newPassword = document.getElementById("password").value;
     let origUsername = this._selectedLogin.username;
     let origPassword = this._selectedLogin.password;
 
     try {
-      if ((newUsername === origUsername) && (newPassword === origPassword)) {
-        Snackbars.show(gStringBundle.GetStringFromName("editLogin.saved1"), Snackbars.LENGTH_LONG);
+      if (newUsername === origUsername && newPassword === origPassword) {
+        Snackbars.show(
+          gStringBundle.GetStringFromName("editLogin.saved1"),
+          Snackbars.LENGTH_LONG
+        );
         this._showList();
         return;
       }
 
-      let logins = Services.logins.findLogins(this._selectedLogin.origin, this._selectedLogin.formActionOrigin, this._selectedLogin.httpRealm);
+      let logins = Services.logins.findLogins(
+        this._selectedLogin.origin,
+        this._selectedLogin.formActionOrigin,
+        this._selectedLogin.httpRealm
+      );
 
       for (let i = 0; i < logins.length; i++) {
         if (logins[i].username == origUsername) {
-          let propBag = Cc["@mozilla.org/hash-property-bag;1"].
-            createInstance(Ci.nsIWritablePropertyBag);
+          let propBag = Cc["@mozilla.org/hash-property-bag;1"].createInstance(
+            Ci.nsIWritablePropertyBag
+          );
           if (newUsername !== origUsername) {
             propBag.setProperty("username", newUsername);
           }
           if (newPassword !== origPassword) {
             propBag.setProperty("password", newPassword);
           }
           // Sync relies on timePasswordChanged to decide whether
           // or not to sync a login, so touch it.
           propBag.setProperty("timePasswordChanged", Date.now());
           Services.logins.modifyLogin(logins[i], propBag);
           break;
         }
       }
     } catch (e) {
-      Snackbars.show(gStringBundle.GetStringFromName("editLogin.couldNotSave"), Snackbars.LENGTH_LONG);
+      Snackbars.show(
+        gStringBundle.GetStringFromName("editLogin.couldNotSave"),
+        Snackbars.LENGTH_LONG
+      );
       return;
     }
-    Snackbars.show(gStringBundle.GetStringFromName("editLogin.saved1"), Snackbars.LENGTH_LONG);
+    Snackbars.show(
+      gStringBundle.GetStringFromName("editLogin.saved1"),
+      Snackbars.LENGTH_LONG
+    );
     this._showList();
   },
 
   _onPasswordBtn: function() {
     this._updatePasswordBtn(this._isPasswordBtnInHideMode());
   },
 
   _updatePasswordBtn: function(aShouldShow) {
@@ -338,24 +386,28 @@ var Logins = {
   },
 
   _showPassword: function(password) {
     let passwordPrompt = new Prompt({
       window: window,
       message: password,
       buttons: [
         gStringBundle.GetStringFromName("loginsDialog.copy"),
-        gStringBundle.GetStringFromName("loginsDialog.cancel") ],
-      }).show((data) => {
-        switch (data.button) {
-          case 0:
+        gStringBundle.GetStringFromName("loginsDialog.cancel"),
+      ],
+    }).show(data => {
+      switch (data.button) {
+        case 0:
           // Corresponds to "Copy password" button.
-          copyStringShowSnackbar(password, gStringBundle.GetStringFromName("loginsDetails.passwordCopied"));
-        }
-     });
+          copyStringShowSnackbar(
+            password,
+            gStringBundle.GetStringFromName("loginsDetails.passwordCopied")
+          );
+      }
+    });
   },
 
   _onLoginClick: function(event) {
     let loginItem = event.currentTarget;
     let login = loginItem.login;
     if (!login) {
       debug("No login!");
       return;
@@ -369,92 +421,124 @@ var Logins = {
       { label: gStringBundle.GetStringFromName("loginsMenu.copyPassword") },
       { label: gStringBundle.GetStringFromName("loginsMenu.copyUsername") },
       { label: gStringBundle.GetStringFromName("loginsMenu.editLogin") },
       { label: gStringBundle.GetStringFromName("loginsMenu.delete") },
       { label: gStringBundle.GetStringFromName("loginsMenu.deleteAll") },
     ];
 
     prompt.setSingleChoiceItems(menuItems);
-    prompt.show((data) => {
+    prompt.show(data => {
       // Switch on indices of buttons, as they were added when creating login item.
       switch (data.button) {
         case 0:
           this._showPassword(login.password);
           break;
         case 1:
-          copyStringShowSnackbar(login.password, gStringBundle.GetStringFromName("loginsDetails.passwordCopied"));
+          copyStringShowSnackbar(
+            login.password,
+            gStringBundle.GetStringFromName("loginsDetails.passwordCopied")
+          );
           break;
         case 2:
-          copyStringShowSnackbar(login.username, gStringBundle.GetStringFromName("loginsDetails.usernameCopied"));
+          copyStringShowSnackbar(
+            login.username,
+            gStringBundle.GetStringFromName("loginsDetails.usernameCopied")
+          );
           break;
         case 3:
           this._selectedLogin = login;
           this._showEditLoginDialog(login);
           history.pushState({ id: login.guid }, document.title);
           break;
         case 4:
           Accounts.getFirefoxAccount().then(user => {
-             const promptMessage = user ? gStringBundle.GetStringFromName("loginsDialog.confirmDeleteForFxaUser")
-                                        : gStringBundle.GetStringFromName("loginsDialog.confirmDelete");
-             const confirmationMessage = gStringBundle.GetStringFromName("loginsDetails.deleted");
+            const promptMessage = user
+              ? gStringBundle.GetStringFromName(
+                  "loginsDialog.confirmDeleteForFxaUser"
+                )
+              : gStringBundle.GetStringFromName("loginsDialog.confirmDelete");
+            const confirmationMessage = gStringBundle.GetStringFromName(
+              "loginsDetails.deleted"
+            );
 
-             this._showConfirmationPrompt(promptMessage,
-                                          confirmationMessage,
-                                          () => Services.logins.removeLogin(login));
+            this._showConfirmationPrompt(
+              promptMessage,
+              confirmationMessage,
+              () => Services.logins.removeLogin(login)
+            );
           });
           break;
         case 5:
           Accounts.getFirefoxAccount().then(user => {
-             const promptMessage = user ? gStringBundle.GetStringFromName("loginsDialog.confirmDeleteAllForFxaUser")
-                                        : gStringBundle.GetStringFromName("loginsDialog.confirmDeleteAll");
-             const confirmationMessage = gStringBundle.GetStringFromName("loginsDetails.deletedAll");
+            const promptMessage = user
+              ? gStringBundle.GetStringFromName(
+                  "loginsDialog.confirmDeleteAllForFxaUser"
+                )
+              : gStringBundle.GetStringFromName(
+                  "loginsDialog.confirmDeleteAll"
+                );
+            const confirmationMessage = gStringBundle.GetStringFromName(
+              "loginsDetails.deletedAll"
+            );
 
-             this._showConfirmationPrompt(promptMessage,
-                                          confirmationMessage,
-                                          () => Services.logins.removeAllLogins());
+            this._showConfirmationPrompt(
+              promptMessage,
+              confirmationMessage,
+              () => Services.logins.removeAllLogins()
+            );
           });
           break;
       }
     });
   },
 
-   _showConfirmationPrompt: function(promptMessage, confirmationMessage, actionToPerform) {
-     new Prompt({
-         window: window,
-         message: promptMessage,
-         buttons: [
-           // Use default, generic values
-           gStringBundle.GetStringFromName("loginsDialog.confirm"),
-           gStringBundle.GetStringFromName("loginsDialog.cancel") ],
-       }).show((data) => {
-         switch (data.button) {
-           case 0:
-             // Corresponds to "confirm" button.
+  _showConfirmationPrompt: function(
+    promptMessage,
+    confirmationMessage,
+    actionToPerform
+  ) {
+    new Prompt({
+      window: window,
+      message: promptMessage,
+      buttons: [
+        // Use default, generic values
+        gStringBundle.GetStringFromName("loginsDialog.confirm"),
+        gStringBundle.GetStringFromName("loginsDialog.cancel"),
+      ],
+    }).show(data => {
+      switch (data.button) {
+        case 0:
+          // Corresponds to "confirm" button.
 
-             actionToPerform();
+          actionToPerform();
 
-             Snackbars.show(confirmationMessage, Snackbars.LENGTH_LONG);
-         }
-       });
-   },
+          Snackbars.show(confirmationMessage, Snackbars.LENGTH_LONG);
+      }
+    });
+  },
 
   _loadFavicon: function(aImg, aOrigin) {
     // Load favicon from cache.
-    EventDispatcher.instance.sendRequestForResult({
-      type: "Favicon:Request",
-      url: aOrigin,
-      skipNetwork: true,
-    }).then(function(faviconUrl) {
-      aImg.style.backgroundImage = "url('" + faviconUrl + "')";
-      aImg.style.visibility = "visible";
-    }, function(data) {
-      debug("Favicon cache failure : " + data);
-      aImg.style.visibility = "visible";
-    });
+    EventDispatcher.instance
+      .sendRequestForResult({
+        type: "Favicon:Request",
+        url: aOrigin,
+        skipNetwork: true,
+      })
+      .then(
+        function(faviconUrl) {
+          aImg.style.backgroundImage = "url('" + faviconUrl + "')";
+          aImg.style.visibility = "visible";
+        },
+        function(data) {
+          debug("Favicon cache failure : " + data);
+          aImg.style.visibility = "visible";
+        }
+      );
   },
 
   _createItemForLogin: function(login) {
     let loginItem = document.createElement("div");
 
     loginItem.setAttribute("loginID", login.guid);
     loginItem.className = "login-item list-item";
 
@@ -516,26 +600,24 @@ var Logins = {
         this._reloadList();
         break;
       }
     }
   },
 
   _filter: function(event) {
     let value = event.target.value.toLowerCase();
-    let logins = this._logins.filter((login) => {
+    let logins = this._logins.filter(login => {
       if (login.origin.toLowerCase().includes(value)) {
         return true;
       }
-      if (login.username &&
-          login.username.toLowerCase().includes(value)) {
+      if (login.username && login.username.toLowerCase().includes(value)) {
         return true;
       }
-      if (login.httpRealm &&
-          login.httpRealm.toLowerCase().includes(value)) {
+      if (login.httpRealm && login.httpRealm.toLowerCase().includes(value)) {
         return true;
       }
       return false;
     });
 
     this._loadList(logins);
   },
 };
--- a/mobile/android/chrome/content/aboutPrivateBrowsing.js
+++ b/mobile/android/chrome/content/aboutPrivateBrowsing.js
@@ -1,24 +1,34 @@
 /* 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";
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {PrivateBrowsingUtils} = ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
+const { PrivateBrowsingUtils } = ChromeUtils.import(
+  "resource://gre/modules/PrivateBrowsingUtils.jsm"
+);
 
 XPCOMUtils.defineLazyGetter(window, "gChromeWin", () =>
-  window.docShell.rootTreeItem.domWindow
-    .QueryInterface(Ci.nsIDOMChromeWindow));
+  window.docShell.rootTreeItem.domWindow.QueryInterface(Ci.nsIDOMChromeWindow)
+);
 
 document.addEventListener("DOMContentLoaded", function() {
-    let BrowserApp = window.gChromeWin.BrowserApp;
+  let BrowserApp = window.gChromeWin.BrowserApp;
 
-    if (!PrivateBrowsingUtils.isContentWindowPrivate(window)) {
-      document.body.setAttribute("class", "normal");
-      document.getElementById("newPrivateTabLink").addEventListener("click", function() {
-        BrowserApp.addTab("about:privatebrowsing", { selected: true, parentId: BrowserApp.selectedTab.id, isPrivate: true });
+  if (!PrivateBrowsingUtils.isContentWindowPrivate(window)) {
+    document.body.setAttribute("class", "normal");
+    document
+      .getElementById("newPrivateTabLink")
+      .addEventListener("click", function() {
+        BrowserApp.addTab("about:privatebrowsing", {
+          selected: true,
+          parentId: BrowserApp.selectedTab.id,
+          isPrivate: true,
+        });
       });
-    }
-  });
+  }
+});
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1,123 +1,239 @@
 // -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
 /* 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 {AddonManager} = ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
-var {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
-var {DelayedInit} = ChromeUtils.import("resource://gre/modules/DelayedInit.jsm");
-var {EventDispatcher} = ChromeUtils.import("resource://gre/modules/Messaging.jsm");
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-var {TelemetryController} = ChromeUtils.import("resource://gre/modules/TelemetryController.jsm");
+var { AddonManager } = ChromeUtils.import(
+  "resource://gre/modules/AddonManager.jsm"
+);
+var { AppConstants } = ChromeUtils.import(
+  "resource://gre/modules/AppConstants.jsm"
+);
+var { DelayedInit } = ChromeUtils.import(
+  "resource://gre/modules/DelayedInit.jsm"
+);
+var { EventDispatcher } = ChromeUtils.import(
+  "resource://gre/modules/Messaging.jsm"
+);
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
+var { TelemetryController } = ChromeUtils.import(
+  "resource://gre/modules/TelemetryController.jsm"
+);
 
 if (AppConstants.ACCESSIBILITY) {
-  ChromeUtils.defineModuleGetter(this, "AccessFu",
-                                 "resource://gre/modules/accessibility/AccessFu.jsm");
+  ChromeUtils.defineModuleGetter(
+    this,
+    "AccessFu",
+    "resource://gre/modules/accessibility/AccessFu.jsm"
+  );
 }
 
-ChromeUtils.defineModuleGetter(this, "AsyncPrefs",
-                               "resource://gre/modules/AsyncPrefs.jsm");
-
-ChromeUtils.defineModuleGetter(this, "Manifests",
-                               "resource://gre/modules/Manifest.jsm");
-
-ChromeUtils.defineModuleGetter(this, "FileUtils",
-                               "resource://gre/modules/FileUtils.jsm");
-
-ChromeUtils.defineModuleGetter(this, "UITelemetry",
-                               "resource://gre/modules/UITelemetry.jsm");
-
-ChromeUtils.defineModuleGetter(this, "PluralForm",
-                               "resource://gre/modules/PluralForm.jsm");
-
-ChromeUtils.defineModuleGetter(this, "Downloads",
-                               "resource://gre/modules/Downloads.jsm");
-
-ChromeUtils.defineModuleGetter(this, "UserAgentOverrides",
-                               "resource://gre/modules/UserAgentOverrides.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "AsyncPrefs",
+  "resource://gre/modules/AsyncPrefs.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "Manifests",
+  "resource://gre/modules/Manifest.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "FileUtils",
+  "resource://gre/modules/FileUtils.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "UITelemetry",
+  "resource://gre/modules/UITelemetry.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "PluralForm",
+  "resource://gre/modules/PluralForm.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "Downloads",
+  "resource://gre/modules/Downloads.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "UserAgentOverrides",
+  "resource://gre/modules/UserAgentOverrides.jsm"
+);
 
 ChromeUtils.defineModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
 
-ChromeUtils.defineModuleGetter(this, "SafeBrowsing",
-                               "resource://gre/modules/SafeBrowsing.jsm");
-
-ChromeUtils.defineModuleGetter(this, "BrowserUtils",
-                               "resource://gre/modules/BrowserUtils.jsm");
-
-ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
-                               "resource://gre/modules/PrivateBrowsingUtils.jsm");
-
-ChromeUtils.defineModuleGetter(this, "Sanitizer",
-                               "resource://gre/modules/Sanitizer.jsm");
-
-ChromeUtils.defineModuleGetter(this, "Prompt",
-                               "resource://gre/modules/Prompt.jsm");
-
-ChromeUtils.defineModuleGetter(this, "HelperApps",
-                               "resource://gre/modules/HelperApps.jsm");
-
-ChromeUtils.defineModuleGetter(this, "FormHistory",
-                               "resource://gre/modules/FormHistory.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "uuidgen",
-                                   "@mozilla.org/uuid-generator;1",
-                                   "nsIUUIDGenerator");
+ChromeUtils.defineModuleGetter(
+  this,
+  "SafeBrowsing",
+  "resource://gre/modules/SafeBrowsing.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "BrowserUtils",
+  "resource://gre/modules/BrowserUtils.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "PrivateBrowsingUtils",
+  "resource://gre/modules/PrivateBrowsingUtils.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "Sanitizer",
+  "resource://gre/modules/Sanitizer.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "Prompt",
+  "resource://gre/modules/Prompt.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "HelperApps",
+  "resource://gre/modules/HelperApps.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "FormHistory",
+  "resource://gre/modules/FormHistory.jsm"
+);
+
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "uuidgen",
+  "@mozilla.org/uuid-generator;1",
+  "nsIUUIDGenerator"
+);
 
 if (AppConstants.MOZ_ENABLE_PROFILER_SPS) {
-  XPCOMUtils.defineLazyServiceGetter(this, "Profiler",
-                                     "@mozilla.org/tools/profiler;1",
-                                     "nsIProfiler");
+  XPCOMUtils.defineLazyServiceGetter(
+    this,
+    "Profiler",
+    "@mozilla.org/tools/profiler;1",
+    "nsIProfiler"
+  );
 }
 
-ChromeUtils.defineModuleGetter(this, "SimpleServiceDiscovery",
-                               "resource://gre/modules/SimpleServiceDiscovery.jsm");
-
-ChromeUtils.defineModuleGetter(this, "CharsetMenu",
-                               "resource://gre/modules/CharsetMenu.jsm");
-
-ChromeUtils.defineModuleGetter(this, "NetErrorHelper",
-                               "resource://gre/modules/NetErrorHelper.jsm");
-
-ChromeUtils.defineModuleGetter(this, "PermissionsUtils",
-                               "resource://gre/modules/PermissionsUtils.jsm");
-
-ChromeUtils.defineModuleGetter(this, "Preferences",
-                               "resource://gre/modules/Preferences.jsm");
-
-ChromeUtils.defineModuleGetter(this, "SharedPreferences",
-                               "resource://gre/modules/SharedPreferences.jsm");
-
-ChromeUtils.defineModuleGetter(this, "Notifications",
-                               "resource://gre/modules/Notifications.jsm");
-
-ChromeUtils.defineModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm");
-
-ChromeUtils.defineModuleGetter(this, "Snackbars", "resource://gre/modules/Snackbars.jsm");
-
-ChromeUtils.defineModuleGetter(this, "RuntimePermissions", "resource://gre/modules/RuntimePermissions.jsm");
-
-ChromeUtils.defineModuleGetter(this, "WebsiteMetadata", "resource://gre/modules/WebsiteMetadata.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "FontEnumerator",
+ChromeUtils.defineModuleGetter(
+  this,
+  "SimpleServiceDiscovery",
+  "resource://gre/modules/SimpleServiceDiscovery.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "CharsetMenu",
+  "resource://gre/modules/CharsetMenu.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "NetErrorHelper",
+  "resource://gre/modules/NetErrorHelper.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "PermissionsUtils",
+  "resource://gre/modules/PermissionsUtils.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "Preferences",
+  "resource://gre/modules/Preferences.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "SharedPreferences",
+  "resource://gre/modules/SharedPreferences.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "Notifications",
+  "resource://gre/modules/Notifications.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "ReaderMode",
+  "resource://gre/modules/ReaderMode.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "Snackbars",
+  "resource://gre/modules/Snackbars.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "RuntimePermissions",
+  "resource://gre/modules/RuntimePermissions.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "WebsiteMetadata",
+  "resource://gre/modules/WebsiteMetadata.jsm"
+);
+
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "FontEnumerator",
   "@mozilla.org/gfx/fontenumerator;1",
-  "nsIFontEnumerator");
-
-ChromeUtils.defineModuleGetter(this, "E10SUtils", "resource://gre/modules/E10SUtils.jsm");
-
-ChromeUtils.defineModuleGetter(this, "FormLikeFactory",
-                               "resource://gre/modules/FormLikeFactory.jsm");
-ChromeUtils.defineModuleGetter(this, "GeckoViewAutoFill",
-                               "resource://gre/modules/GeckoViewAutoFill.jsm");
-
-ChromeUtils.defineModuleGetter(this, "ContentBlockingAllowList",
-                               "resource://gre/modules/ContentBlockingAllowList.jsm");
+  "nsIFontEnumerator"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "E10SUtils",
+  "resource://gre/modules/E10SUtils.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "FormLikeFactory",
+  "resource://gre/modules/FormLikeFactory.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "GeckoViewAutoFill",
+  "resource://gre/modules/GeckoViewAutoFill.jsm"
+);
+
+ChromeUtils.defineModuleGetter(
+  this,
+  "ContentBlockingAllowList",
+  "resource://gre/modules/ContentBlockingAllowList.jsm"
+);
 
 var GlobalEventDispatcher = EventDispatcher.instance;
 var WindowEventDispatcher = EventDispatcher.for(window);
 
 var lazilyLoadedBrowserScripts = [
   ["MasterPassword", "chrome://browser/content/MasterPassword.js"],
   ["OfflineApps", "chrome://browser/content/OfflineApps.js"],
   ["Linkifier", "chrome://browser/content/Linkify.js"],
@@ -131,113 +247,157 @@ lazilyLoadedBrowserScripts.forEach(funct
   XPCOMUtils.defineLazyGetter(window, name, function() {
     let sandbox = {};
     Services.scriptloader.loadSubScript(script, sandbox);
     return sandbox[name];
   });
 });
 
 var lazilyLoadedObserverScripts = [
-  ["MemoryObserver", ["memory-pressure",
-                      "memory-pressure-stop",
-                      "Memory:Dump"],
-   "chrome://browser/content/MemoryObserver.js"],
-  ["ConsoleAPI", ["console-api-log-event"], "chrome://browser/content/ConsoleAPI.js"],
-  ["ExtensionPermissions", ["webextension-permission-prompt",
-                            "webextension-update-permissions",
-                            "webextension-optional-permission-prompt"],
-   "chrome://browser/content/ExtensionPermissions.js"],
+  [
+    "MemoryObserver",
+    ["memory-pressure", "memory-pressure-stop", "Memory:Dump"],
+    "chrome://browser/content/MemoryObserver.js",
+  ],
+  [
+    "ConsoleAPI",
+    ["console-api-log-event"],
+    "chrome://browser/content/ConsoleAPI.js",
+  ],
+  [
+    "ExtensionPermissions",
+    [
+      "webextension-permission-prompt",
+      "webextension-update-permissions",
+      "webextension-optional-permission-prompt",
+    ],
+    "chrome://browser/content/ExtensionPermissions.js",
+  ],
 ];
 
 lazilyLoadedObserverScripts.forEach(function(aScript) {
   let [name, notifications, script] = aScript;
   XPCOMUtils.defineLazyGetter(window, name, function() {
     let sandbox = {};
     Services.scriptloader.loadSubScript(script, sandbox);
     return sandbox[name];
   });
   let observer = (s, t, d) => {
     Services.obs.removeObserver(observer, t);
     Services.obs.addObserver(window[name], t);
     window[name].observe(s, t, d); // Explicitly notify new observer
   };
-  notifications.forEach((notification) => {
+  notifications.forEach(notification => {
     Services.obs.addObserver(observer, notification);
   });
 });
 
 // Lazily-loaded browser scripts that use message listeners.
 [
-  ["Reader", [
-    ["Reader:AddToCache", false],
-    ["Reader:RemoveFromCache", false],
-    ["Reader:ArticleGet", false],
-    ["Reader:DropdownClosed", true], // 'true' allows us to survive mid-air cycle-collection.
-    ["Reader:DropdownOpened", false],
-    ["Reader:FaviconRequest", false],
-    ["Reader:ToolbarHidden", false],
-    ["Reader:SystemUIVisibility", false],
-    ["Reader:UpdateReaderButton", false],
-  ], "chrome://browser/content/Reader.js"],
+  [
+    "Reader",
+    [
+      ["Reader:AddToCache", false],
+      ["Reader:RemoveFromCache", false],
+      ["Reader:ArticleGet", false],
+      ["Reader:DropdownClosed", true], // 'true' allows us to survive mid-air cycle-collection.
+      ["Reader:DropdownOpened", false],
+      ["Reader:FaviconRequest", false],
+      ["Reader:ToolbarHidden", false],
+      ["Reader:SystemUIVisibility", false],
+      ["Reader:UpdateReaderButton", false],
+    ],
+    "chrome://browser/content/Reader.js",
+  ],
 ].forEach(aScript => {
   let [name, messages, script] = aScript;
   XPCOMUtils.defineLazyGetter(window, name, function() {
     let sandbox = {};
     Services.scriptloader.loadSubScript(script, sandbox);
     return sandbox[name];
   });
 
   let mm = window.getGroupMessageManager("browsers");
-  let listener = (message) => {
+  let listener = message => {
     mm.removeMessageListener(message.name, listener);
     let listenAfterClose = false;
     for (let [name, laClose] of messages) {
       if (message.name === name) {
         listenAfterClose = laClose;
         break;
       }
     }
 
     mm.addMessageListener(message.name, window[name], listenAfterClose);
     window[name].receiveMessage(message);
   };
 
-  messages.forEach((message) => {
+  messages.forEach(message => {
     let [name, listenAfterClose] = message;
     mm.addMessageListener(name, listener, listenAfterClose);
   });
 });
 
 // Lazily-loaded JS subscripts and modules that use global/window EventDispatcher.
 [
-  ["EmbedRT", WindowEventDispatcher,
-   ["GeckoView:ImportScript"],
-   "chrome://browser/content/EmbedRT.js"],
-  ["Feedback", GlobalEventDispatcher,
-   ["Feedback:Show"],
-   "chrome://browser/content/Feedback.js"],
-  ["FeedHandler", GlobalEventDispatcher,
-   ["Feeds:Subscribe"],
-   "chrome://browser/content/FeedHandler.js"],
-  ["FindHelper", GlobalEventDispatcher,
-   ["FindInPage:Opened", "FindInPage:Closed"],
-   "chrome://browser/content/FindHelper.js"],
-  ["Home", GlobalEventDispatcher,
-   ["HomeBanner:Get", "HomePanels:Get", "HomePanels:Authenticate",
-    "HomePanels:RefreshView", "HomePanels:Installed", "HomePanels:Uninstalled"],
-   "resource://gre/modules/Home.jsm"],
-  ["PermissionsHelper", GlobalEventDispatcher,
-   ["Permissions:Check", "Permissions:Get", "Permissions:Clear"],
-   "chrome://browser/content/PermissionsHelper.js"],
-  ["PrintHelper", GlobalEventDispatcher,
-   ["Print:PDF"],
-   "chrome://browser/content/PrintHelper.js"],
-  ["Reader", GlobalEventDispatcher,
-   ["Reader:AddToCache", "Reader:RemoveFromCache"],
-   "chrome://browser/content/Reader.js"],
+  [
+    "EmbedRT",
+    WindowEventDispatcher,
+    ["GeckoView:ImportScript"],
+    "chrome://browser/content/EmbedRT.js",
+  ],
+  [
+    "Feedback",
+    GlobalEventDispatcher,
+    ["Feedback:Show"],
+    "chrome://browser/content/Feedback.js",
+  ],
+  [
+    "FeedHandler",
+    GlobalEventDispatcher,
+    ["Feeds:Subscribe"],
+    "chrome://browser/content/FeedHandler.js",
+  ],
+  [
+    "FindHelper",
+    GlobalEventDispatcher,
+    ["FindInPage:Opened", "FindInPage:Closed"],
+    "chrome://browser/content/FindHelper.js",
+  ],
+  [
+    "Home",
+    GlobalEventDispatcher,
+    [
+      "HomeBanner:Get",
+      "HomePanels:Get",
+      "HomePanels:Authenticate",
+      "HomePanels:RefreshView",
+      "HomePanels:Installed",
+      "HomePanels:Uninstalled",
+    ],
+    "resource://gre/modules/Home.jsm",
+  ],
+  [
+    "PermissionsHelper",
+    GlobalEventDispatcher,
+    ["Permissions:Check", "Permissions:Get", "Permissions:Clear"],
+    "chrome://browser/content/PermissionsHelper.js",
+  ],
+  [
+    "PrintHelper",
+    GlobalEventDispatcher,
+    ["Print:PDF"],
+    "chrome://browser/content/PrintHelper.js",
+  ],
+  [
+    "Reader",
+    GlobalEventDispatcher,
+    ["Reader:AddToCache", "Reader:RemoveFromCache"],
+    "chrome://browser/content/Reader.js",
+  ],
 ].forEach(module => {
   let [name, dispatcher, events, script] = module;
   XPCOMUtils.defineLazyGetter(window, name, function() {
     let sandbox = {};
     if (script.endsWith(".jsm")) {
       ChromeUtils.import(script, sandbox);
     } else {
       Services.scriptloader.loadSubScript(script, sandbox);
@@ -247,90 +407,129 @@ lazilyLoadedObserverScripts.forEach(func
   let listener = (event, message, callback) => {
     dispatcher.unregisterListener(listener, event);
     dispatcher.registerListener(window[name], event);
     window[name].onEvent(event, message, callback); // Explicitly notify new listener
   };
   dispatcher.registerListener(listener, events);
 });
 
-XPCOMUtils.defineLazyServiceGetter(this, "Haptic",
-  "@mozilla.org/widget/hapticfeedback;1", "nsIHapticFeedback");
-
-XPCOMUtils.defineLazyServiceGetter(this, "ParentalControls",
-  "@mozilla.org/parental-controls-service;1", "nsIParentalControlsService");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Log",
-  "resource://gre/modules/AndroidLog.jsm", "AndroidLog");
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "Haptic",
+  "@mozilla.org/widget/hapticfeedback;1",
+  "nsIHapticFeedback"
+);
+
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "ParentalControls",
+  "@mozilla.org/parental-controls-service;1",
+  "nsIParentalControlsService"
+);
+
+XPCOMUtils.defineLazyModuleGetter(
+  this,
+  "Log",
+  "resource://gre/modules/AndroidLog.jsm",
+  "AndroidLog"
+);
 
 // Define the "dump" function as a binding of the Log.d function so it specifies
 // the "debug" priority and a log tag.
 function dump(msg) {
   Log.d("Browser", msg);
 }
 
 const kStateActive = 0x00000001; // :active pseudoclass for elements
 
 const kXLinkNamespace = "http://www.w3.org/1999/xlink";
 
 function fuzzyEquals(a, b) {
-  return (Math.abs(a - b) < 1e-6);
+  return Math.abs(a - b) < 1e-6;
 }
 
 XPCOMUtils.defineLazyGetter(this, "ContentAreaUtils", function() {
   let ContentAreaUtils = {};
-  Services.scriptloader.loadSubScript("chrome://global/content/contentAreaUtils.js", ContentAreaUtils);
+  Services.scriptloader.loadSubScript(
+    "chrome://global/content/contentAreaUtils.js",
+    ContentAreaUtils
+  );
   return ContentAreaUtils;
 });
 
-ChromeUtils.defineModuleGetter(this, "Rect", "resource://gre/modules/Geometry.jsm");
-ChromeUtils.defineModuleGetter(this, "Point", "resource://gre/modules/Geometry.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Rect",
+  "resource://gre/modules/Geometry.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "Point",
+  "resource://gre/modules/Geometry.jsm"
+);
 
 function resolveGeckoURI(aURI) {
-  if (!aURI)
+  if (!aURI) {
     throw new Error("Can't resolve an empty uri");
+  }
 
   if (aURI.startsWith("chrome://")) {
-    let registry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
+    let registry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(
+      Ci.nsIChromeRegistry
+    );
     return registry.convertChromeURL(Services.io.newURI(aURI)).spec;
   } else if (aURI.startsWith("resource://")) {
-    let handler = Services.io.getProtocolHandler("resource").QueryInterface(Ci.nsIResProtocolHandler);
+    let handler = Services.io
+      .getProtocolHandler("resource")
+      .QueryInterface(Ci.nsIResProtocolHandler);
     return handler.resolveURI(Services.io.newURI(aURI));
   }
   return aURI;
 }
 
 XPCOMUtils.defineLazyGetter(this, "ReferrerInfo", () =>
   Components.Constructor(
     "@mozilla.org/referrer-info;1",
     "nsIReferrerInfo",
-    "init"));
+    "init"
+  )
+);
 
 function createReferrerInfo(aReferrer) {
   let referrerUri;
   try {
     referrerUri = Services.io.newURI(aReferrer);
-  } catch (ignored) {
-  }
+  } catch (ignored) {}
 
   return new ReferrerInfo(
     Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
     true,
     referrerUri
   );
 }
 
 /**
  * Cache of commonly used string bundles.
  */
 var Strings = {
   init: function() {
-    XPCOMUtils.defineLazyGetter(Strings, "brand", () => Services.strings.createBundle("chrome://branding/locale/brand.properties"));
-    XPCOMUtils.defineLazyGetter(Strings, "browser", () => Services.strings.createBundle("chrome://browser/locale/browser.properties"));
-    XPCOMUtils.defineLazyGetter(Strings, "reader", () => Services.strings.createBundle("chrome://global/locale/aboutReader.properties"));
+    XPCOMUtils.defineLazyGetter(Strings, "brand", () =>
+      Services.strings.createBundle("chrome://branding/locale/brand.properties")
+    );
+    XPCOMUtils.defineLazyGetter(Strings, "browser", () =>
+      Services.strings.createBundle(
+        "chrome://browser/locale/browser.properties"
+      )
+    );
+    XPCOMUtils.defineLazyGetter(Strings, "reader", () =>
+      Services.strings.createBundle(
+        "chrome://global/locale/aboutReader.properties"
+      )
+    );
   },
 
   flush: function() {
     Services.strings.flushBundles();
     this.init();
   },
 };
 
@@ -345,25 +544,29 @@ function InitLater(fn, object, name) {
   return DelayedInit.schedule(fn, object, name, 15000 /* 15s max wait */);
 }
 
 var BrowserApp = {
   _tabs: [],
   _selectedTab: null,
 
   get isTablet() {
-    let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
+    let sysInfo = Cc["@mozilla.org/system-info;1"].getService(
+      Ci.nsIPropertyBag2
+    );
     delete this.isTablet;
-    return this.isTablet = sysInfo.get("tablet");
+    return (this.isTablet = sysInfo.get("tablet"));
   },
 
   get isOnLowMemoryPlatform() {
-    let memory = Cc["@mozilla.org/xpcom/memory-service;1"].getService(Ci.nsIMemory);
+    let memory = Cc["@mozilla.org/xpcom/memory-service;1"].getService(
+      Ci.nsIMemory
+    );
     delete this.isOnLowMemoryPlatform;
-    return this.isOnLowMemoryPlatform = memory.isLowMemoryPlatform();
+    return (this.isOnLowMemoryPlatform = memory.isLowMemoryPlatform());
   },
 
   // Note that the deck list order does not necessarily reflect the user visible tab order (see
   // bug 1331154 for the reason), so deck.selectedIndex should not be used (though
   // deck.selectedPanel is still valid) - use selectedTabIndex instead.
   deck: null,
 
   startup: function startup() {
@@ -404,34 +607,38 @@ var BrowserApp = {
       "Session:Navigate",
       "Session:Reload",
       "Session:Stop",
       "Telemetry:CustomTabsPing",
     ]);
 
     // Provide compatibility for add-ons like QuitNow that send "Browser:Quit"
     // as an observer notification.
-    Services.obs.addObserver((subject, topic, data) =>
-        this.quit(data ? JSON.parse(data) : undefined), "Browser:Quit");
+    Services.obs.addObserver(
+      (subject, topic, data) => this.quit(data ? JSON.parse(data) : undefined),
+      "Browser:Quit"
+    );
 
     Services.obs.addObserver(this, "android-get-pref");
     Services.obs.addObserver(this, "android-set-pref");
     Services.obs.addObserver(this, "gather-telemetry");
     Services.obs.addObserver(this, "keyword-search");
     Services.obs.addObserver(this, "Vibration:Request");
 
     window.addEventListener("fullscreen", function() {
       WindowEventDispatcher.sendRequest({
         type: window.fullScreen ? "ToggleChrome:Hide" : "ToggleChrome:Show",
       });
     });
 
-    window.addEventListener("fullscreenchange", (e) => {
+    window.addEventListener("fullscreenchange", e => {
       WindowEventDispatcher.sendRequest({
-        type: document.fullscreenElement ? "DOMFullScreen:Start" : "DOMFullScreen:Stop",
+        type: document.fullscreenElement
+          ? "DOMFullScreen:Start"
+          : "DOMFullScreen:Stop",
       });
 
       if (this.fullscreenTransitionTab) {
         // Tab selection has changed during a fullscreen transition, handle it now.
         let tab = this.fullscreenTransitionTab;
         this.fullscreenTransitionTab = null;
         this.selectTab(tab);
       }
@@ -468,35 +675,56 @@ var BrowserApp = {
       Services.prefs.setBoolPref("xpinstall.enabled", false);
     } else if (ParentalControls.parentalControlsEnabled) {
       Services.prefs.clearUserPref("extensions.enabledScopes");
       Services.prefs.clearUserPref("extensions.autoDisableScopes");
       Services.prefs.setBoolPref("xpinstall.enabled", true);
     }
 
     if (ParentalControls.parentalControlsEnabled) {
-        let isBlockListEnabled = ParentalControls.isAllowed(ParentalControls.BLOCK_LIST);
-        Services.prefs.setBoolPref("browser.safebrowsing.allowOverride", !isBlockListEnabled);
-
-        let isTelemetryEnabled = ParentalControls.isAllowed(ParentalControls.TELEMETRY);
-        Services.prefs.setBoolPref("toolkit.telemetry.enabled", isTelemetryEnabled);
-
-        let isHealthReportEnabled = ParentalControls.isAllowed(ParentalControls.HEALTH_REPORT);
-        SharedPreferences.forApp().setBoolPref("android.not_a_preference.healthreport.uploadEnabled", isHealthReportEnabled);
-    }
-
-    InitLater(() => {
-      // The order that context menu items are added is important
-      // Make sure the "Open in App" context menu item appears at the bottom of the list
-      this.initContextMenu();
-      ExternalApps.init();
-    }, NativeWindow, "contextmenus");
+      let isBlockListEnabled = ParentalControls.isAllowed(
+        ParentalControls.BLOCK_LIST
+      );
+      Services.prefs.setBoolPref(
+        "browser.safebrowsing.allowOverride",
+        !isBlockListEnabled
+      );
+
+      let isTelemetryEnabled = ParentalControls.isAllowed(
+        ParentalControls.TELEMETRY
+      );
+      Services.prefs.setBoolPref(
+        "toolkit.telemetry.enabled",
+        isTelemetryEnabled
+      );
+
+      let isHealthReportEnabled = ParentalControls.isAllowed(
+        ParentalControls.HEALTH_REPORT
+      );
+      SharedPreferences.forApp().setBoolPref(
+        "android.not_a_preference.healthreport.uploadEnabled",
+        isHealthReportEnabled
+      );
+    }
+
+    InitLater(
+      () => {
+        // The order that context menu items are added is important
+        // Make sure the "Open in App" context menu item appears at the bottom of the list
+        this.initContextMenu();
+        ExternalApps.init();
+      },
+      NativeWindow,
+      "contextmenus"
+    );
 
     if (AppConstants.ACCESSIBILITY) {
-      InitLater(() => GlobalEventDispatcher.dispatch("GeckoView:AccessibilityReady"));
+      InitLater(() =>
+        GlobalEventDispatcher.dispatch("GeckoView:AccessibilityReady")
+      );
       GlobalEventDispatcher.registerListener((aEvent, aData, aCallback) => {
         if (aData.touchEnabled) {
           AccessFu.enable();
         } else {
           AccessFu.disable();
         }
       }, "GeckoView:AccessibilitySettings");
     }
@@ -510,77 +738,108 @@ var BrowserApp = {
     });
 
     // Don't delay loading content.js because when we restore reader mode tabs,
     // we require the reader mode scripts in content.js right away.
     let mm = window.getGroupMessageManager("browsers");
     mm.loadFrameScript("chrome://browser/content/content.js", true, true);
 
     // Listen to manifest messages
-    mm.loadFrameScript("chrome://global/content/manifestMessages.js", true, true);
+    mm.loadFrameScript(
+      "chrome://global/content/manifestMessages.js",
+      true,
+      true
+    );
 
     // We can't delay registering WebChannel listeners: if the first page is
     // about:accounts, which can happen when starting the Firefox Account flow
     // from the first run experience, or via the Firefox Account Status
     // Activity, we can and do miss messages from the fxa-content-server.
     // However, we never allow suitably restricted profiles from listening to
     // fxa-content-server messages.
     if (ParentalControls.isAllowed(ParentalControls.MODIFY_ACCOUNTS)) {
-      var {EnsureFxAccountsWebChannel} = ChromeUtils.import("resource://gre/modules/FxAccountsWebChannel.jsm");
+      var { EnsureFxAccountsWebChannel } = ChromeUtils.import(
+        "resource://gre/modules/FxAccountsWebChannel.jsm"
+      );
       EnsureFxAccountsWebChannel();
     } else {
-      console.log("browser.js: not loading Firefox Accounts WebChannel; this profile cannot connect to Firefox Accounts.");
+      console.log(
+        "browser.js: not loading Firefox Accounts WebChannel; this profile cannot connect to Firefox Accounts."
+      );
     }
 
     // Notify Java that Gecko has loaded.
     GlobalEventDispatcher.sendRequest({ type: "Gecko:Ready" });
 
-    this.deck.addEventListener("DOMContentLoaded", function() {
-      ChromeUtils.import("resource://gre/modules/NotificationDB.jsm");
-
-      InitLater(() => Services.obs.notifyObservers(window, "browser-delayed-startup-finished"));
-      InitLater(() => GlobalEventDispatcher.sendRequest({ type: "Gecko:DelayedStartup" }));
-
-      // AsyncPrefs is needed for reader mode.
-      InitLater(() => AsyncPrefs.init());
-
-      // Collect telemetry data.
-      // We do this at startup because we want to move away from "gather-telemetry" (bug 1127907)
-      InitLater(() => {
-        Telemetry.addData("FENNEC_TRACKING_PROTECTION_STATE", parseInt(BrowserApp.getTrackingProtectionState()));
-      });
-
-      InitLater(() => LightWeightThemeStuff.init());
-      InitLater(() => CastingApps.init(), window, "CastingApps");
-
-      // Bug 778855 - Perf regression if we do this here. To be addressed in bug 779008.
-      InitLater(() => SafeBrowsing.init(), window, "SafeBrowsing");
-
-      // Start Marionette after all startup scripts have been run.
-      InitLater(() => {
-        Services.obs.notifyObservers(window, "marionette-startup-requested");
-      });
-
-      // This should always go last, since the idle tasks (except for the ones with
-      // timeouts) should execute in order. Note that this observer notification is
-      // not guaranteed to fire, since the window could close before we get here.
-      InitLater(() => {
-        Services.obs.notifyObservers(window, "browser-idle-startup-tasks-finished");
-      });
-    }, {once: true});
+    this.deck.addEventListener(
+      "DOMContentLoaded",
+      function() {
+        ChromeUtils.import("resource://gre/modules/NotificationDB.jsm");
+
+        InitLater(() =>
+          Services.obs.notifyObservers(
+            window,
+            "browser-delayed-startup-finished"
+          )
+        );
+        InitLater(() =>
+          GlobalEventDispatcher.sendRequest({ type: "Gecko:DelayedStartup" })
+        );
+
+        // AsyncPrefs is needed for reader mode.
+        InitLater(() => AsyncPrefs.init());
+
+        // Collect telemetry data.
+        // We do this at startup because we want to move away from "gather-telemetry" (bug 1127907)
+        InitLater(() => {
+          Telemetry.addData(
+            "FENNEC_TRACKING_PROTECTION_STATE",
+            parseInt(BrowserApp.getTrackingProtectionState())
+          );
+        });
+
+        InitLater(() => LightWeightThemeStuff.init());
+        InitLater(() => CastingApps.init(), window, "CastingApps");
+
+        // Bug 778855 - Perf regression if we do this here. To be addressed in bug 779008.
+        InitLater(() => SafeBrowsing.init(), window, "SafeBrowsing");
+
+        // Start Marionette after all startup scripts have been run.
+        InitLater(() => {
+          Services.obs.notifyObservers(window, "marionette-startup-requested");
+        });
+
+        // This should always go last, since the idle tasks (except for the ones with
+        // timeouts) should execute in order. Note that this observer notification is
+        // not guaranteed to fire, since the window could close before we get here.
+        InitLater(() => {
+          Services.obs.notifyObservers(
+            window,
+            "browser-idle-startup-tasks-finished"
+          );
+        });
+      },
+      { once: true }
+    );
   },
 
   get _startupStatus() {
     delete this._startupStatus;
 
-    let savedMilestone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone", "");
+    let savedMilestone = Services.prefs.getCharPref(
+      "browser.startup.homepage_override.mstone",
+      ""
+    );
     let ourMilestone = AppConstants.MOZ_APP_VERSION;
     this._startupStatus = "";
     if (ourMilestone != savedMilestone) {
-      Services.prefs.setCharPref("browser.startup.homepage_override.mstone", ourMilestone);
+      Services.prefs.setCharPref(
+        "browser.startup.homepage_override.mstone",
+        ourMilestone
+      );
       this._startupStatus = savedMilestone ? "upgrade" : "new";
     }
 
     return this._startupStatus;
   },
 
   /**
    * Pass this a locale string, such as "fr" or "es_ES".
@@ -604,101 +863,153 @@ var BrowserApp = {
         // If a video element is zero width or height, it's essentially
         // an HTMLAudioElement.
         return "Audio";
       }
       return "Video";
     }
 
     // TODO: These should eventually move into more appropriate classes
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.openInNewTab"),
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.openInNewTab"),
       NativeWindow.contextmenus.linkOpenableNonPrivateContext,
       function(aTarget) {
-        UITelemetry.addEvent("action.1", "contextmenu", null, "web_open_new_tab");
+        UITelemetry.addEvent(
+          "action.1",
+          "contextmenu",
+          null,
+          "web_open_new_tab"
+        );
         UITelemetry.addEvent("loadurl.1", "contextmenu", null);
 
         let url = NativeWindow.contextmenus._getLinkURL(aTarget);
-        ContentAreaUtils.urlSecurityCheck(url, aTarget.ownerDocument.nodePrincipal);
-        let tab = BrowserApp.addTab(url, { selected: false, parentId: BrowserApp.selectedTab.id });
-
-        let newtabStrings = Strings.browser.GetStringFromName("newtabpopup.opened");
+        ContentAreaUtils.urlSecurityCheck(
+          url,
+          aTarget.ownerDocument.nodePrincipal
+        );
+        let tab = BrowserApp.addTab(url, {
+          selected: false,
+          parentId: BrowserApp.selectedTab.id,
+        });
+
+        let newtabStrings = Strings.browser.GetStringFromName(
+          "newtabpopup.opened"
+        );
         let label = PluralForm.get(1, newtabStrings).replace("#1", 1);
-        let buttonLabel = Strings.browser.GetStringFromName("newtabpopup.switch");
+        let buttonLabel = Strings.browser.GetStringFromName(
+          "newtabpopup.switch"
+        );
 
         Snackbars.show(label, Snackbars.LENGTH_LONG, {
           action: {
             label: buttonLabel,
-            callback: () => { BrowserApp.selectTab(tab); },
+            callback: () => {
+              BrowserApp.selectTab(tab);
+            },
           },
         });
-      });
+      }
+    );
 
     let showOpenInPrivateTab = true;
     if ("@mozilla.org/parental-controls-service;1" in Cc) {
-      let pc = Cc["@mozilla.org/parental-controls-service;1"].createInstance(Ci.nsIParentalControlsService);
-      showOpenInPrivateTab = pc.isAllowed(Ci.nsIParentalControlsService.PRIVATE_BROWSING);
+      let pc = Cc["@mozilla.org/parental-controls-service;1"].createInstance(
+        Ci.nsIParentalControlsService
+      );
+      showOpenInPrivateTab = pc.isAllowed(
+        Ci.nsIParentalControlsService.PRIVATE_BROWSING
+      );
     }
 
     if (showOpenInPrivateTab) {
-      NativeWindow.contextmenus.add(stringGetter("contextmenu.openInPrivateTab"),
+      NativeWindow.contextmenus.add(
+        stringGetter("contextmenu.openInPrivateTab"),
         NativeWindow.contextmenus.linkOpenableContext,
         function(aTarget) {
-          UITelemetry.addEvent("action.1", "contextmenu", null, "web_open_new_tab");
+          UITelemetry.addEvent(
+            "action.1",
+            "contextmenu",
+            null,
+            "web_open_new_tab"
+          );
           UITelemetry.addEvent("loadurl.1", "contextmenu", null);
 
           let url = NativeWindow.contextmenus._getLinkURL(aTarget);
-          ContentAreaUtils.urlSecurityCheck(url, aTarget.ownerDocument.nodePrincipal);
-          let tab = BrowserApp.addTab(url, {selected: false, parentId: BrowserApp.selectedTab.id, isPrivate: true});
-
-          let newtabStrings = Strings.browser.GetStringFromName("newprivatetabpopup.opened");
+          ContentAreaUtils.urlSecurityCheck(
+            url,
+            aTarget.ownerDocument.nodePrincipal
+          );
+          let tab = BrowserApp.addTab(url, {
+            selected: false,
+            parentId: BrowserApp.selectedTab.id,
+            isPrivate: true,
+          });
+
+          let newtabStrings = Strings.browser.GetStringFromName(
+            "newprivatetabpopup.opened"
+          );
           let label = PluralForm.get(1, newtabStrings).replace("#1", 1);
-          let buttonLabel = Strings.browser.GetStringFromName("newtabpopup.switch");
+          let buttonLabel = Strings.browser.GetStringFromName(
+            "newtabpopup.switch"
+          );
           Snackbars.show(label, Snackbars.LENGTH_LONG, {
             action: {
               label: buttonLabel,
-              callback: () => { BrowserApp.selectTab(tab); },
+              callback: () => {
+                BrowserApp.selectTab(tab);
+              },
             },
           });
-        });
-    }
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.copyLink"),
+        }
+      );
+    }
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.copyLink"),
       NativeWindow.contextmenus.linkCopyableContext,
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_copy_link");
 
         let url = NativeWindow.contextmenus._getLinkURL(aTarget);
         url = NativeWindow.contextmenus._stripViewSource(url);
         NativeWindow.contextmenus._copyStringToDefaultClipboard(url);
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.copyEmailAddress"),
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.copyEmailAddress"),
       NativeWindow.contextmenus.emailLinkContext,
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_copy_email");
 
         let url = NativeWindow.contextmenus._getLinkURL(aTarget);
         let emailAddr = NativeWindow.contextmenus._stripScheme(url);
         NativeWindow.contextmenus._copyStringToDefaultClipboard(emailAddr);
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.copyPhoneNumber"),
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.copyPhoneNumber"),
       NativeWindow.contextmenus.phoneNumberLinkContext,
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_copy_phone");
 
         let url = NativeWindow.contextmenus._getLinkURL(aTarget);
         let phoneNumber = NativeWindow.contextmenus._stripScheme(url);
         NativeWindow.contextmenus._copyStringToDefaultClipboard(phoneNumber);
-      });
+      }
+    );
 
     NativeWindow.contextmenus.add({
       label: stringGetter("contextmenu.shareLink"),
       order: NativeWindow.contextmenus.DEFAULT_HTML5_ORDER - 1, // Show above HTML5 menu items
-      selector: NativeWindow.contextmenus._disableRestricted("SHARE", NativeWindow.contextmenus.linkShareableContext),
+      selector: NativeWindow.contextmenus._disableRestricted(
+        "SHARE",
+        NativeWindow.contextmenus.linkShareableContext
+      ),
       showAsActions: function(aElement) {
         let uri = NativeWindow.contextmenus._getLinkURL(aElement);
         uri = NativeWindow.contextmenus._stripViewSource(uri);
         return {
           title: aElement.textContent.trim() || aElement.title.trim(),
           uri,
         };
       },
@@ -707,246 +1018,346 @@ var BrowserApp = {
         // share.1 telemetry is handled in Java via PromptList
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_share_link");
       },
     });
 
     NativeWindow.contextmenus.add({
       label: stringGetter("contextmenu.shareEmailAddress"),
       order: NativeWindow.contextmenus.DEFAULT_HTML5_ORDER - 1,
-      selector: NativeWindow.contextmenus._disableRestricted("SHARE", NativeWindow.contextmenus.emailLinkContext),
+      selector: NativeWindow.contextmenus._disableRestricted(
+        "SHARE",
+        NativeWindow.contextmenus.emailLinkContext
+      ),
       showAsActions: function(aElement) {
         let url = NativeWindow.contextmenus._getLinkURL(aElement);
         let emailAddr = NativeWindow.contextmenus._stripScheme(url);
         let title = aElement.textContent || aElement.title;
         return {
           title: title,
           uri: emailAddr,
         };
       },
       icon: "drawable://ic_menu_share",
       callback: function(aTarget) {
         // share.1 telemetry is handled in Java via PromptList
-        UITelemetry.addEvent("action.1", "contextmenu", null, "web_share_email");
+        UITelemetry.addEvent(
+          "action.1",
+          "contextmenu",
+          null,
+          "web_share_email"
+        );
       },
     });
 
     NativeWindow.contextmenus.add({
       label: stringGetter("contextmenu.sharePhoneNumber"),
       order: NativeWindow.contextmenus.DEFAULT_HTML5_ORDER - 1,
-      selector: NativeWindow.contextmenus._disableRestricted("SHARE", NativeWindow.contextmenus.phoneNumberLinkContext),
+      selector: NativeWindow.contextmenus._disableRestricted(
+        "SHARE",
+        NativeWindow.contextmenus.phoneNumberLinkContext
+      ),
       showAsActions: function(aElement) {
         let url = NativeWindow.contextmenus._getLinkURL(aElement);
         let phoneNumber = NativeWindow.contextmenus._stripScheme(url);
         let title = aElement.textContent || aElement.title;
         return {
           title: title,
           uri: phoneNumber,
         };
       },
       icon: "drawable://ic_menu_share",
       callback: function(aTarget) {
         // share.1 telemetry is handled in Java via PromptList
-        UITelemetry.addEvent("action.1", "contextmenu", null, "web_share_phone");
+        UITelemetry.addEvent(
+          "action.1",
+          "contextmenu",
+          null,
+          "web_share_phone"
+        );
       },
     });
 
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.addToContacts"),
-      NativeWindow.contextmenus._disableRestricted("ADD_CONTACT", NativeWindow.contextmenus.emailLinkContext),
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.addToContacts"),
+      NativeWindow.contextmenus._disableRestricted(
+        "ADD_CONTACT",
+        NativeWindow.contextmenus.emailLinkContext
+      ),
       function(aTarget) {
-        UITelemetry.addEvent("action.1", "contextmenu", null, "web_contact_email");
+        UITelemetry.addEvent(
+          "action.1",
+          "contextmenu",
+          null,
+          "web_contact_email"
+        );
 
         let url = NativeWindow.contextmenus._getLinkURL(aTarget);
         WindowEventDispatcher.sendRequest({
           type: "Contact:Add",
           email: url,
         });
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.addToContacts"),
-      NativeWindow.contextmenus._disableRestricted("ADD_CONTACT", NativeWindow.contextmenus.phoneNumberLinkContext),
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.addToContacts"),
+      NativeWindow.contextmenus._disableRestricted(
+        "ADD_CONTACT",
+        NativeWindow.contextmenus.phoneNumberLinkContext
+      ),
       function(aTarget) {
-        UITelemetry.addEvent("action.1", "contextmenu", null, "web_contact_phone");
+        UITelemetry.addEvent(
+          "action.1",
+          "contextmenu",
+          null,
+          "web_contact_phone"
+        );
 
         let url = NativeWindow.contextmenus._getLinkURL(aTarget);
         WindowEventDispatcher.sendRequest({
           type: "Contact:Add",
           phone: url,
         });
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.bookmarkLink"),
-      NativeWindow.contextmenus._disableRestricted("BOOKMARK", NativeWindow.contextmenus.linkBookmarkableContext),
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.bookmarkLink"),
+      NativeWindow.contextmenus._disableRestricted(
+        "BOOKMARK",
+        NativeWindow.contextmenus.linkBookmarkableContext
+      ),
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_bookmark");
         UITelemetry.addEvent("save.1", "contextmenu", null, "bookmark");
 
         let url = NativeWindow.contextmenus._getLinkURL(aTarget);
         let title = aTarget.textContent || aTarget.title || url;
         GlobalEventDispatcher.sendRequest({
           type: "Bookmark:Insert",
           url: url,
           title: title,
         });
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.playMedia"),
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.playMedia"),
       NativeWindow.contextmenus.mediaContext("media-paused"),
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_play");
         aTarget.play();
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.pauseMedia"),
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.pauseMedia"),
       NativeWindow.contextmenus.mediaContext("media-playing"),
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_pause");
         aTarget.pause();
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.showControls2"),
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.showControls2"),
       NativeWindow.contextmenus.mediaContext("media-hidingcontrols"),
       function(aTarget) {
-        UITelemetry.addEvent("action.1", "contextmenu", null, "web_controls_media");
+        UITelemetry.addEvent(
+          "action.1",
+          "contextmenu",
+          null,
+          "web_controls_media"
+        );
         aTarget.setAttribute("controls", true);
-      });
+      }
+    );
 
     NativeWindow.contextmenus.add({
       label: function(aTarget) {
         return Strings.browser.GetStringFromName(
           `contextmenu.share${videoClassifier(aTarget)}2`
         );
       },
       order: NativeWindow.contextmenus.DEFAULT_HTML5_ORDER - 1,
       selector: NativeWindow.contextmenus._disableRestricted(
-        "SHARE", NativeWindow.contextmenus.videoContext()),
+        "SHARE",
+        NativeWindow.contextmenus.videoContext()
+      ),
       showAsActions: function(aElement) {
-        let url = (aElement.currentSrc || aElement.src);
+        let url = aElement.currentSrc || aElement.src;
         let title = aElement.textContent || aElement.title;
         return {
           title: title,
           uri: url,
           type: videoClassifier(aElement) === "Audio" ? "audio/*" : "video/*",
         };
       },
       icon: "drawable://ic_menu_share",
       callback: function(aTarget) {
         // share.1 telemetry is handled in Java via PromptList
-        UITelemetry.addEvent("action.1", "contextmenu", null, "web_share_media");
+        UITelemetry.addEvent(
+          "action.1",
+          "contextmenu",
+          null,
+          "web_share_media"
+        );
       },
     });
 
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.fullScreen"),
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.fullScreen"),
       NativeWindow.contextmenus.videoContext("not-fullscreen"),
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_fullscreen");
         aTarget.requestFullscreen();
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.mute"),
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.mute"),
       NativeWindow.contextmenus.mediaContext("media-unmuted"),
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_mute");
         aTarget.muted = true;
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.unmute"),
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.unmute"),
       NativeWindow.contextmenus.mediaContext("media-muted"),
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_unmute");
         aTarget.muted = false;
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.viewImage"),
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.viewImage"),
       NativeWindow.contextmenus.imageLocationCopyableContext,
       function(aTarget) {
         let url = aTarget.currentSrc || aTarget.src;
-        ContentAreaUtils.urlSecurityCheck(url, aTarget.ownerDocument.nodePrincipal,
-                                          Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
+        ContentAreaUtils.urlSecurityCheck(
+          url,
+          aTarget.ownerDocument.nodePrincipal,
+          Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT
+        );
 
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_view_image");
         UITelemetry.addEvent("loadurl.1", "contextmenu", null);
         BrowserApp.selectedBrowser.loadURI(url);
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.copyImageLocation"),
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.copyImageLocation"),
       NativeWindow.contextmenus.imageLocationCopyableContext,
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_copy_image");
 
         let url = aTarget.currentSrc || aTarget.src;
         url = NativeWindow.contextmenus._stripViewSource(url);
         NativeWindow.contextmenus._copyStringToDefaultClipboard(url);
-      });
+      }
+    );
 
     NativeWindow.contextmenus.add({
       label: stringGetter("contextmenu.shareImage"),
-      selector: NativeWindow.contextmenus._disableRestricted("SHARE", NativeWindow.contextmenus.imageShareableContext),
+      selector: NativeWindow.contextmenus._disableRestricted(
+        "SHARE",
+        NativeWindow.contextmenus.imageShareableContext
+      ),
       order: NativeWindow.contextmenus.DEFAULT_HTML5_ORDER - 1, // Show above HTML5 menu items
       showAsActions: function(aTarget) {
         let src = aTarget.currentSrc || aTarget.src;
         src = NativeWindow.contextmenus._stripViewSource(src);
         return {
           title: src,
           uri: src,
           type: "image/*",
         };
       },
       icon: "drawable://ic_menu_share",
       menu: true,
       callback: function(aTarget) {
-        UITelemetry.addEvent("action.1", "contextmenu", null, "web_share_image");
+        UITelemetry.addEvent(
+          "action.1",
+          "contextmenu",
+          null,
+          "web_share_image"
+        );
       },
     });
 
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.saveImage"),
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.saveImage"),
       NativeWindow.contextmenus.imageSaveableContext,
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_save_image");
         UITelemetry.addEvent("save.1", "contextmenu", null, "image");
         WindowEventDispatcher.sendRequest({
           type: "Mma:web_save_image",
         });
 
-        RuntimePermissions.waitForPermissions(RuntimePermissions.WRITE_EXTERNAL_STORAGE).then(function(permissionGranted) {
-            if (!permissionGranted) {
-                return;
-            }
-
-            let uri = aTarget.currentRequestFinalURI || aTarget.currentURI;
-            ContentAreaUtils.saveImageURL(uri.spec, null, "SaveImageTitle",
-                                          false, true, aTarget.ownerDocument.documentURIObject,
-                                          aTarget.ownerDocument);
+        RuntimePermissions.waitForPermissions(
+          RuntimePermissions.WRITE_EXTERNAL_STORAGE
+        ).then(function(permissionGranted) {
+          if (!permissionGranted) {
+            return;
+          }
+
+          let uri = aTarget.currentRequestFinalURI || aTarget.currentURI;
+          ContentAreaUtils.saveImageURL(
+            uri.spec,
+            null,
+            "SaveImageTitle",
+            false,
+            true,
+            aTarget.ownerDocument.documentURIObject,
+            aTarget.ownerDocument
+          );
         });
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.setImageAs"),
-      NativeWindow.contextmenus._disableRestricted("SET_IMAGE", NativeWindow.contextmenus.imageSaveableContext),
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.setImageAs"),
+      NativeWindow.contextmenus._disableRestricted(
+        "SET_IMAGE",
+        NativeWindow.contextmenus.imageSaveableContext
+      ),
       function(aTarget) {
-        UITelemetry.addEvent("action.1", "contextmenu", null, "web_background_image");
+        UITelemetry.addEvent(
+          "action.1",
+          "contextmenu",
+          null,
+          "web_background_image"
+        );
 
         let src = aTarget.currentSrc || aTarget.src;
         GlobalEventDispatcher.sendRequest({
           type: "Image:SetAs",
           url: src,
         });
-      });
+      }
+    );
 
     NativeWindow.contextmenus.add(
       function(aTarget) {
         if (aTarget instanceof HTMLVideoElement) {
           return Strings.browser.GetStringFromName(
             `contextmenu.save${videoClassifier(aTarget)}`
           );
         } else if (aTarget instanceof HTMLAudioElement) {
           return Strings.browser.GetStringFromName("contextmenu.saveAudio");
         }
         return Strings.browser.GetStringFromName("contextmenu.saveVideo");
-      }, NativeWindow.contextmenus.mediaSaveableContext,
+      },
+      NativeWindow.contextmenus.mediaSaveableContext,
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_save_media");
         UITelemetry.addEvent("save.1", "contextmenu", null, "media");
         WindowEventDispatcher.sendRequest({
           type: "Mma:web_save_media",
         });
 
         let url = aTarget.currentSrc || aTarget.src;
@@ -954,123 +1365,170 @@ var BrowserApp = {
         let filePickerTitleKey;
         if (aTarget instanceof HTMLVideoElement) {
           filePickerTitleKey = `Save${videoClassifier(aTarget)}Title`;
         } else {
           filePickerTitleKey = "SaveAudioTitle";
         }
 
         // Skipped trying to pull MIME type out of cache for now
-        ContentAreaUtils.internalSave(url, null, null, null, null, false,
-                                      filePickerTitleKey, null, aTarget.ownerDocument.documentURIObject,
-                                      aTarget.ownerDocument, true, null);
-      });
-
-    NativeWindow.contextmenus.add(stringGetter("contextmenu.showImage"),
+        ContentAreaUtils.internalSave(
+          url,
+          null,
+          null,
+          null,
+          null,
+          false,
+          filePickerTitleKey,
+          null,
+          aTarget.ownerDocument.documentURIObject,
+          aTarget.ownerDocument,
+          true,
+          null
+        );
+      }
+    );
+
+    NativeWindow.contextmenus.add(
+      stringGetter("contextmenu.showImage"),
       NativeWindow.contextmenus.imageBlockingPolicyContext,
       function(aTarget) {
         UITelemetry.addEvent("action.1", "contextmenu", null, "web_show_image");
         aTarget.setAttribute("data-ctv-show", "true");
         aTarget.setAttribute("src", aTarget.getAttribute("data-ctv-src"));
 
         // Shows a snackbar to unblock all images if browser.image_blocking.enabled is enabled.
-        let blockedImgs = aTarget.ownerDocument.querySelectorAll("[data-ctv-src]");
+        let blockedImgs = aTarget.ownerDocument.querySelectorAll(
+          "[data-ctv-src]"
+        );
         if (blockedImgs.length == 0) {
           return;
         }
-        let message = Strings.browser.GetStringFromName("imageblocking.downloadedImage");
+        let message = Strings.browser.GetStringFromName(
+          "imageblocking.downloadedImage"
+        );
         Snackbars.show(message, Snackbars.LENGTH_LONG, {
           action: {
-            label: Strings.browser.GetStringFromName("imageblocking.showAllImages"),
+            label: Strings.browser.GetStringFromName(
+              "imageblocking.showAllImages"
+            ),
             callback: () => {
-              UITelemetry.addEvent("action.1", "toast", null, "web_show_all_image");
+              UITelemetry.addEvent(
+                "action.1",
+                "toast",
+                null,
+                "web_show_all_image"
+              );
               for (let i = 0; i < blockedImgs.length; ++i) {
                 blockedImgs[i].setAttribute("data-ctv-show", "true");
-                blockedImgs[i].setAttribute("src", blockedImgs[i].getAttribute("data-ctv-src"));
+                blockedImgs[i].setAttribute(
+                  "src",
+                  blockedImgs[i].getAttribute("data-ctv-src")
+                );
               }
             },
           },
         });
-    });
+      }
+    );
   },
 
   onAppUpdated: function() {
     // initialize the form history and passwords databases on upgrades
     GlobalEventDispatcher.dispatch("FormHistory:Init", null);
     GlobalEventDispatcher.dispatch("Passwords:Init", null);
 
     if (this._startupStatus === "upgrade") {
       this._migrateUI();
     }
   },
 
   _migrateUI: function() {
     const UI_VERSION = 4;
-    let currentUIVersion = Services.prefs.getIntPref("browser.migration.version", 0);
+    let currentUIVersion = Services.prefs.getIntPref(
+      "browser.migration.version",
+      0
+    );
     if (currentUIVersion >= UI_VERSION) {
       return;
     }
 
     if (currentUIVersion < 1) {
       // Migrate the "privacy.donottrackheader.value" pref. See bug 1042135.
       if (Services.prefs.prefHasUserValue("privacy.donottrackheader.value")) {
         // Make sure the doNotTrack value conforms to the conversion from
         // three-state to two-state. (This reverts a setting of "please track me"
         // to the default "don't say anything").
-        if (Services.prefs.getBoolPref("privacy.donottrackheader.enabled") &&
-            (Services.prefs.getIntPref("privacy.donottrackheader.value") != 1)) {
+        if (
+          Services.prefs.getBoolPref("privacy.donottrackheader.enabled") &&
+          Services.prefs.getIntPref("privacy.donottrackheader.value") != 1
+        ) {
           Services.prefs.clearUserPref("privacy.donottrackheader.enabled");
         }
 
         // This pref has been removed, so always clear it.
         Services.prefs.clearUserPref("privacy.donottrackheader.value");
       }
 
       // Set the search activity default pref on app upgrade if it has not been set already.
       if (!Services.prefs.prefHasUserValue("searchActivity.default.migrated")) {
         Services.prefs.setBoolPref("searchActivity.default.migrated", true);
         SearchEngines.migrateSearchActivityDefaultPref();
       }
 
-      Reader.migrateCache().catch(e => Cu.reportError("Error migrating Reader cache: " + e));
+      Reader.migrateCache().catch(e =>
+        Cu.reportError("Error migrating Reader cache: " + e)
+      );
 
       // We removed this pref from user visible settings, so we should reset it.
       // Power users can go into about:config to re-enable this if they choose.
       if (Services.prefs.prefHasUserValue("nglayout.debug.paint_flashing")) {
         Services.prefs.clearUserPref("nglayout.debug.paint_flashing");
       }
     }
 
     if (currentUIVersion < 2) {
       let name;
       if (Services.prefs.prefHasUserValue("browser.search.defaultenginename")) {
         name = Services.prefs.getCharPref("browser.search.defaultenginename");
       }
-      if (!name && Services.prefs.prefHasUserValue("browser.search.defaultenginename.US")) {
-        name = Services.prefs.getCharPref("browser.search.defaultenginename.US");
+      if (
+        !name &&
+        Services.prefs.prefHasUserValue("browser.search.defaultenginename.US")
+      ) {
+        name = Services.prefs.getCharPref(
+          "browser.search.defaultenginename.US"
+        );
       }
       if (name) {
         Services.search.init().then(() => {
           let engine = Services.search.getEngineByName(name);
           if (engine) {
             Services.search.defaultEngine = engine;
-            Services.obs.notifyObservers(null, "default-search-engine-migrated");
+            Services.obs.notifyObservers(
+              null,
+              "default-search-engine-migrated"
+            );
           }
         });
       }
     }
 
     if (currentUIVersion < 3) {
       const kOldSafeBrowsingPref = "browser.safebrowsing.enabled";
       // Default value is set to true, a user pref means that the pref was
       // set to false.
-      if (Services.prefs.prefHasUserValue(kOldSafeBrowsingPref) &&
-          !Services.prefs.getBoolPref(kOldSafeBrowsingPref)) {
-        Services.prefs.setBoolPref("browser.safebrowsing.phishing.enabled",
-                                   false);
+      if (
+        Services.prefs.prefHasUserValue(kOldSafeBrowsingPref) &&
+        !Services.prefs.getBoolPref(kOldSafeBrowsingPref)
+      ) {
+        Services.prefs.setBoolPref(
+          "browser.safebrowsing.phishing.enabled",
+          false
+        );
         // Should just remove support for the pref entirely, even if it's
         // only in about:config
         Services.prefs.clearUserPref(kOldSafeBrowsingPref);
       }
     }
 
     if (currentUIVersion < 4) {
       // The handler app service will read this. We need to wait with migrating
@@ -1084,131 +1542,150 @@ var BrowserApp = {
 
   // This function returns false during periods where the browser displayed document is
   // different from the browser content document, so user actions and some kinds of viewport
   // updates should be ignored. This period starts when we start loading a new page or
   // switch tabs, and ends when the new browser content document has been drawn and handed
   // off to the compositor.
   isBrowserContentDocumentDisplayed: function() {
     try {
-      if (!Services.androidBridge.isContentDocumentDisplayed(window))
+      if (!Services.androidBridge.isContentDocumentDisplayed(window)) {
         return false;
+      }
     } catch (e) {
       return false;
     }
 
     let tab = this.selectedTab;
-    if (!tab)
+    if (!tab) {
       return false;
+    }
     return tab.contentDocumentIsDisplayed;
   },
 
   contentDocumentChanged: function() {
     window.top.windowUtils.isFirstPaint = true;
     Services.androidBridge.contentDocumentChanged(window);
   },
 
   get tabs() {
     return this._tabs;
   },
 
   set selectedTab(aTab) {
-    if (this._selectedTab == aTab)
+    if (this._selectedTab == aTab) {
       return;
+    }
 
     if (this._selectedTab) {
       this._selectedTab.setActive(false);
     }
 
     this._selectedTab = aTab;
-    if (!aTab)
+    if (!aTab) {
       return;
+    }
 
     aTab.setActive(true);
     this.contentDocumentChanged();
     this.deck.selectedPanel = aTab.browser;
     // Focus the browser so that things like selection will be styled correctly.
     aTab.browser.focus();
   },
 
   get selectedBrowser() {
-    if (this._selectedTab)
+    if (this._selectedTab) {
       return this._selectedTab.browser;
+    }
     return null;
   },
 
   getTabForId: function getTabForId(aId) {
     let tabs = this._tabs;
     for (let i = 0; i < tabs.length; i++) {
-       if (tabs[i].id == aId)
-         return tabs[i];
+      if (tabs[i].id == aId) {
+        return tabs[i];
+      }
     }
     return null;
   },
 
   getTabForBrowser: function getTabForBrowser(aBrowser) {
     let tabs = this._tabs;
     for (let i = 0; i < tabs.length; i++) {
-      if (tabs[i].browser == aBrowser)
+      if (tabs[i].browser == aBrowser) {
         return tabs[i];
+      }
     }
     return null;
   },
 
   getTabForWindow: function getTabForWindow(aWindow) {
     let tabs = this._tabs;
     for (let i = 0; i < tabs.length; i++) {
-      if (tabs[i].browser.contentWindow == aWindow)
+      if (tabs[i].browser.contentWindow == aWindow) {
         return tabs[i];
+      }
     }
     return null;
   },
 
   getBrowserForWindow: function getBrowserForWindow(aWindow) {
     let tabs = this._tabs;
     for (let i = 0; i < tabs.length; i++) {
-      if (tabs[i].browser.contentWindow == aWindow)
+      if (tabs[i].browser.contentWindow == aWindow) {
         return tabs[i].browser;
+      }
     }
     return null;
   },
 
   getBrowserForDocument: function getBrowserForDocument(aDocument) {
     let tabs = this._tabs;
     for (let i = 0; i < tabs.length; i++) {
-      if (tabs[i].browser.contentDocument == aDocument)
+      if (tabs[i].browser.contentDocument == aDocument) {
         return tabs[i].browser;
+      }
     }
     return null;
   },
 
   // Use this instead of deck.selectedIndex (which is invalid for this purpose).
   get selectedTabIndex() {
     return this._tabs.indexOf(this._selectedTab);
   },
 
   loadURI: function loadURI(aURI, aBrowser, aParams) {
     aBrowser = aBrowser || this.selectedBrowser;
-    if (!aBrowser)
+    if (!aBrowser) {
       return;
+    }
 
     aParams = aParams || {};
 
-    let flags = "flags" in aParams ? aParams.flags : Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
-    let postData = ("postData" in aParams && aParams.postData) ? aParams.postData : null;
-    let referrerInfo = "referrerURI" in aParams ? createReferrerInfo(aParams.referrerURI) : null;
+    let flags =
+      "flags" in aParams ? aParams.flags : Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
+    let postData =
+      "postData" in aParams && aParams.postData ? aParams.postData : null;
+    let referrerInfo =
+      "referrerURI" in aParams ? createReferrerInfo(aParams.referrerURI) : null;
     let charset = "charset" in aParams ? aParams.charset : null;
 
     let tab = this.getTabForBrowser(aBrowser);
     if (tab) {
-      if ("userRequested" in aParams) tab.userRequested = aParams.userRequested;
-      tab.isSearch = ("isSearch" in aParams) ? aParams.isSearch : false;
+      if ("userRequested" in aParams) {
+        tab.userRequested = aParams.userRequested;
+      }
+      tab.isSearch = "isSearch" in aParams ? aParams.isSearch : false;
     }
     // Don't fall back to System here Bug 1474619
-    let triggeringPrincipal = "triggeringPrincipal" in aParams ? aParams.triggeringPrincipal : Services.scriptSecurityManager.getSystemPrincipal();
+    let triggeringPrincipal =
+      "triggeringPrincipal" in aParams
+        ? aParams.triggeringPrincipal
+        : Services.scriptSecurityManager.getSystemPrincipal();
 
     try {
       aBrowser.loadURI(aURI, {
         flags,
         referrerInfo,
         charset,
         postData,
         triggeringPrincipal,
@@ -1225,38 +1702,39 @@ var BrowserApp = {
     }
   },
 
   addTab: function addTab(aURI, aParams) {
     aParams = aParams || {};
 
     let fullscreenState;
     if (this.selectedBrowser) {
-       fullscreenState = this.selectedBrowser.contentDocument.fullscreenElement;
-       if (fullscreenState) {
-         aParams.selected = false;
-       }
+      fullscreenState = this.selectedBrowser.contentDocument.fullscreenElement;
+      if (fullscreenState) {
+        aParams.selected = false;
+      }
     }
 
     let newTab = new Tab(aURI, aParams);
 
     if (fullscreenState) {
-       this.fullscreenTransitionTab = newTab;
-       this.selectedBrowser.contentDocument.exitFullscreen();
+      this.fullscreenTransitionTab = newTab;
+      this.selectedBrowser.contentDocument.exitFullscreen();
     }
 
     if (typeof aParams.tabIndex == "number") {
       this._tabs.splice(aParams.tabIndex, 0, newTab);
     } else {
       this._tabs.push(newTab);
     }
 
     let selected = "selected" in aParams ? aParams.selected : true;
-    if (selected)
+    if (selected) {
       this.selectedTab = newTab;
+    }
 
     let evt = document.createEvent("UIEvents");
     evt.initUIEvent("TabOpen", true, false, window, null);
     newTab.browser.dispatchEvent(evt);
 
     return newTab;
   },
 
@@ -1274,41 +1752,51 @@ var BrowserApp = {
       tabID: aTab.id,
     };
     GlobalEventDispatcher.sendRequest(message);
   },
 
   // Calling this will update the state in BrowserApp after a tab has been
   // closed in the Java UI.
   _handleTabClosed: function _handleTabClosed(aTab, aShowUndoSnackbar) {
-    if (aTab == this.selectedTab)
+    if (aTab == this.selectedTab) {
       this.selectedTab = null;
+    }
 
     let tabIndex = this._tabs.indexOf(aTab);
 
     let evt = document.createEvent("UIEvents");
     evt.initUIEvent("TabClose", true, false, window, tabIndex);
     aTab.browser.dispatchEvent(evt);
 
-    let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
+    let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(
+      Ci.nsISessionStore
+    );
     if (aShowUndoSnackbar && ss.canUndoLastCloseTab) {
       // Get a title for the undo close snackbar. Fall back to the URL if there is no title.
       let closedTabData = ss.getClosedTabs(window)[0];
 
       if (closedTabData) {
         let message;
         let title = closedTabData.entries[closedTabData.index - 1].title;
         let isPrivate = PrivateBrowsingUtils.isBrowserPrivate(aTab.browser);
 
         if (isPrivate) {
-          message = Strings.browser.GetStringFromName("privateClosedMessage.message");
+          message = Strings.browser.GetStringFromName(
+            "privateClosedMessage.message"
+          );
         } else if (title) {
-          message = Strings.browser.formatStringFromName("undoCloseToast.message", [title]);
+          message = Strings.browser.formatStringFromName(
+            "undoCloseToast.message",
+            [title]
+          );
         } else {
-          message = Strings.browser.GetStringFromName("undoCloseToast.messageDefault");
+          message = Strings.browser.GetStringFromName(
+            "undoCloseToast.messageDefault"
+          );
         }
 
         Snackbars.show(message, Snackbars.LENGTH_LONG, {
           action: {
             label: Strings.browser.GetStringFromName("undoCloseToast.action2"),
             callback: function() {
               UITelemetry.addEvent("undo.1", "toast", null, "closetab");
               ss.undoCloseTab(window, closedTabData);
@@ -1325,42 +1813,58 @@ var BrowserApp = {
     this._tabs.splice(tabIndex, 1);
   },
 
   _handleTabMove(fromTabId, fromPosition, toTabId, toPosition) {
     let movedTab = this._tabs[fromPosition];
     if (movedTab.id != fromTabId || this._tabs[toPosition].id != toTabId) {
       // The gecko and/or java Tabs tabs lists changed sometime between when the Tabs list was
       // updated and when news of the update arrived here.
-      throw new Error("Moved tab mismatch: (" + fromTabId + ", " + movedTab.id + "), " +
-            "(" + toTabId + ", " + this._tabs[toPosition].id + ")");
-    }
-
-    let step = (fromPosition < toPosition) ? 1 : -1;
+      throw new Error(
+        "Moved tab mismatch: (" +
+          fromTabId +
+          ", " +
+          movedTab.id +
+          "), " +
+          "(" +
+          toTabId +
+          ", " +
+          this._tabs[toPosition].id +
+          ")"
+      );
+    }
+
+    let step = fromPosition < toPosition ? 1 : -1;
     for (let i = fromPosition; i != toPosition; i += step) {
       this._tabs[i] = this._tabs[i + step];
     }
     this._tabs[toPosition] = movedTab;
 
-    let evt = new UIEvent("TabMove", {"bubbles": true, "cancelable": false, "view": window, "detail": fromPosition});
+    let evt = new UIEvent("TabMove", {
+      bubbles: true,
+      cancelable: false,
+      view: window,
+      detail: fromPosition,
+    });
     this.tabs[toPosition].browser.dispatchEvent(evt);
   },
 
   // Use this method to select a tab from JS. This method sends a message
   // to Java to select the tab in the Java UI (we'll get a Tab:Selected message
   // back from Java when that happens).
   selectTab: function selectTab(aTab) {
     if (!aTab) {
       Cu.reportError("Error trying to select tab (tab doesn't exist)");
       return;
     }
 
     // There's nothing to do if the tab is already selected
-    if (aTab == this.selectedTab)
+    if (aTab == this.selectedTab) {
       return;
+    }
 
     let doc = this.selectedBrowser.contentDocument;
     if (doc.fullscreenElement) {
       // We'll finish the tab selection once the fullscreen transition has ended,
       // remember the new tab for this.
       this.fullscreenTransitionTab = aTab;
       doc.exitFullscreen();
       return;
@@ -1388,18 +1892,18 @@ var BrowserApp = {
     let uri = Services.io.newURI(aURL);
     for (let i = 0; i < this._tabs.length; ++i) {
       let tab = this._tabs[i];
       if (aOptions.startsWith) {
         if (tab.currentURI.spec.startsWith(uri.spec)) {
           return tab;
         }
       } else if (tab.currentURI.equals(uri)) {
-          return tab;
-        }
+        return tab;
+      }
     }
     return null;
   },
 
   /**
    * If a tab with the given URL already exists, that tab is selected.
    * Otherwise, a new tab is opened with the given URL.
    *
@@ -1422,17 +1926,17 @@ var BrowserApp = {
   },
 
   /**
    * Open or select a tab with the "about:addons" page and optionally
    * switch to the details page related to a defined addonId.
    *
    * @param {string} addonId
    */
-  openAddonManager: function openAddonManager({addonId}) {
+  openAddonManager: function openAddonManager({ addonId }) {
     if (addonId) {
       let emWindow;
 
       function receivePong(subject, topic, data) {
         emWindow = subject;
       }
 
       Services.obs.addObserver(receivePong, "EM-pong");
@@ -1493,64 +1997,83 @@ var BrowserApp = {
     });
     args.viewSourceBrowser = tab.browser;
 
     gViewSourceUtils.viewSourceInBrowser(args);
   },
 
   quit: function quit(aClear = { sanitize: {}, dontSaveSession: false }) {
     // Notify all windows that an application quit has been requested.
-    let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
+    let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(
+      Ci.nsISupportsPRBool
+    );
     Services.obs.notifyObservers(cancelQuit, "quit-application-requested");
 
     // Quit aborted.
     if (cancelQuit.data) {
       return;
     }
 
     Services.obs.notifyObservers(null, "quit-application-proceeding");
 
     // Tell session store to forget about this window
     if (aClear.dontSaveSession) {
-      let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
+      let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(
+        Ci.nsISessionStore
+      );
       ss.removeWindow(window);
     }
 
-    BrowserApp.sanitize(aClear.sanitize, function() {
-      let appStartup = Services.startup;
-      appStartup.quit(Ci.nsIAppStartup.eForceQuit);
-    }, true);
+    BrowserApp.sanitize(
+      aClear.sanitize,
+      function() {
+        let appStartup = Services.startup;
+        appStartup.quit(Ci.nsIAppStartup.eForceQuit);
+      },
+      true
+    );
   },
 
   saveAsPDF: function saveAsPDF(aBrowser) {
-    RuntimePermissions.waitForPermissions(RuntimePermissions.WRITE_EXTERNAL_STORAGE).then(function(permissionGranted) {
+    RuntimePermissions.waitForPermissions(
+      RuntimePermissions.WRITE_EXTERNAL_STORAGE
+    ).then(function(permissionGranted) {
       if (!permissionGranted) {
         return;
       }
 
       (async () => {
-        let fileName = ContentAreaUtils.getDefaultFileName(aBrowser.contentTitle, aBrowser.currentURI, null, null);
+        let fileName = ContentAreaUtils.getDefaultFileName(
+          aBrowser.contentTitle,
+          aBrowser.currentURI,
+          null,
+          null
+        );
         fileName = fileName.trim() + ".pdf";
 
         let downloadsDir = await Downloads.getPreferredDownloadsDirectory();
         let file = OS.Path.join(downloadsDir, fileName);
 
         // Force this to have a unique name.
-        let openedFile = await OS.File.openUnique(file, { humanReadable: true });
+        let openedFile = await OS.File.openUnique(file, {
+          humanReadable: true,
+        });
         file = openedFile.path;
         await openedFile.file.close();
 
         let download = await Downloads.createDownload({
           source: aBrowser.contentWindow,
           target: file,
           saver: "pdf",
           startTime: Date.now(),
         });
 
-        let list = await Downloads.getList(download.source.isPrivate ? Downloads.PRIVATE : Downloads.PUBLIC);
+        let list = await Downloads.getList(
+          download.source.isPrivate ? Downloads.PRIVATE : Downloads.PUBLIC
+        );
         await list.add(download);
         await download.start();
       })();
     });
   },
 
   // These values come from pref_tracking_protection_entries in arrays.xml.
   PREF_TRACKING_PROTECTION_ENABLED: "2",
@@ -1560,17 +2083,19 @@ var BrowserApp = {
   /**
    * Returns the current state of the tracking protection pref.
    * (0 = Disabled, 1 = Enabled in PB, 2 = Enabled)
    */
   getTrackingProtectionState: function() {
     if (Services.prefs.getBoolPref("privacy.trackingprotection.enabled")) {
       return this.PREF_TRACKING_PROTECTION_ENABLED;
     }
-    if (Services.prefs.getBoolPref("privacy.trackingprotection.pbmode.enabled")) {
+    if (
+      Services.prefs.getBoolPref("privacy.trackingprotection.pbmode.enabled")
+    ) {
       return this.PREF_TRACKING_PROTECTION_ENABLED_PB;
     }
     return this.PREF_TRACKING_PROTECTION_DISABLED;
   },
 
   sanitize: function(aItems, callback, aShutdown) {
     let success = true;
     var promises = [];
@@ -1579,93 +2104,109 @@ var BrowserApp = {
     if (aShutdown && Object.getOwnPropertyNames(aItems).length > 0) {
       let msg = Strings.browser.GetStringFromName("alertShutdownSanitize");
       Snackbars.show(msg, Snackbars.LENGTH_INDEFINITE);
     }
 
     TelemetryStopwatch.start("FX_SANITIZE_TOTAL", refObj);
 
     for (let key in aItems) {
-      if (!aItems[key])
+      if (!aItems[key]) {
         continue;
+      }
 
       key = key.replace("private.data.", "");
 
       switch (key) {
         case "cookies_sessions":
           promises.push(Sanitizer.clearItem("cookies"));
           promises.push(Sanitizer.clearItem("sessions"));
           break;
         case "downloadFiles":
           // If the user is quiting the app and the downloads are to be sanitized
           // means he chose to "Clear private data -> Downloads" upon exit so
           // all downloads will be purged, irrespective of their current state (in progress/error/completed)
           let clearUnfinishedDownloads = aShutdown === true;
-          promises.push(Sanitizer.clearItem(key, undefined, clearUnfinishedDownloads));
+          promises.push(
+            Sanitizer.clearItem(key, undefined, clearUnfinishedDownloads)
+          );
           break;
         case "openTabs":
           if (aShutdown === true) {
             Services.obs.notifyObservers(null, "browser:purge-session-tabs");
             break;
           }
-          // fall-through if aShutdown is false
+        // fall-through if aShutdown is false
         default:
           promises.push(Sanitizer.clearItem(key));
       }
     }
 
-    Promise.all(promises).then(function() {
-      TelemetryStopwatch.finish("FX_SANITIZE_TOTAL", refObj);
-      GlobalEventDispatcher.sendRequest({
-        type: "Sanitize:Finished",
-        success: true,
-        shutdown: aShutdown === true,
+    Promise.all(promises)
+      .then(function() {
+        TelemetryStopwatch.finish("FX_SANITIZE_TOTAL", refObj);
+        GlobalEventDispatcher.sendRequest({
+          type: "Sanitize:Finished",
+          success: true,
+          shutdown: aShutdown === true,
+        });
+
+        if (callback) {
+          callback();
+        }
+      })
+      .catch(function(err) {
+        TelemetryStopwatch.finish("FX_SANITIZE_TOTAL", refObj);
+        GlobalEventDispatcher.sendRequest({
+          type: "Sanitize:Finished",
+          error: err,
+          success: false,
+          shutdown: aShutdown === true,
+        });
+
+        if (callback) {
+          callback();
+        }
       });
-
-      if (callback) {
-        callback();
-      }
-    }).catch(function(err) {
-      TelemetryStopwatch.finish("FX_SANITIZE_TOTAL", refObj);
-      GlobalEventDispatcher.sendRequest({
-        type: "Sanitize:Finished",
-        error: err,
-        success: false,
-        shutdown: aShutdown === true,
-      });
-
-      if (callback) {
-        callback();
-      }
-    });
   },
 
   getFocusedInput: function(aBrowser, aOnlyInputElements = false) {
-    if (!aBrowser)
+    if (!aBrowser) {
       return null;
+    }
 
     let doc = aBrowser.contentDocument;
-    if (!doc)
+    if (!doc) {
       return null;
+    }
 
     let focused = doc.activeElement;
-    while (focused instanceof HTMLFrameElement || focused instanceof HTMLIFrameElement) {
+    while (
+      focused instanceof HTMLFrameElement ||
+      focused instanceof HTMLIFrameElement
+    ) {
       doc = focused.contentDocument;
       focused = doc.activeElement;
     }
 
-    if (focused instanceof HTMLInputElement &&
-        (focused.mozIsTextField(false) || focused.type === "number")) {
+    if (
+      focused instanceof HTMLInputElement &&
+      (focused.mozIsTextField(false) || focused.type === "number")
+    ) {
       return focused;
     }
 
-    if (aOnlyInputElements)
+    if (aOnlyInputElements) {
       return null;
-
-    if (focused && (focused instanceof HTMLTextAreaElement || focused.isContentEditable)) {
+    }
+
+    if (
+      focused &&
+      (focused instanceof HTMLTextAreaElement || focused.isContentEditable)
+    ) {
       if (focused instanceof HTMLBodyElement) {
         // we are putting focus into a contentEditable frame. scroll the frame into
         // view instead of the contentEditable document contained within, because that
         // results in a better user experience
         focused = focused.ownerGlobal.frameElement;
       }
       return focused;
     }
@@ -1693,17 +2234,17 @@ var BrowserApp = {
         dwu.zoomToFocusedInput();
       }, "apz-repaints-flushed");
     };
 
     let gotResize = false;
     let onResize = function() {
       gotResize = true;
       if (dwu.isMozAfterPaintPending) {
-        addEventListener("MozAfterPaint", zoomToFocusedInput, {once: true});
+        addEventListener("MozAfterPaint", zoomToFocusedInput, { once: true });
       } else {
         zoomToFocusedInput();
       }
     };
 
     aBrowser.contentWindow.addEventListener("resize", onResize);
 
     // When the keyboard is displayed, we can get one resize event, multiple
@@ -1726,18 +2267,19 @@ var BrowserApp = {
     try {
       return Services.prefs.getCharPref("intl.locale.os");
     } catch (e) {
       return undefined;
     }
   },
 
   setLocalizedPref: function(pref, value) {
-    let pls = Cc["@mozilla.org/pref-localizedstring;1"]
-                .createInstance(Ci.nsIPrefLocalizedString);
+    let pls = Cc["@mozilla.org/pref-localizedstring;1"].createInstance(
+      Ci.nsIPrefLocalizedString
+    );
     pls.data = value;
     Services.prefs.setComplexValue(pref, Ci.nsIPrefLocalizedString, pls);
   },
 
   // eslint-disable-next-line complexity
   onEvent: function(event, data, callback) {
     let browser = this.selectedBrowser;
 
@@ -1752,21 +2294,24 @@ var BrowserApp = {
         break;
 
       case "Fonts:Reload":
         FontEnumerator.updateFontList();
         break;
 
       case "FormHistory:Init": {
         // Force creation/upgrade of formhistory.sqlite
-        FormHistory.count({}, {
-          handleCompletion() {
-            GlobalEventDispatcher.sendRequest({ type: "FormHistory:Ready" });
-          },
-        });
+        FormHistory.count(
+          {},
+          {
+            handleCompletion() {
+              GlobalEventDispatcher.sendRequest({ type: "FormHistory:Ready" });
+            },
+          }
+        );
         GlobalEventDispatcher.unregisterListener(this, event);
         break;
       }
 
       case "FullScreen:Exit":
         browser.contentDocument.exitFullscreen();
         break;
 
@@ -1803,18 +2348,19 @@ var BrowserApp = {
         // Make sure we use the right Accept-Language header.
         let osLocale = Services.prefs.getCharPref("intl.locale.os");
 
         this.computeAcceptLanguages(osLocale);
         break;
       }
 
       case "Passwords:Init": {
-        let storage = Cc["@mozilla.org/login-manager/storage/mozStorage;1"].
-                      getService(Ci.nsILoginManagerStorage);
+        let storage = Cc[
+          "@mozilla.org/login-manager/storage/mozStorage;1"
+        ].getService(Ci.nsILoginManagerStorage);
         storage.initialize();
         GlobalEventDispatcher.unregisterListener(this, event);
         break;
       }
 
       case "Sanitize:ClearData":
         this.sanitize(data);
         break;
@@ -1826,17 +2372,21 @@ var BrowserApp = {
       case "GeckoView:ZoomToInput": {
         // these messages come from a change in the viewable area and not user interaction
         // we allow scrolling to the selected input, but not zooming the page
         this.scrollToFocusedInput(browser);
         break;
       }
 
       case "Telemetry:CustomTabsPing": {
-        TelemetryController.submitExternalPing("anonymous", { client: data.client }, { addClientId: false });
+        TelemetryController.submitExternalPing(
+          "anonymous",
+          { client: data.client },
+          { addClientId: false }
+        );
         break;
       }
 
       case "Session:GetHistory": {
         callback.onSuccess(this.getHistory(data));
         break;
       }
 
@@ -1845,40 +2395,45 @@ var BrowserApp = {
         break;
 
       case "Session:Forward":
         browser.goForward();
         break;
 
       case "Session:Navigate": {
         let index = data.index;
-        let webNav = BrowserApp.selectedTab.window.docShell
-                               .QueryInterface(Ci.nsIWebNavigation);
+        let webNav = BrowserApp.selectedTab.window.docShell.QueryInterface(
+          Ci.nsIWebNavigation
+        );
         let historySize = webNav.sessionHistory.count;
 
         if (index < 0) {
           index = 0;
           Log.e("Browser", "Negative index truncated to zero");
         } else if (index >= historySize) {
-          Log.e("Browser", "Incorrect index " + index + " truncated to " + historySize - 1);
+          Log.e(
+            "Browser",
+            "Incorrect index " + index + " truncated to " + historySize - 1
+          );
           index = historySize - 1;
         }
 
         browser.gotoIndex(index);
         break;
       }
 
       case "Session:Reload": {
         let flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
 
         // Check to see if this is a message to enable/disable mixed content blocking.
         if (data) {
           if (data.bypassCache) {
-            flags |= Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE |
-                     Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY;
+            flags |=
+              Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE |
+              Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY;
           }
 
           if (data.contentType === "tracking") {
             if (data.allowContent) {
               ContentBlockingAllowList.add(browser);
               if (!PrivateBrowsingUtils.isBrowserPrivate(browser)) {
                 Telemetry.addData("TRACKING_PROTECTION_EVENTS", 1);
               }
@@ -1892,52 +2447,54 @@ var BrowserApp = {
         }
 
         // Try to use the session history to reload so that framesets are
         // handled properly. If the window has no session history, fall back
         // to using the web navigation's reload method.
         let webNav = browser.webNavigation;
         try {
           let sh = webNav.sessionHistory;
-          if (sh)
+          if (sh) {
             webNav = sh.legacySHistory.QueryInterface(Ci.nsIWebNavigation);
+          }
         } catch (e) {}
         webNav.reload(flags);
         break;
       }
 
       case "Session:Restore":
         GlobalEventDispatcher.dispatch("Session:Restore", data);
         break;
 
       case "Session:Stop":
         browser.stop();
         break;
 
       case "Tab:Load": {
         let url = data.url;
-        let flags = Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP
-                  | Ci.nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
+        let flags =
+          Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP |
+          Ci.nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
 
         // Pass LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL to prevent any loads from
         // inheriting the currently loaded document's principal.
         if (data.userEntered) {
           flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
         }
 
-        let delayLoad = ("delayLoad" in data) ? data.delayLoad : false;
+        let delayLoad = "delayLoad" in data ? data.delayLoad : false;
         let params = {
-          selected: ("selected" in data) ? data.selected : !delayLoad,
-          parentId: ("parentId" in data) ? data.parentId : -1,
+          selected: "selected" in data ? data.selected : !delayLoad,
+          parentId: "parentId" in data ? data.parentId : -1,
           flags: flags,
           tabID: data.tabID,
-          isPrivate: (data.isPrivate === true),
-          pinned: (data.pinned === true),
-          delayLoad: (delayLoad === true),
-          desktopMode: (data.desktopMode === true),
+          isPrivate: data.isPrivate === true,
+          pinned: data.pinned === true,
+          delayLoad: delayLoad === true,
+          desktopMode: data.desktopMode === true,
         };
 
         params.userRequested = url;
 
         if (data.referrerURI) {
           try {
             params.referrerURI = Services.io.newURI(data.referrerURI);
           } catch (e) {
@@ -1957,43 +2514,51 @@ var BrowserApp = {
         }
 
         if (data.newTab) {
           this.addTab(url, params);
         } else {
           if (data.tabId) {
             // Use a specific browser instead of the selected browser, if it exists
             let specificBrowser = this.getTabForId(data.tabId).browser;
-            if (specificBrowser)
+            if (specificBrowser) {
               browser = specificBrowser;
+            }
           }
           this.loadURI(url, browser, params);
         }
         break;
       }
 
       case "Tab:OpenUri":
-        window.browserDOMWindow.openURI(Services.io.newURI(data.uri),
-                                        /* opener */ null,
-                                        Ci.nsIBrowserDOMWindow[data.flags],
-                                        Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL,
-                                        /* triggeringPrincipal */ null);
+        window.browserDOMWindow.openURI(
+          Services.io.newURI(data.uri),
+          /* opener */ null,
+          Ci.nsIBrowserDOMWindow[data.flags],
+          Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL,
+          /* triggeringPrincipal */ null
+        );
         break;
 
       case "Tab:Selected":
         this._handleTabSelected(this.getTabForId(data.id));
         break;
 
       case "Tab:Closed": {
         this._handleTabClosed(this.getTabForId(data.tabId), data.showUndoToast);
         break;
       }
 
       case "Tab:Move":
-        this._handleTabMove(data.fromTabId, data.fromPosition, data.toTabId, data.toPosition);
+        this._handleTabMove(
+          data.fromTabId,
+          data.fromPosition,
+          data.toTabId,
+          data.toPosition
+        );
         break;
 
       case "Tab:ViewSource":
         this.viewSourceForTab(this.getTabForId(data.tabId));
         break;
     }
   },
 
@@ -2003,17 +2568,19 @@ var BrowserApp = {
     switch (aTopic) {
       case "keyword-search":
         // This event refers to a search via the URL bar, not a bookmarks
         // keyword search. Note that this code assumes that the user can only
         // perform a keyword search on the selected tab.
         this.selectedTab.isSearch = true;
 
         // Don't store queries in private browsing mode.
-        let isPrivate = PrivateBrowsingUtils.isBrowserPrivate(this.selectedTab.browser);
+        let isPrivate = PrivateBrowsingUtils.isBrowserPrivate(
+          this.selectedTab.browser
+        );
         let query = isPrivate ? "" : aData;
 
         let engine = aSubject.QueryInterface(Ci.nsISearchEngine);
         GlobalEventDispatcher.sendRequest({
           type: "Search:Keyword",
           identifier: engine.identifier,
           name: engine.name,
           query: query,
@@ -2068,28 +2635,46 @@ var BrowserApp = {
           // "privacy.trackingprotection.state" is not a "real" pref name, but
           // it's used in the setting menu.  By default
           // "privacy.trackingprotection.pbmode.enabled" is true, and
           // "privacy.trackingprotection.enabled" is false.
           case "privacy.trackingprotection.state": {
             switch (value) {
               // Tracking protection disabled.
               case this.PREF_TRACKING_PROTECTION_DISABLED:
-                Services.prefs.setBoolPref("privacy.trackingprotection.pbmode.enabled", false);
-                Services.prefs.setBoolPref("privacy.trackingprotection.enabled", false);
+                Services.prefs.setBoolPref(
+                  "privacy.trackingprotection.pbmode.enabled",
+                  false
+                );
+                Services.prefs.setBoolPref(
+                  "privacy.trackingprotection.enabled",
+                  false
+                );
                 break;
               // Tracking protection only in private browsing,
               case this.PREF_TRACKING_PROTECTION_ENABLED_PB:
-                Services.prefs.setBoolPref("privacy.trackingprotection.pbmode.enabled", true);
-                Services.prefs.setBoolPref("privacy.trackingprotection.enabled", false);
+                Services.prefs.setBoolPref(
+                  "privacy.trackingprotection.pbmode.enabled",
+                  true
+                );
+                Services.prefs.setBoolPref(
+                  "privacy.trackingprotection.enabled",
+                  false
+                );
                 break;
               // Tracking protection everywhere.
               case this.PREF_TRACKING_PROTECTION_ENABLED:
-                Services.prefs.setBoolPref("privacy.trackingprotection.pbmode.enabled", true);
-                Services.prefs.setBoolPref("privacy.trackingprotection.enabled", true);
+                Services.prefs.setBoolPref(
+                  "privacy.trackingprotection.pbmode.enabled",
+                  true
+                );
+                Services.prefs.setBoolPref(
+                  "privacy.trackingprotection.enabled",
+                  true
+                );
                 break;
             }
             aSubject.setAsEmpty();
             break;
           }
 
           // Crash reporter preference is in a service; set and return.
           case "datareporting.crashreporter.submitEnabled":
@@ -2106,33 +2691,45 @@ var BrowserApp = {
         GlobalEventDispatcher.sendRequest({ type: "Telemetry:Gather" });
         break;
 
       case "Vibration:Request":
         if (aSubject instanceof Navigator) {
           let navigator = aSubject;
           let buttons = [
             {
-              label: Strings.browser.GetStringFromName("vibrationRequest.denyButton"),
+              label: Strings.browser.GetStringFromName(
+                "vibrationRequest.denyButton"
+              ),
               callback: function() {
                 navigator.setVibrationPermission(false);
               },
             },
             {
-              label: Strings.browser.GetStringFromName("vibrationRequest.allowButton"),
+              label: Strings.browser.GetStringFromName(
+                "vibrationRequest.allowButton"
+              ),
               callback: function() {
                 navigator.setVibrationPermission(true);
               },
               positive: true,
             },
           ];
-          let message = Strings.browser.GetStringFromName("vibrationRequest.message");
+          let message = Strings.browser.GetStringFromName(
+            "vibrationRequest.message"
+          );
           let options = {};
-          NativeWindow.doorhanger.show(message, "vibration-request", buttons,
-              BrowserApp.selectedTab.id, options, "VIBRATION");
+          NativeWindow.doorhanger.show(
+            message,
+            "vibration-request",
+            buttons,
+            BrowserApp.selectedTab.id,
+            options,
+            "VIBRATION"
+          );
         }
         break;
 
       default:
         dump('BrowserApp.observe: unexpected topic "' + aTopic + '"\n');
         break;
     }
   },
@@ -2143,54 +2740,60 @@ var BrowserApp = {
    * After Bug 881510 this will also accept a real Accept-Language choice as
    * input; all Accept-Language logic lives here.
    *
    * osLocale should never be null, but this method is safe regardless.
    * appLocale may explicitly be null.
    */
   computeAcceptLanguages(osLocale) {
     let defaultBranch = Services.prefs.getDefaultBranch(null);
-    let defaultAccept = defaultBranch.getComplexValue("intl.accept_languages", Ci.nsIPrefLocalizedString).data;
+    let defaultAccept = defaultBranch.getComplexValue(
+      "intl.accept_languages",
+      Ci.nsIPrefLocalizedString
+    ).data;
 
     // A guard for potential breakage. Bug 438031.
     // This should not be necessary, because we're reading from the default branch,
     // but better safe than sorry.
     if (defaultAccept && defaultAccept.startsWith("chrome://")) {
       defaultAccept = null;
     } else {
       // Ensure lowercase everywhere so we can compare.
       defaultAccept = defaultAccept.toLowerCase();
     }
 
     try {
-        const resistFingerprinting = Services.prefs.getBoolPref("privacy.resistFingerprinting");
-        if (resistFingerprinting) {
-          osLocale = null;
-        }
+      const resistFingerprinting = Services.prefs.getBoolPref(
+        "privacy.resistFingerprinting"
+      );
+      if (resistFingerprinting) {
+        osLocale = null;
+      }
     } catch (e) {}
 
     // Explicitly-set app prefs come first:
-    let chosen = Services.prefs.getCharPref("intl.locale.requested", "")
-                               .split(",")
-                               .map((x) => x.trim().toLowerCase())
-                               .filter((x) => x.length > 0);
+    let chosen = Services.prefs
+      .getCharPref("intl.locale.requested", "")
+      .split(",")
+      .map(x => x.trim().toLowerCase())
+      .filter(x => x.length > 0);
 
     // OS prefs come second:
     if (osLocale) {
       osLocale = osLocale.toLowerCase();
       if (!chosen.includes(osLocale)) {
         chosen.push(osLocale);
       }
     }
 
     // Default app prefs come third:
     if (defaultAccept) {
       // intl.accept_languages is a comma-separated list, with no q-value params. Those
       // are added when the header is generated.
-      let defaults = defaultAccept.split(",").map((x) => x.trim());
+      let defaults = defaultAccept.split(",").map(x => x.trim());
       for (let locale of defaults) {
         if (!chosen.includes(locale)) {
           chosen.push(locale);
         }
       }
     }
 
     let result = chosen.join(",");
@@ -2210,18 +2813,19 @@ var BrowserApp = {
   getUITelemetryObserver: function() {
     return UITelemetry;
   },
 
   // This method will return a list of history items and toIndex based on the action provided from the fromIndex to toIndex,
   // optionally selecting selIndex (if fromIndex <= selIndex <= toIndex)
   getHistory: function(data) {
     let action = data.action;
-    let webNav = BrowserApp.getTabForId(data.tabId).window.docShell
-                           .QueryInterface(Ci.nsIWebNavigation);
+    let webNav = BrowserApp.getTabForId(
+      data.tabId
+    ).window.docShell.QueryInterface(Ci.nsIWebNavigation);
     let historyIndex = webNav.sessionHistory.index;
     let historySize = webNav.sessionHistory.count;
     let canGoBack = webNav.canGoBack;
     let canGoForward = webNav.canGoForward;
     let listitems = [];
     let fromIndex = 0;
     let toIndex = historySize - 1;
     let selIndex = historyIndex;
@@ -2246,45 +2850,45 @@ var BrowserApp = {
         toIndex = historySize - 1;
       }
 
       fromIndex = Math.max(fromIndex, 0);
       selIndex = historyIndex;
     } else {
       // return empty list immediately.
       return {
-        "historyItems": listitems,
-        "toIndex": toIndex,
+        historyItems: listitems,
+        toIndex: toIndex,
       };
     }
 
     let browser = this.selectedBrowser;
     let hist = browser.sessionHistory.legacySHistory;
     for (let i = toIndex; i >= fromIndex; i--) {
       let entry = hist.getEntryAtIndex(i);
       let item = {
         title: entry.title || entry.URI.displaySpec,
         url: entry.URI.displaySpec,
-        selected: (i == selIndex),
+        selected: i == selIndex,
       };
       listitems.push(item);
     }
 
     return {
-      "historyItems": listitems,
-      "toIndex": toIndex,
+      historyItems: listitems,
+      toIndex: toIndex,
     };
   },
 };
 
 async function notifyManifestStatus(tab) {
   try {
     const manifest = await Manifests.getManifest(tab.browser);
-    const evtType = (manifest && manifest.installed) ?
-      "Website:AppEntered" : "Website:AppLeft";
+    const evtType =
+      manifest && manifest.installed ? "Website:AppEntered" : "Website:AppLeft";
 
     GlobalEventDispatcher.sendRequest({
       type: evtType,
       tabId: tab.id,
     });
   } catch (err) {
     Cu.reportError("Error sending status: " + err.message);
   }
@@ -2327,96 +2931,103 @@ var NativeWindow = {
     _callbacks: [],
     // This value must be kept in sync with GECKO_TOOLS_MENU_UUID in AddonUICache.java.
     toolsMenuID: "{115b9308-2023-44f1-a4e9-3e2197669f07}",
     add: function() {
       let options;
       if (arguments.length == 1) {
         options = arguments[0];
       } else if (arguments.length == 3) {
-          Log.w("Browser", "This menu addon API has been deprecated. Instead, use the options object API.");
-          options = {
-            name: arguments[0],
-            callback: arguments[2],
-          };
+        Log.w(
+          "Browser",
+          "This menu addon API has been deprecated. Instead, use the options object API."
+        );
+        options = {
+          name: arguments[0],
+          callback: arguments[2],
+        };
       } else {
-         throw new Error("Incorrect number of parameters");
+        throw new Error("Incorrect number of parameters");
       }
 
       options.type = "Menu:Add";
       options.uuid = uuidgen.generateUUID().toString();
 
       GlobalEventDispatcher.sendRequest(options);
       this._callbacks[options.uuid] = options.callback;
       return options.uuid;
     },
 
     remove: function(aUuid) {
       GlobalEventDispatcher.sendRequest({ type: "Menu:Remove", uuid: aUuid });
     },
 
     update: function(aUuid, aOptions) {
-      if (!aOptions)
+      if (!aOptions) {
         return;
+      }
 
       GlobalEventDispatcher.sendRequest({
         type: "Menu:Update",
         uuid: aUuid,
         options: aOptions,
       });
     },
   },
 
   doorhanger: {
     _callbacks: {},
     _callbacksId: 0,
     _promptId: 0,
 
-  /**
-   * @param aOptions
-   *        An options JavaScript object holding additional properties for the
-   *        notification. The following properties are currently supported:
-   *        persistence: An integer. The notification will not automatically
-   *                     dismiss for this many page loads. If persistence is set
-   *                     to -1, the doorhanger will never automatically dismiss.
-   *        persistWhileVisible:
-   *                     A boolean. If true, a visible notification will always
-   *                     persist across location changes.
-   *        timeout:     A time in milliseconds. The notification will not
-   *                     automatically dismiss before this time.
-   *
-   *        checkbox:    A string to appear next to a checkbox under the notification
-   *                     message. The button callback functions will be called with
-   *                     the checked state as an argument.
-   *
-   *        actionText:  An object that specifies a clickable string, a type of action,
-   *                     and a bundle blob for the consumer to create a click action.
-   *                     { text: <text>,
-   *                       type: <type>,
-   *                       bundle: <blob-object> }
-   *
-   *        defaultCallback:
-   *                     Callback invoked when the doorhanger is dismissed without
-   *                     pressing a button.
-   *
-   * @param aCategory
-   *        Doorhanger type to display (e.g., LOGIN)
-   */
+    /**
+     * @param aOptions
+     *        An options JavaScript object holding additional properties for the
+     *        notification. The following properties are currently supported:
+     *        persistence: An integer. The notification will not automatically
+     *                     dismiss for this many page loads. If persistence is set
+     *                     to -1, the doorhanger will never automatically dismiss.
+     *        persistWhileVisible:
+     *                     A boolean. If true, a visible notification will always
+     *                     persist across location changes.
+     *        timeout:     A time in milliseconds. The notification will not
+     *                     automatically dismiss before this time.
+     *
+     *        checkbox:    A string to appear next to a checkbox under the notification
+     *                     message. The button callback functions will be called with
+     *                     the checked state as an argument.
+     *
+     *        actionText:  An object that specifies a clickable string, a type of action,
+     *                     and a bundle blob for the consumer to create a click action.
+     *                     { text: <text>,
+     *                       type: <type>,
+     *                       bundle: <blob-object> }
+     *
+     *        defaultCallback:
+     *                     Callback invoked when the doorhanger is dismissed without
+     *                     pressing a button.
+     *
+     * @param aCategory
+     *        Doorhanger type to display (e.g., LOGIN)
+     */
     show: function(aMessage, aValue, aButtons, aTabID, aOptions, aCategory) {
       if (aButtons == null) {
         aButtons = [];
       }
 
       if (aButtons.length > 2) {
         console.warn("Doorhanger can have a maximum of two buttons!");
         aButtons.length = 2;
       }
 
       aButtons.forEach(aButton => {
-        this._callbacks[this._callbacksId] = { cb: aButton.callback, prompt: this._promptId };
+        this._callbacks[this._callbacksId] = {
+          cb: aButton.callback,
+          prompt: this._promptId,
+        };
         aButton.callback = this._callbacksId;
         this._callbacksId++;
       });
 
       this._callbacks[this._callbacksId] = {
         cb: aOptions && aOptions.defaultCallback,
         prompt: this._promptId,
       };
@@ -2476,232 +3087,270 @@ var NativeWindow = {
   },
 
   contextmenus: {
     items: {}, //  a list of context menu items that we may show
     DEFAULT_HTML5_ORDER: -1, // Sort order for HTML5 context menu items
 
     init: function() {
       // Accessing "NativeWindow.contextmenus" initializes context menus if needed.
-      BrowserApp.deck.addEventListener(
-          "contextmenu", (e) => NativeWindow.contextmenus.show(e));
+      BrowserApp.deck.addEventListener("contextmenu", e =>
+        NativeWindow.contextmenus.show(e)
+      );
     },
 
     add: function() {
       let args;
       if (arguments.length == 1) {
         args = arguments[0];
       } else if (arguments.length == 3) {
         args = {
           label: arguments[0],
           selector: arguments[1],
           callback: arguments[2],
         };
       } else {
         throw new Error("Incorrect number of parameters");
       }
 
-      if (!args.label)
+      if (!args.label) {
         throw new Error("Menu items must have a name");
+      }
 
       let cmItem = new ContextMenuItem(args);
       this.items[cmItem.id] = cmItem;
       return cmItem.id;
     },
 
     remove: function(aId) {
       delete this.items[aId];
     },
 
     // Although we do not use this ourselves anymore, add-ons may still
     // need it as it has been documented, so we shouldn't remove it.
     SelectorContext: function(aSelector) {
       return {
         matches: function(aElt) {
-          if (aElt.matches)
+          if (aElt.matches) {
             return aElt.matches(aSelector);
+          }
           return false;
         },
       };
     },
 
     linkOpenableNonPrivateContext: {
       matches: function linkOpenableNonPrivateContextMatches(aElement) {
         let doc = aElement.ownerDocument;
-        if (!doc || PrivateBrowsingUtils.isContentWindowPrivate(doc.defaultView)) {
+        if (
+          !doc ||
+          PrivateBrowsingUtils.isContentWindowPrivate(doc.defaultView)
+        ) {
           return false;
         }
 
         return NativeWindow.contextmenus.linkOpenableContext.matches(aElement);
       },
     },
 
     linkOpenableContext: {
       matches: function linkOpenableContextMatches(aElement) {
         let uri = NativeWindow.contextmenus._getLink(aElement);
         if (uri) {
           let scheme = uri.scheme;
           let dontOpen = /^(javascript|mailto|news|snews|tel)$/;
-          return (scheme && !dontOpen.test(scheme));
+          return scheme && !dontOpen.test(scheme);
         }
         return false;
       },
     },
 
     linkCopyableContext: {
       matches: function linkCopyableContextMatches(aElement) {
         let uri = NativeWindow.contextmenus._getLink(aElement);
         if (uri) {
           let scheme = uri.scheme;
           let dontCopy = /^(mailto|tel)$/;
-          return (scheme && !dontCopy.test(scheme));
+          return scheme && !dontCopy.test(scheme);
         }
         return false;
       },
     },
 
     linkShareableContext: {
       matches: function linkShareableContextMatches(aElement) {
         let uri = NativeWindow.contextmenus._getLink(aElement);
         if (uri) {
           let scheme = uri.scheme;
           let dontShare = /^(about|chrome|file|javascript|mailto|resource|tel)$/;
-          return (scheme && !dontShare.test(scheme));
+          return scheme && !dontShare.test(scheme);
         }
         return false;
       },
     },
 
     linkBookmarkableContext: {
       matches: function linkBookmarkableContextMatches(aElement) {
         let uri = NativeWindow.contextmenus._getLink(aElement);
         if (uri) {
           let scheme = uri.scheme;
           let dontBookmark = /^(mailto|tel)$/;
-          return (scheme && !dontBookmark.test(scheme));
+          return scheme && !dontBookmark.test(scheme);
         }
         return false;
       },
     },
 
     emailLinkContext: {
       matches: function emailLinkContextMatches(aElement) {
         let uri = NativeWindow.contextmenus._getLink(aElement);
-        if (uri)
+        if (uri) {
           return uri.schemeIs("mailto");
+        }
         return false;
       },
     },
 
     phoneNumberLinkContext: {
       matches: function phoneNumberLinkContextMatches(aElement) {
         let uri = NativeWindow.contextmenus._getLink(aElement);
-        if (uri)
+        if (uri) {
           return uri.schemeIs("tel");
+        }
         return false;
       },
     },
 
     imageLocationCopyableContext: {
       matches: function imageLinkCopyableContextMatches(aElement) {
         if (ChromeUtils.getClassName(aElement) === "HTMLImageElement") {
           // The image is blocked by Tap-to-load Images
-          if (aElement.hasAttribute("data-ctv-src") && !aElement.hasAttribute("data-ctv-show")) {
+          if (
+            aElement.hasAttribute("data-ctv-src") &&
+            !aElement.hasAttribute("data-ctv-show")
+          ) {
             return false;
           }
         }
-        return (aElement instanceof Ci.nsIImageLoadingContent && aElement.currentURI);
+        return (
+          aElement instanceof Ci.nsIImageLoadingContent && aElement.currentURI
+        );
       },
     },
 
     imageSaveableContext: {
       matches: function imageSaveableContextMatches(aElement) {
         if (ChromeUtils.getClassName(aElement) === "HTMLImageElement") {
           // The image is blocked by Tap-to-load Images
-          if (aElement.hasAttribute("data-ctv-src") && !aElement.hasAttribute("data-ctv-show")) {
+          if (
+            aElement.hasAttribute("data-ctv-src") &&
+            !aElement.hasAttribute("data-ctv-show")
+          ) {
             return false;
           }
         }
-        if (aElement instanceof Ci.nsIImageLoadingContent && aElement.currentURI) {
+        if (
+          aElement instanceof Ci.nsIImageLoadingContent &&
+          aElement.currentURI
+        ) {
           // The image must be loaded to allow saving
-          let request = aElement.getRequest(Ci.nsIImageLoadingContent.CURRENT_REQUEST);
-          return (request && (request.imageStatus & request.STATUS_SIZE_AVAILABLE));
+          let request = aElement.getRequest(
+            Ci.nsIImageLoadingContent.CURRENT_REQUEST
+          );
+          return request && request.imageStatus & request.STATUS_SIZE_AVAILABLE;
         }
         return false;
       },
     },
 
     imageShareableContext: {
       matches: aElement => {
         let imgSrc = "";
         if (ChromeUtils.getClassName(aElement) === "HTMLImageElement") {
           imgSrc = aElement.src;
-        } else if (aElement instanceof Ci.nsIImageLoadingContent &&
-            aElement.currentURI &&
-            aElement.currentURI.spec) {
+        } else if (
+          aElement instanceof Ci.nsIImageLoadingContent &&
+          aElement.currentURI &&
+          aElement.currentURI.spec
+        ) {
           imgSrc = aElement.currentURI.spec;
         }
 
         // In order to share an image, we need to pass the image src over IPC via an Intent (in
         // `ApplicationPackageManager.queryIntentActivities`). However, the transaction has a 1MB limit
         // (shared by all transactions in progress) - otherwise we crash! (bug 1243305)
         //   https://developer.android.com/reference/android/os/TransactionTooLargeException.html
         //
         // The transaction limit is 1MB and we arbitrarily choose to cap this transaction at 1/4 of that = 250,000 bytes.
         // In Java, a UTF-8 character is 1-4 bytes so, 250,000 bytes / 4 bytes/char = 62,500 char
         let MAX_IMG_SRC_LEN = 62500;
         let isTooLong = imgSrc.length >= MAX_IMG_SRC_LEN;
-        return !isTooLong && this.NativeWindow.contextmenus.imageSaveableContext.matches(aElement);
+        return (
+          !isTooLong &&
+          this.NativeWindow.contextmenus.imageSaveableContext.matches(aElement)
+        );
       },
     },
 
     mediaSaveableContext: {
       matches: function mediaSaveableContextMatches(aElement) {
-        return (aElement instanceof HTMLVideoElement ||
-               aElement instanceof HTMLAudioElement);
+        return (
+          aElement instanceof HTMLVideoElement ||
+          aElement instanceof HTMLAudioElement
+        );
       },
     },
 
     imageBlockingPolicyContext: {
       matches: function imageBlockingPolicyContextMatches(aElement) {
-        if (ChromeUtils.getClassName(aElement) === "HTMLImageElement" &&
-            aElement.getAttribute("data-ctv-src")) {
+        if (
+          ChromeUtils.getClassName(aElement) === "HTMLImageElement" &&
+          aElement.getAttribute("data-ctv-src")
+        ) {
           // Only show the menuitem if we are blocking the image
           if (aElement.getAttribute("data-ctv-show") == "true") {
             return false;
           }
           return true;
         }
         return false;
       },
     },
 
     mediaContext: function(aMode) {
       return {
         matches: function(aElt) {
-          if (ChromeUtils.getClassName(aElt) === "HTMLVideoElement" ||
-              ChromeUtils.getClassName(aElt) === "HTMLAudioElement") {
-            let hasError = aElt.error != null || aElt.networkState == aElt.NETWORK_NO_SOURCE;
-            if (hasError)
+          if (
+            ChromeUtils.getClassName(aElt) === "HTMLVideoElement" ||
+            ChromeUtils.getClassName(aElt) === "HTMLAudioElement"
+          ) {
+            let hasError =
+              aElt.error != null || aElt.networkState == aElt.NETWORK_NO_SOURCE;
+            if (hasError) {
               return false;
+            }
 
             let paused = aElt.paused || aElt.ended;
-            if (paused && aMode == "media-paused")
+            if (paused && aMode == "media-paused") {
               return true;
-            if (!paused && aMode == "media-playing")
+            }
+            if (!paused && aMode == "media-playing") {
               return true;
+            }
             let controls = aElt.controls;
-            if (!controls && aMode == "media-hidingcontrols")
+            if (!controls && aMode == "media-hidingcontrols") {
               return true;
+            }
 
             let muted = aElt.muted;
-            if (muted && aMode == "media-muted")
+            if (muted && aMode == "media-muted") {
               return true;
-            else if (!muted && aMode == "media-unmuted")
+            } else if (!muted && aMode == "media-unmuted") {
               return true;
+            }
           }
           return false;
         },
       };
     },
 
     videoContext: function(aMode) {
       return {
@@ -2723,30 +3372,35 @@ var NativeWindow = {
       };
     },
 
     /* Holds a WeakRef to the original target element this context menu was shown for.
      * Most API's will have to walk up the tree from this node to find the correct element
      * to act on
      */
     get _target() {
-      if (this._targetRef)
+      if (this._targetRef) {
         return this._targetRef.get();
+      }
       return null;
     },
 
     set _target(aTarget) {
-      if (aTarget)
+      if (aTarget) {
         this._targetRef = Cu.getWeakReference(aTarget);
-      else this._targetRef = null;
+      } else {
+        this._targetRef = null;
+      }
     },
 
     get defaultContext() {
       delete this.defaultContext;
-      return this.defaultContext = Strings.browser.GetStringFromName("browser.menu.context.default");
+      return (this.defaultContext = Strings.browser.GetStringFromName(
+        "browser.menu.context.default"
+      ));
     },
 
     get nonLinkContext() {
       return "";
     },
 
     /* Gets menuitems for an arbitrary node
      * Parameters:
@@ -2768,18 +3422,19 @@ var NativeWindow = {
      * Parameters:
      *   menu - The <menu> element to iterate through for menuitems
      *   target - The target element these context menu items are attached to
      */
     _getHTMLContextMenuItemsForMenu: function(menu, target) {
       let items = [];
       for (let i = 0; i < menu.childNodes.length; i++) {
         let elt = menu.childNodes[i];
-        if (!elt.label)
+        if (!elt.label) {
           continue;
+        }
 
         items.push(new HTMLContextMenuItem(elt, target));
       }
 
       return items;
     },
 
     // Searches the current list of menuitems to show for any that match this id
@@ -2827,27 +3482,31 @@ var NativeWindow = {
     /* Returns a label to be shown in a tabbed ui if there are multiple "contexts". For instance, if this
      * is an image inside an <a> tag, we may have a "link" context and an "image" one.
      */
     _getContextType: function(element) {
       // For anchor nodes, we try to use the scheme to pick a string
       if (ChromeUtils.getClassName(element) === "HTMLAnchorElement") {
         try {
           let uri = this.makeURI(this._getLinkURL(element));
-          return Strings.browser.GetStringFromName("browser.menu.context." + uri.scheme);
+          return Strings.browser.GetStringFromName(
+            "browser.menu.context." + uri.scheme
+          );
         } catch (ex) {
           // Fallback to the default
           return this.defaultContext;
         }
       }
 
       // Otherwise we try the nodeName
       try {
-        return Strings.browser.GetStringFromName("browser.menu.context." + element.nodeName.toLowerCase());
-      } catch (ex) { }
+        return Strings.browser.GetStringFromName(
+          "browser.menu.context." + element.nodeName.toLowerCase()
+        );
+      } catch (ex) {}
 
       return this.nonLinkContext;
     },
 
     // Adds context menu items added through the add-on api
     _getNativeContextMenuItems: function(element, x, y) {
       let res = [];
       for (let itemId of Object.keys(this.items)) {
@@ -2876,17 +3535,18 @@ var NativeWindow = {
       // If the event was already defaultPrevented by somebody (web content, or
       // some other part of gecko), then don't do anything with it.
       if (event.defaultPrevented) {
         return;
       }
 
       // Use the highlighted element for the context menu target. When accessibility is
       // enabled, elements may not be highlighted so use the event target instead.
-      this._target = BrowserEventHandler._highlightElement || event.composedTarget;
+      this._target =
+        BrowserEventHandler._highlightElement || event.composedTarget;
       if (!this._target) {
         return;
       }
 
       // Find the HTMLMediaElement host if the element is inside video controls UA Widget.
       this._target = this._findMediaElementHostFromControls(this._target);
 
       // Try to build a list of contextmenu items. If successful, actually show the
@@ -2903,58 +3563,64 @@ var NativeWindow = {
         this._target = null;
 
         return;
       }
 
       // If no context-menu for long-press event, it may be meant to trigger text-selection.
       this.menus = null;
       Services.obs.notifyObservers(
-        {target: this._target, x: event.clientX, y: event.clientY}, "context-menu-not-shown");
+        { target: this._target, x: event.clientX, y: event.clientY },
+        "context-menu-not-shown"
+      );
     },
 
     // Returns a title for a context menu. If no title attribute exists, will fall back to looking for a url
     _getTitle: function(node) {
       if (node.hasAttribute && node.hasAttribute("title")) {
         return node.getAttribute("title");
       }
       let url = this._getUrl(node);
       let readerUrl = ReaderMode.getOriginalUrlObjectForDisplay(url);
 
       return (readerUrl && readerUrl.displaySpec) || url;
     },
 
     // Returns a url associated with a node
     _getUrl: function(node) {
-      if ((ChromeUtils.getClassName(node) === "HTMLAnchorElement" && node.href) ||
-          (ChromeUtils.getClassName(node) === "HTMLAreaElement" && node.href)) {
+      if (
+        (ChromeUtils.getClassName(node) === "HTMLAnchorElement" && node.href) ||
+        (ChromeUtils.getClassName(node) === "HTMLAreaElement" && node.href)
+      ) {
         return this._getLinkURL(node);
       } else if (node instanceof Ci.nsIImageLoadingContent && node.currentURI) {
         // The image is blocked by Tap-to-load Images
         let originalURL = node.getAttribute("data-ctv-src");
         if (originalURL) {
           return originalURL;
         }
         return node.currentURI.displaySpec;
-      } else if (ChromeUtils.getClassName(node) === "HTMLVideoElement" ||
-                 ChromeUtils.getClassName(node) === "HTMLAudioElement") {
+      } else if (
+        ChromeUtils.getClassName(node) === "HTMLVideoElement" ||
+        ChromeUtils.getClassName(node) === "HTMLAudioElement"
+      ) {
         let srcUrl = node.currentSrc || node.src;
         // If URL prepended with blob or mediasource, we'll remove it.
         return srcUrl.replace(/^(?:blob|mediasource):/, "");
       }
 
       return "";
     },
 
     // Adds an array of menuitems to the current list of items to show, in the correct context
     _addMenuItems: function(items, context) {
-        if (!this.menus[context]) {
-          this.menus[context] = [];
-        }
-        this.menus[context] = this.menus[context].concat(items);
+      if (!this.menus[context]) {
+        this.menus[context] = [];
+      }
+      this.menus[context] = this.menus[context].concat(items);
     },
 
     _findMediaElementHostFromControls(element) {
       if (!(element instanceof HTMLMediaElement)) {
         let n = element;
         while (n) {
           if (n instanceof ShadowRoot) {
             if (n.host instanceof HTMLMediaElement) {
@@ -3105,17 +3771,17 @@ var NativeWindow = {
       let title = this._findTitle(target);
 
       for (let context in this.menus) {
         let menu = this.menus[context];
         menu.sort((a, b) => {
           if (a.order === b.order) {
             return 0;
           }
-          return (a.order > b.order) ? 1 : -1;
+          return a.order > b.order ? 1 : -1;
         });
       }
 
       let useTabs = Object.keys(this.menus).length > 1;
       let prompt = new Prompt({
         window: target.ownerGlobal,
         title: useTabs ? undefined : title,
       });
@@ -3171,21 +3837,25 @@ var NativeWindow = {
       return this.makeURI(url, null, this.makeURI(base)).displaySpec;
     },
 
     makeURI: function makeURI(aURL, aOriginCharset, aBaseURI) {
       return Services.io.newURI(aURL, aOriginCharset, aBaseURI);
     },
 
     _getLink: function(aElement) {
-      if (aElement.nodeType == aElement.ELEMENT_NODE &&
-          ((ChromeUtils.getClassName(aElement) === "HTMLAnchorElement" && aElement.href) ||
-           (ChromeUtils.getClassName(aElement) === "HTMLAreaElement" && aElement.href) ||
-           ChromeUtils.getClassName(aElement) === "HTMLLinkElement" ||
-           aElement.getAttributeNS(kXLinkNamespace, "type") == "simple")) {
+      if (
+        aElement.nodeType == aElement.ELEMENT_NODE &&
+        ((ChromeUtils.getClassName(aElement) === "HTMLAnchorElement" &&
+          aElement.href) ||
+          (ChromeUtils.getClassName(aElement) === "HTMLAreaElement" &&
+            aElement.href) ||
+          ChromeUtils.getClassName(aElement) === "HTMLLinkElement" ||
+          aElement.getAttributeNS(kXLinkNamespace, "type") == "simple")
+      ) {
         try {
           let url = this._getLinkURL(aElement);
           return Services.io.newURI(url);
         } catch (e) {}
       }
       return null;
     },
 
@@ -3202,109 +3872,127 @@ var NativeWindow = {
     },
 
     _getLinkURL: function ch_getLinkURL(aLink) {
       let href = aLink.href;
       if (href) {
         return this.makeURI(href).displaySpec;
       }
 
-      href = aLink.getAttribute("href") ||
-             aLink.getAttributeNS(kXLinkNamespace, "href");
+      href =
+        aLink.getAttribute("href") ||
+        aLink.getAttributeNS(kXLinkNamespace, "href");
       if (!href || !href.match(/\S/)) {
         // Without this we try to save as the current doc,
         // for example, HTML case also throws if empty
         throw new Error("Empty href");
       }
 
       return this.makeURLAbsolute(aLink.baseURI, href);
     },
 
     _copyStringToDefaultClipboard: function(aString) {
-      let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper);
+      let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(
+        Ci.nsIClipboardHelper
+      );
       clipboard.copyString(aString);
-      Snackbars.show(Strings.browser.GetStringFromName("selectionHelper.textCopied"), Snackbars.LENGTH_LONG);
+      Snackbars.show(
+        Strings.browser.GetStringFromName("selectionHelper.textCopied"),
+        Snackbars.LENGTH_LONG
+      );
     },
 
     _stripScheme: function(aString) {
       let index = aString.indexOf(":");
       return aString.slice(index + 1);
     },
 
     _stripViewSource: function(aString) {
       // If we're in a view source tab, remove the view-source: prefix
       return aString.replace(/^view-source:/, "");
     },
   },
 };
 
-ChromeUtils.defineModuleGetter(this, "PageActions",
-                               "resource://gre/modules/PageActions.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PageActions",
+  "resource://gre/modules/PageActions.jsm"
+);
 
 // These alias to the old, deprecated NativeWindow interfaces
 [
   ["pageactions", "resource://gre/modules/PageActions.jsm", "PageActions"],
   ["toast", "resource://gre/modules/Snackbars.jsm", "Snackbars"],
 ].forEach(item => {
   let [name, script, exprt] = item;
 
   XPCOMUtils.defineLazyGetter(NativeWindow, name, () => {
-    var err = Strings.browser.formatStringFromName("nativeWindow.deprecated", ["NativeWindow." + name, script]);
+    var err = Strings.browser.formatStringFromName("nativeWindow.deprecated", [
+      "NativeWindow." + name,
+      script,
+    ]);
     Cu.reportError(err);
 
     let sandbox = {};
     ChromeUtils.import(script, sandbox);
     return sandbox[exprt];
   });
 });
 
 var LightWeightThemeStuff = {
   init: function sh_init() {
-    ChromeUtils.defineModuleGetter(this, "LightweightThemeManager",
-                                   "resource://gre/modules/LightweightThemeManager.jsm");
-
-    if (ParentalControls.parentalControlsEnabled &&
-        ParentalControls.isAllowed(ParentalControls.DEFAULT_THEME)) {
+    ChromeUtils.defineModuleGetter(
+      this,
+      "LightweightThemeManager",
+      "resource://gre/modules/LightweightThemeManager.jsm"
+    );
+
+    if (
+      ParentalControls.parentalControlsEnabled &&
+      ParentalControls.isAllowed(ParentalControls.DEFAULT_THEME)
+    ) {
       // We are using the DEFAULT_THEME restriction to differentiate between restricted profiles & guest mode - Bug 1199596
-      let {theme} = this.LightweightThemeManager.themeData;
+      let { theme } = this.LightweightThemeManager.themeData;
       if (!theme || theme.id == "default-theme@mozilla.org") {
         this._installParentalControlsTheme();
       }
     }
 
-    let {LightweightThemeConsumer} =
-        ChromeUtils.import("resource://gre/modules/LightweightThemeConsumer.jsm");
+    let { LightweightThemeConsumer } = ChromeUtils.import(
+      "resource://gre/modules/LightweightThemeConsumer.jsm"
+    );
     new LightweightThemeConsumer(document);
   },
 
   _installParentalControlsTheme: function() {
     this.LightweightThemeManager.fallbackThemeData = {
       theme: {
-        "headerURL": "resource://android/assets/parental_controls_theme.png",
-        "name": "Parental Controls Theme",
-        "id": "parental-controls-theme@mozilla.org",
+        headerURL: "resource://android/assets/parental_controls_theme.png",
+        name: "Parental Controls Theme",
+        id: "parental-controls-theme@mozilla.org",
       },
     };
   },
 };
 
 var DesktopUserAgent = {
   DESKTOP_UA: null,
   TCO_DOMAIN: "t.co",
   TCO_REPLACE: / Gecko.*/,
 
   init: function ua_init() {
     GlobalEventDispatcher.registerListener(this, "DesktopMode:Change");
     UserAgentOverrides.addComplexOverride(this.onRequest.bind(this));
 
     // See https://developer.mozilla.org/en/Gecko_user_agent_string_reference
     this.DESKTOP_UA = Cc["@mozilla.org/network/protocol;1?name=http"]
-                        .getService(Ci.nsIHttpProtocolHandler).userAgent
-                        .replace(/Android \d.+?; [a-zA-Z]+/, "X11; Linux x86_64")
-                        .replace(/Gecko\/[0-9\.]+/, "Gecko/20100101");
+      .getService(Ci.nsIHttpProtocolHandler)
+      .userAgent.replace(/Android \d.+?; [a-zA-Z]+/, "X11; Linux x86_64")
+      .replace(/Gecko\/[0-9\.]+/, "Gecko/20100101");
   },
 
   onRequest: function(channel, defaultUA) {
     if (AppConstants.NIGHTLY_BUILD && this.TCO_DOMAIN == channel.URI.host) {
       // Force the referrer
       channel.referrer = channel.URI;
 
       // Send a bot-like UA to t.co to get a real redirect. We strip off the
@@ -3329,23 +4017,29 @@ var DesktopUserAgent = {
 
     return null;
   },
 
   _getRequestLoadContext: function ua_getRequestLoadContext(aRequest) {
     if (aRequest && aRequest.notificationCallbacks) {
       try {
         return aRequest.notificationCallbacks.getInterface(Ci.nsILoadContext);
-      } catch (ex) { }
-    }
-
-    if (aRequest && aRequest.loadGroup && aRequest.loadGroup.notificationCallbacks) {
+      } catch (ex) {}
+    }
+
+    if (
+      aRequest &&
+      aRequest.loadGroup &&
+      aRequest.loadGroup.notificationCallbacks
+    ) {
       try {
-        return aRequest.loadGroup.notificationCallbacks.getInterface(Ci.nsILoadContext);
-      } catch (ex) { }
+        return aRequest.loadGroup.notificationCallbacks.getInterface(
+          Ci.nsILoadContext
+        );
+      } catch (ex) {}
     }
 
     return null;
   },
 
   _getWindowForRequest: function ua_getWindowForRequest(aRequest) {
     let loadContext = this._getRequestLoadContext(aRequest);
     if (loadContext) {
@@ -3363,52 +4057,60 @@ var DesktopUserAgent = {
       let tab = BrowserApp.getTabForId(data.tabId);
       if (tab) {
         tab.reloadWithMode(data.desktopMode);
       }
     }
   },
 };
 
-
-function nsBrowserAccess() {
-}
+function nsBrowserAccess() {}
 
 nsBrowserAccess.prototype = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsIBrowserDOMWindow]),
 
   // eslint-disable-next-line complexity
-  _getBrowser: function _getBrowser(aURI, aOpener, aWhere, aFlags, aTriggeringPrincipal, aCsp) {
+  _getBrowser: function _getBrowser(
+    aURI,
+    aOpener,
+    aWhere,
+    aFlags,
+    aTriggeringPrincipal,
+    aCsp
+  ) {
     let isExternal = !!(aFlags & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
-    if (isExternal && aURI && aURI.schemeIs("chrome"))
+    if (isExternal && aURI && aURI.schemeIs("chrome")) {
       return null;
-
-    let loadflags = isExternal ?
-                      Ci.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL :
-                      Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
+    }
+
+    let loadflags = isExternal
+      ? Ci.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL
+      : Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
     if (aWhere == Ci.nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW) {
       if (isExternal) {
         aWhere = Services.prefs.getIntPref("browser.link.open_external");
       } else {
         aWhere = Services.prefs.getIntPref("browser.link.open_newwindow");
       }
     }
 
     Services.io.offline = false;
 
     let referrer;
     let forceNoReferrer = !!(aFlags & Ci.nsIBrowserDOMWindow.OPEN_NO_REFERRER);
     if (aOpener) {
       try {
         let location = aOpener.location;
         referrer = forceNoReferrer ? null : Services.io.newURI(location);
-      } catch (e) { }
-    }
-