Bug 1561435 - Format toolkit/modules/, a=automatic-formatting
authorVictor Porof <vporof@mozilla.com>
Fri, 05 Jul 2019 11:15:43 +0200
changeset 481426 e5be4c59b7f15f98fabb32a68fc64050ddb62bcb
parent 481425 b8561ed633b2d32582f0503e60aae8c95bda9ba4
child 481427 58fd5776802aa7dd7e6d3fddd7d433da5ef30426
push id36243
push uservporof@mozilla.com
push dateFri, 05 Jul 2019 14:04:25 +0000
treeherdermozilla-central@041abaa4aa85 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatic-formatting
bugs1561435
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1561435 - Format toolkit/modules/, a=automatic-formatting # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D36056
toolkit/modules/AboutPagesUtils.jsm
toolkit/modules/ActorManagerChild.jsm
toolkit/modules/ActorManagerParent.jsm
toolkit/modules/AppMenuNotifications.jsm
toolkit/modules/AsyncPrefs.jsm
toolkit/modules/AutoCompletePopupContent.jsm
toolkit/modules/AutoScrollController.jsm
toolkit/modules/BinarySearch.jsm
toolkit/modules/BrowserUtils.jsm
toolkit/modules/CanonicalJSON.jsm
toolkit/modules/CertUtils.jsm
toolkit/modules/CharsetMenu.jsm
toolkit/modules/Color.jsm
toolkit/modules/Console.jsm
toolkit/modules/ContentDOMReference.jsm
toolkit/modules/CreditCard.jsm
toolkit/modules/DateTimePickerPanel.jsm
toolkit/modules/DeferredTask.jsm
toolkit/modules/Deprecated.jsm
toolkit/modules/E10SUtils.jsm
toolkit/modules/EventEmitter.jsm
toolkit/modules/FileUtils.jsm
toolkit/modules/FindBarContent.jsm
toolkit/modules/Finder.jsm
toolkit/modules/FinderHighlighter.jsm
toolkit/modules/FinderIterator.jsm
toolkit/modules/FinderParent.jsm
toolkit/modules/FormLikeFactory.jsm
toolkit/modules/GMPExtractorWorker.js
toolkit/modules/GMPInstallManager.jsm
toolkit/modules/GMPUtils.jsm
toolkit/modules/Geometry.jsm
toolkit/modules/HiddenFrame.jsm
toolkit/modules/Http.jsm
toolkit/modules/IndexedDB.jsm
toolkit/modules/InlineSpellChecker.jsm
toolkit/modules/InlineSpellCheckerContent.jsm
toolkit/modules/Integration.jsm
toolkit/modules/JSONFile.jsm
toolkit/modules/LightweightThemeConsumer.jsm
toolkit/modules/Log.jsm
toolkit/modules/NLP.jsm
toolkit/modules/NewTabUtils.jsm
toolkit/modules/ObjectUtils.jsm
toolkit/modules/PageMenu.jsm
toolkit/modules/PermissionsUtils.jsm
toolkit/modules/PopupNotifications.jsm
toolkit/modules/Preferences.jsm
toolkit/modules/PrivateBrowsingUtils.jsm
toolkit/modules/ProfileAge.jsm
toolkit/modules/Promise-backend.js
toolkit/modules/Promise.jsm
toolkit/modules/PromiseMessage.jsm
toolkit/modules/PromiseUtils.jsm
toolkit/modules/PropertyListUtils.jsm
toolkit/modules/RemoteController.js
toolkit/modules/RemoteSecurityUI.jsm
toolkit/modules/RemoteWebProgress.jsm
toolkit/modules/ResetProfile.jsm
toolkit/modules/ResponsivenessMonitor.jsm
toolkit/modules/ServiceRequest.jsm
toolkit/modules/Services.jsm
toolkit/modules/ShortcutUtils.jsm
toolkit/modules/Sqlite.jsm
toolkit/modules/Timer.jsm
toolkit/modules/Troubleshoot.jsm
toolkit/modules/UpdateUtils.jsm
toolkit/modules/WebChannel.jsm
toolkit/modules/WebProgressChild.jsm
toolkit/modules/WindowsRegistry.jsm
toolkit/modules/ZipUtils.jsm
toolkit/modules/css-selector.js
toolkit/modules/offlineAppCache.jsm
toolkit/modules/secondscreen/RokuApp.jsm
toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm
toolkit/modules/sessionstore/PrivacyFilter.jsm
toolkit/modules/sessionstore/PrivacyLevel.jsm
toolkit/modules/sessionstore/SessionHistory.jsm
toolkit/modules/sessionstore/Utils.jsm
toolkit/modules/subprocess/Subprocess.jsm
toolkit/modules/subprocess/subprocess_common.jsm
toolkit/modules/subprocess/subprocess_shared_unix.js
toolkit/modules/subprocess/subprocess_shared_win.js
toolkit/modules/subprocess/subprocess_unix.jsm
toolkit/modules/subprocess/subprocess_win.jsm
toolkit/modules/subprocess/subprocess_worker_common.js
toolkit/modules/subprocess/subprocess_worker_unix.js
toolkit/modules/subprocess/subprocess_worker_win.js
toolkit/modules/subprocess/test/xpcshell/head.js
toolkit/modules/subprocess/test/xpcshell/test_subprocess.js
toolkit/modules/subprocess/test/xpcshell/test_subprocess_getEnvironment.js
toolkit/modules/subprocess/test/xpcshell/test_subprocess_pathSearch.js
toolkit/modules/tests/browser/browser_AsyncPrefs.js
toolkit/modules/tests/browser/browser_BrowserUtils.js
toolkit/modules/tests/browser/browser_CreditCard.js
toolkit/modules/tests/browser/browser_Deprecated.js
toolkit/modules/tests/browser/browser_Finder.js
toolkit/modules/tests/browser/browser_FinderHighlighter.js
toolkit/modules/tests/browser/browser_FinderHighlighter2.js
toolkit/modules/tests/browser/browser_Finder_hidden_textarea.js
toolkit/modules/tests/browser/browser_Finder_offscreen_text.js
toolkit/modules/tests/browser/browser_Finder_overflowed_onscreen.js
toolkit/modules/tests/browser/browser_Finder_overflowed_textarea.js
toolkit/modules/tests/browser/browser_Finder_pointer_events_none.js
toolkit/modules/tests/browser/browser_Finder_skip_invisible_and_option.js
toolkit/modules/tests/browser/browser_Finder_vertical_text.js
toolkit/modules/tests/browser/browser_Geometry.js
toolkit/modules/tests/browser/browser_InlineSpellChecker.js
toolkit/modules/tests/browser/browser_PromiseMessage.js
toolkit/modules/tests/browser/browser_Troubleshoot.js
toolkit/modules/tests/browser/head.js
toolkit/modules/tests/modules/MockDocument.jsm
toolkit/modules/tests/modules/PromiseTestUtils.jsm
toolkit/modules/tests/modules/Task.jsm
toolkit/modules/tests/xpcshell/TestIntegration.jsm
toolkit/modules/tests/xpcshell/head.js
toolkit/modules/tests/xpcshell/test_BinarySearch.js
toolkit/modules/tests/xpcshell/test_CanonicalJSON.js
toolkit/modules/tests/xpcshell/test_Color.js
toolkit/modules/tests/xpcshell/test_CreditCard.js
toolkit/modules/tests/xpcshell/test_DeferredTask.js
toolkit/modules/tests/xpcshell/test_EventEmitter.js
toolkit/modules/tests/xpcshell/test_FileUtils.js
toolkit/modules/tests/xpcshell/test_FinderIterator.js
toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
toolkit/modules/tests/xpcshell/test_Http.js
toolkit/modules/tests/xpcshell/test_Integration.js
toolkit/modules/tests/xpcshell/test_JSONFile.js
toolkit/modules/tests/xpcshell/test_Log.js
toolkit/modules/tests/xpcshell/test_Log_stackTrace.js
toolkit/modules/tests/xpcshell/test_MatchURLFilters.js
toolkit/modules/tests/xpcshell/test_NewTabUtils.js
toolkit/modules/tests/xpcshell/test_ObjectUtils.js
toolkit/modules/tests/xpcshell/test_ObjectUtils_strict.js
toolkit/modules/tests/xpcshell/test_PermissionsUtils.js
toolkit/modules/tests/xpcshell/test_Preferences.js
toolkit/modules/tests/xpcshell/test_ProfileAge.js
toolkit/modules/tests/xpcshell/test_Promise.js
toolkit/modules/tests/xpcshell/test_PromiseUtils.js
toolkit/modules/tests/xpcshell/test_Services.js
toolkit/modules/tests/xpcshell/test_UpdateUtils_updatechannel.js
toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
toolkit/modules/tests/xpcshell/test_ZipUtils.js
toolkit/modules/tests/xpcshell/test_jsesc.js
toolkit/modules/tests/xpcshell/test_propertyListsUtils.js
toolkit/modules/tests/xpcshell/test_readCertPrefs.js
toolkit/modules/tests/xpcshell/test_servicerequest_xhr.js
toolkit/modules/tests/xpcshell/test_sqlite.js
toolkit/modules/tests/xpcshell/test_sqlite_shutdown.js
toolkit/modules/tests/xpcshell/test_timer.js
toolkit/modules/tests/xpcshell/test_web_channel.js
toolkit/modules/tests/xpcshell/test_web_channel_broker.js
--- a/toolkit/modules/AboutPagesUtils.jsm
+++ b/toolkit/modules/AboutPagesUtils.jsm
@@ -3,18 +3,20 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const EXPORTED_SYMBOLS = ["AboutPagesUtils"];
 
-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"
+);
 
 const AboutPagesUtils = {};
 
 XPCOMUtils.defineLazyGetter(AboutPagesUtils, "visibleAboutUrls", () => {
   const urls = [];
   const rx = /@mozilla.org\/network\/protocol\/about;1\?what\=(.*)$/;
   for (const cid in Cc) {
     const result = cid.match(rx);
--- a/toolkit/modules/ActorManagerChild.jsm
+++ b/toolkit/modules/ActorManagerChild.jsm
@@ -7,32 +7,46 @@
 /**
  * This module implements logic for creating JavaScript IPC actors, as defined
  * in ActorManagerParent, for frame message manager contexts. See
  * ActorManagerParent.jsm for more information.
  */
 
 var EXPORTED_SYMBOLS = ["ActorManagerChild"];
 
-const {ExtensionUtils} = ChromeUtils.import("resource://gre/modules/ExtensionUtils.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const { ExtensionUtils } = ChromeUtils.import(
+  "resource://gre/modules/ExtensionUtils.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 
-ChromeUtils.defineModuleGetter(this, "WebNavigationFrames",
-                               "resource://gre/modules/WebNavigationFrames.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "WebNavigationFrames",
+  "resource://gre/modules/WebNavigationFrames.jsm"
+);
 
-const {DefaultMap} = ExtensionUtils;
+const { DefaultMap } = ExtensionUtils;
 
-const {sharedData} = Services.cpmm;
+const { sharedData } = Services.cpmm;
 
-XPCOMUtils.defineLazyPreferenceGetter(this, "simulateEvents",
-                                      "fission.frontend.simulate-events", false);
-XPCOMUtils.defineLazyPreferenceGetter(this, "simulateMessages",
-                                      "fission.frontend.simulate-messages", false);
-
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "simulateEvents",
+  "fission.frontend.simulate-events",
+  false
+);
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "simulateMessages",
+  "fission.frontend.simulate-messages",
+  false
+);
 
 function getMessageManager(window) {
   return window.docShell.messageManager;
 }
 
 class Dispatcher {
   constructor(mm, data) {
     this.mm = mm;
@@ -50,17 +64,17 @@ class Dispatcher {
       // This is directly called on the message manager
       // because this.addMessageListener is meant to handle
       // additions after initialization.
       this.mm.addMessageListener(msg, this);
     }
     for (let topic of this.observers.keys()) {
       Services.obs.addObserver(this, topic, true);
     }
-    for (let {event, options, actor} of this.events) {
+    for (let { event, options, actor } of this.events) {
       this.addEventListener(event, actor, options);
     }
 
     this.mm.addEventListener("unload", this);
   }
 
   cleanup() {
     for (let topic of this.observers.keys()) {
@@ -141,23 +155,23 @@ class Dispatcher {
 
   receiveMessage(message) {
     let actors = this.messages.get(message.name);
 
     if (simulateMessages) {
       let match = false;
       let data = message.data || {};
       if (data.hasOwnProperty("frameId")) {
-        match = (data.frameId == this.frameId);
+        match = data.frameId == this.frameId;
       } else if (data.hasOwnProperty("browsingContextId")) {
-        match = (data.browsingContextId == this.browsingContextId);
+        match = data.browsingContextId == this.browsingContextId;
       } else {
         // if no specific target was given, just dispatch it to
         // top-level actors.
-        match = (this.frameId == 0);
+        match = this.frameId == 0;
       }
 
       if (!match) {
         return;
       }
     }
 
     for (let actor of actors) {
@@ -176,26 +190,27 @@ class Dispatcher {
         this.getActor(actor).observe(subject, topic, data);
       } catch (e) {
         Cu.reportError(e);
       }
     }
   }
 }
 
-Dispatcher.prototype.QueryInterface =
-  ChromeUtils.generateQI(["nsIObserver",
-                          "nsISupportsWeakReference"]);
+Dispatcher.prototype.QueryInterface = ChromeUtils.generateQI([
+  "nsIObserver",
+  "nsISupportsWeakReference",
+]);
 
 class SingletonDispatcher extends Dispatcher {
   constructor(window, data) {
     super(getMessageManager(window), data);
 
-    window.addEventListener("pageshow", this, {mozSystemGroup: true});
-    window.addEventListener("pagehide", this, {mozSystemGroup: true});
+    window.addEventListener("pageshow", this, { mozSystemGroup: true });
+    window.addEventListener("pagehide", this, { mozSystemGroup: true });
 
     this._window = Cu.getWeakReference(window);
     this.listeners = [];
   }
 
   init() {
     super.init();
 
@@ -248,17 +263,19 @@ class SingletonDispatcher extends Dispat
       this.cleanup();
     }
   }
 
   handleActorEvent(actor, event) {
     if (event.target.ownerGlobal == this.window) {
       const inst = this.getActor(actor);
       if (typeof inst.handleEvent != "function") {
-        throw new Error(`Unhandled event for ${actor}: ${event.type}: missing handleEvent`);
+        throw new Error(
+          `Unhandled event for ${actor}: ${event.type}: missing handleEvent`
+        );
       }
       inst.handleEvent(event);
     }
   }
 
   addEventListener(event, actor, options) {
     let listener = this.handleActorEvent.bind(this, actor);
     this.listeners.push([event, listener, options]);
@@ -274,17 +291,19 @@ var ActorManagerChild = {
   }),
 
   singletons: new Map(),
 
   init() {
     let singletons = sharedData.get("ChildSingletonActors");
     for (let [filter, data] of singletons.entries()) {
       let options = {
-        matches: new MatchPatternSet(filter.matches, {restrictSchemes: false}),
+        matches: new MatchPatternSet(filter.matches, {
+          restrictSchemes: false,
+        }),
         allFrames: filter.allFrames,
         matchAboutBlank: filter.matchAboutBlank,
       };
 
       this.singletons.set(new MozDocumentMatcher(options), data);
     }
 
     this.observer = new MozDocumentObserver(this);
@@ -295,18 +314,17 @@ var ActorManagerChild = {
 
   /**
    * MozDocumentObserver callbacks. These handle instantiating singleton actors
    * for documents which match their MozDocumentMatcher filters.
    */
   onNewDocument(matcher, window) {
     new SingletonDispatcher(window, this.singletons.get(matcher)).init();
   },
-  onPreloadDocument(matcher, loadInfo) {
-  },
+  onPreloadDocument(matcher, loadInfo) {},
 
   /**
    * Attaches the appropriate set of actors to the given frame message manager.
    *
    * @param {ContentFrameMessageManager} mm
    *        The message manager to which to attach the actors.
    * @param {string} [group]
    *        The messagemanagergroup of the <browser> to which the caller frame
--- a/toolkit/modules/ActorManagerParent.jsm
+++ b/toolkit/modules/ActorManagerParent.jsm
@@ -90,63 +90,65 @@
  *      added to the DOM window rather than the frame message manager.
  *
  * If Fission is being simulated, and an actor needs to receive events from
  * sub-frames, it must use "allFrames".
  */
 
 var EXPORTED_SYMBOLS = ["ActorManagerParent"];
 
-const {ExtensionUtils} = ChromeUtils.import("resource://gre/modules/ExtensionUtils.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { ExtensionUtils } = ChromeUtils.import(
+  "resource://gre/modules/ExtensionUtils.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-const {DefaultMap} = ExtensionUtils;
+const { DefaultMap } = ExtensionUtils;
 
 let ACTORS = {
   Autoplay: {
     parent: {
       moduleURI: "resource://gre/actors/AutoplayParent.jsm",
     },
 
     child: {
       moduleURI: "resource://gre/actors/AutoplayChild.jsm",
       events: {
-        "GloballyAutoplayBlocked": {},
+        GloballyAutoplayBlocked: {},
       },
     },
 
     allFrames: true,
   },
 
   BrowserElement: {
     parent: {
       moduleURI: "resource://gre/actors/BrowserElementParent.jsm",
     },
 
     child: {
       moduleURI: "resource://gre/actors/BrowserElementChild.jsm",
       events: {
-        "DOMWindowClose": {},
+        DOMWindowClose: {},
       },
     },
 
     allFrames: true,
   },
 
- DateTimePicker: {
+  DateTimePicker: {
     parent: {
       moduleURI: "resource://gre/actors/DateTimePickerParent.jsm",
     },
 
     child: {
       moduleURI: "resource://gre/actors/DateTimePickerChild.jsm",
       events: {
-        "MozOpenDateTimePicker": {},
-        "MozUpdateDateTimePicker": {},
-        "MozCloseDateTimePicker": {},
+        MozOpenDateTimePicker: {},
+        MozUpdateDateTimePicker: {},
+        MozCloseDateTimePicker: {},
       },
     },
 
     allFrames: true,
   },
 
   InlineSpellChecker: {
     parent: {
@@ -163,19 +165,19 @@ let ACTORS = {
   Select: {
     parent: {
       moduleURI: "resource://gre/actors/SelectParent.jsm",
     },
 
     child: {
       moduleURI: "resource://gre/actors/SelectChild.jsm",
       events: {
-        "mozshowdropdown": {},
+        mozshowdropdown: {},
         "mozshowdropdown-sourcetouch": {},
-        "mozhidedropdown": { mozSystemGroup: true },
+        mozhidedropdown: { mozSystemGroup: true },
       },
     },
 
     allFrames: true,
   },
 
   Zoom: {
     parent: {
@@ -184,69 +186,59 @@ let ACTORS = {
         "FullZoomChange",
         "TextZoomChange",
         "ZoomChangeUsingMouseWheel",
       ],
     },
     child: {
       moduleURI: "resource://gre/actors/ZoomChild.jsm",
       events: {
-        "FullZoomChange": {},
-        "TextZoomChange": {},
-        "ZoomChangeUsingMouseWheel": {},
+        FullZoomChange: {},
+        TextZoomChange: {},
+        ZoomChangeUsingMouseWheel: {},
       },
-      messages: [
-        "FullZoom",
-        "TextZoom",
-      ],
+      messages: ["FullZoom", "TextZoom"],
     },
 
     allFrames: true,
   },
 
   // UAWidgetsDateTimeBox is a _duplicate_ of UAWidgetsChild
   // that handles only the datetime box widget. The original
   // intention to port all all UAWidgets to JSWindowActor
   // at once is blocked by some jUnit tests related to
   // the video element failing in
   // mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/MediaElementTest.kt
   // when running on android API 16 (debug & pgo) platforms.
   UAWidgetsDateTimeBox: {
     child: {
       moduleURI: "resource://gre/actors/UAWidgetsDateTimeBoxChild.jsm",
       events: {
-        "UAWidgetSetupOrChange": {},
-        "UAWidgetTeardown": {},
+        UAWidgetSetupOrChange: {},
+        UAWidgetTeardown: {},
       },
     },
 
     allFrames: true,
   },
 };
 
 let LEGACY_ACTORS = {
   AudioPlayback: {
     child: {
       module: "resource://gre/actors/AudioPlaybackChild.jsm",
-      messages: [
-        "AudioPlayback",
-      ],
-      observers: [
-        "audio-playback",
-      ],
+      messages: ["AudioPlayback"],
+      observers: ["audio-playback"],
     },
   },
 
   Controllers: {
     child: {
       module: "resource://gre/actors/ControllersChild.jsm",
-      messages: [
-        "ControllerCommands:Do",
-        "ControllerCommands:DoWithParams",
-      ],
+      messages: ["ControllerCommands:Do", "ControllerCommands:DoWithParams"],
     },
   },
 
   ExtFind: {
     child: {
       module: "resource://gre/actors/ExtFindChild.jsm",
       messages: [
         "ext-Finder:CollectResults",
@@ -255,45 +247,43 @@ let LEGACY_ACTORS = {
       ],
     },
   },
 
   FindBar: {
     child: {
       module: "resource://gre/actors/FindBarChild.jsm",
       events: {
-        "keypress": {mozSystemGroup: true},
+        keypress: { mozSystemGroup: true },
       },
     },
   },
 
   Finder: {
     child: {
       module: "resource://gre/actors/FinderChild.jsm",
-      messages: [
-        "Finder:Initialize",
-      ],
+      messages: ["Finder:Initialize"],
     },
   },
 
   FormSubmit: {
     child: {
       module: "resource://gre/actors/FormSubmitChild.jsm",
       allFrames: true,
       events: {
-        "DOMFormBeforeSubmit": {},
+        DOMFormBeforeSubmit: {},
       },
     },
   },
 
   KeyPressEventModelChecker: {
     child: {
       module: "resource://gre/actors/KeyPressEventModelCheckerChild.jsm",
       events: {
-        "CheckKeyPressEventModel": {capture: true, mozSystemGroup: true},
+        CheckKeyPressEventModel: { capture: true, mozSystemGroup: true },
       },
     },
   },
 
   ManifestMessages: {
     child: {
       module: "resource://gre/modules/ManifestMessagesChild.jsm",
       messages: [
@@ -304,79 +294,75 @@ let LEGACY_ACTORS = {
       ],
     },
   },
 
   PictureInPicture: {
     child: {
       module: "resource://gre/actors/PictureInPictureChild.jsm",
       events: {
-        "MozTogglePictureInPicture": {capture: true},
+        MozTogglePictureInPicture: { capture: true },
       },
 
       messages: [
         "PictureInPicture:SetupPlayer",
         "PictureInPicture:Play",
         "PictureInPicture:Pause",
       ],
     },
   },
 
   PictureInPictureToggle: {
     child: {
       allFrames: true,
       module: "resource://gre/actors/PictureInPictureChild.jsm",
       events: {
-        "canplay": {capture: true, mozSystemGroup: true},
-        "pagehide": {capture: true},
+        canplay: { capture: true, mozSystemGroup: true },
+        pagehide: { capture: true },
       },
     },
   },
 
   PopupBlocking: {
     child: {
       module: "resource://gre/actors/PopupBlockingChild.jsm",
       events: {
-        "DOMPopupBlocked": {capture: true},
+        DOMPopupBlocked: { capture: true },
       },
     },
   },
 
   Printing: {
     child: {
       module: "resource://gre/actors/PrintingChild.jsm",
       events: {
-        "PrintingError": {capture: true},
-        "printPreviewUpdate": {capture: true},
+        PrintingError: { capture: true },
+        printPreviewUpdate: { capture: true },
       },
       messages: [
         "Printing:Preview:Enter",
         "Printing:Preview:Exit",
         "Printing:Preview:Navigate",
         "Printing:Preview:ParseDocument",
         "Printing:Print",
       ],
     },
   },
 
   PurgeSessionHistory: {
     child: {
       module: "resource://gre/actors/PurgeSessionHistoryChild.jsm",
-      messages: [
-        "Browser:PurgeSessionHistory",
-      ],
+      messages: ["Browser:PurgeSessionHistory"],
     },
   },
 
   SelectionSource: {
     child: {
       module: "resource://gre/actors/SelectionSourceChild.jsm",
-      messages: [
-        "ViewSource:GetSelection",
-      ],
+      messages: ["ViewSource:GetSelection"],
     },
   },
 
   Thumbnails: {
     child: {
       module: "resource://gre/actors/ThumbnailsChild.jsm",
       messages: [
         "Browser:Thumbnail:Request",
@@ -385,44 +371,40 @@ let LEGACY_ACTORS = {
       ],
     },
   },
 
   UAWidgets: {
     child: {
       module: "resource://gre/actors/UAWidgetsChild.jsm",
       events: {
-        "UAWidgetSetupOrChange": {},
-        "UAWidgetTeardown": {},
+        UAWidgetSetupOrChange: {},
+        UAWidgetTeardown: {},
       },
     },
   },
 
   UnselectedTabHover: {
     child: {
       module: "resource://gre/actors/UnselectedTabHoverChild.jsm",
       events: {
         "UnselectedTabHover:Enable": {},
         "UnselectedTabHover:Disable": {},
       },
-      messages: [
-        "Browser:UnselectedTabHover",
-      ],
+      messages: ["Browser:UnselectedTabHover"],
     },
   },
 
   WebChannel: {
     child: {
       module: "resource://gre/actors/WebChannelChild.jsm",
       events: {
-        "WebChannelMessageToChrome": {capture: true, wantUntrusted: true},
+        WebChannelMessageToChrome: { capture: true, wantUntrusted: true },
       },
-      messages: [
-        "WebChannelMessageToContent",
-      ],
+      messages: ["WebChannelMessageToContent"],
     },
   },
 
   WebNavigation: {
     child: {
       module: "resource://gre/actors/WebNavigationChild.jsm",
       messages: [
         "WebNavigation:GoBack",
@@ -445,33 +427,33 @@ class ActorSet {
     this.actors = new Map();
     this.events = [];
     this.messages = new DefaultMap(() => []);
     this.observers = new DefaultMap(() => []);
   }
 
   addActor(actorName, actor) {
     actorName += this.actorSide;
-    this.actors.set(actorName, {module: actor.module});
+    this.actors.set(actorName, { module: actor.module });
 
     if (actor.events) {
       for (let [event, options] of Object.entries(actor.events)) {
-        this.events.push({actor: actorName, event, options});
+        this.events.push({ actor: actorName, event, options });
       }
     }
     for (let msg of actor.messages || []) {
       this.messages.get(msg).push(actorName);
     }
     for (let topic of actor.observers || []) {
       this.observers.get(topic).push(actorName);
     }
   }
 }
 
-const {sharedData} = Services.ppmm;
+const { sharedData } = Services.ppmm;
 
 var ActorManagerParent = {
   // Actor sets which should be loaded in the child side, keyed by
   // "messagemanagergroup".
   childGroups: new DefaultMap(group => new ActorSet(group, "Child")),
   // Actor sets which should be loaded in the parent side, keyed by
   // "messagemanagergroup".
   parentGroups: new DefaultMap(group => new ActorSet(group, "Parent")),
@@ -484,34 +466,35 @@ var ActorManagerParent = {
   addActors(actors) {
     for (let [actorName, actor] of Object.entries(actors)) {
       ChromeUtils.registerWindowActor(actorName, actor);
     }
   },
 
   addLegacyActors(actors) {
     for (let [actorName, actor] of Object.entries(actors)) {
-      let {child} = actor;
+      let { child } = actor;
       {
         let actorSet;
         if (child.matches || child.allFrames) {
-          actorSet = this.singletons.get({matches: child.matches || ["<all_urls>"],
-                                          allFrames: child.allFrames,
-                                          matchAboutBlank: child.matchAboutBlank});
+          actorSet = this.singletons.get({
+            matches: child.matches || ["<all_urls>"],
+            allFrames: child.allFrames,
+            matchAboutBlank: child.matchAboutBlank,
+          });
         } else {
           actorSet = this.childGroups.get(child.group || null);
         }
 
         actorSet.addActor(actorName, child);
       }
 
       if (actor.parent) {
-        let {parent} = actor;
-        this.parentGroups.get(parent.group || null).addActor(
-          actorName, parent);
+        let { parent } = actor;
+        this.parentGroups.get(parent.group || null).addActor(actorName, parent);
       }
     }
   },
 
   /**
    * Serializes the current set of registered actors into ppmm.sharedData, for
    * use by ActorManagerChild. This must be called before any frame message
    * managers have been created. It will have no effect on existing message
--- a/toolkit/modules/AppMenuNotifications.jsm
+++ b/toolkit/modules/AppMenuNotifications.jsm
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var EXPORTED_SYMBOLS = ["AppMenuNotifications"];
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 function AppMenuNotification(id, mainAction, secondaryAction, options = {}) {
   this.id = id;
   this.mainAction = mainAction;
   this.secondaryAction = secondaryAction;
   this.options = options;
   this.dismissed = this.options.dismissed || false;
 }
@@ -46,36 +46,44 @@ var AppMenuNotifications = {
           Services.obs.notifyObservers(null, "appMenu-notifications", "init");
         }
         break;
     }
   },
 
   get activeNotification() {
     if (this._notifications.length > 0) {
-      const doorhanger =
-        this._notifications.find(n => !n.dismissed && !n.options.badgeOnly);
+      const doorhanger = this._notifications.find(
+        n => !n.dismissed && !n.options.badgeOnly
+      );
       return doorhanger || this._notifications[0];
     }
 
     return null;
   },
 
   showNotification(id, mainAction, secondaryAction, options = {}) {
-    let notification = new AppMenuNotification(id, mainAction, secondaryAction, options);
+    let notification = new AppMenuNotification(
+      id,
+      mainAction,
+      secondaryAction,
+      options
+    );
     let existingIndex = this._notifications.findIndex(n => n.id == id);
     if (existingIndex != -1) {
       this._notifications.splice(existingIndex, 1);
     }
 
     // We don't want to clobber doorhanger notifications just to show a badge,
     // so don't dismiss any of them and the badge will show once the doorhanger
     // gets resolved.
     if (!options.badgeOnly && !options.dismissed) {
-      this._notifications.forEach(n => { n.dismissed = true; });
+      this._notifications.forEach(n => {
+        n.dismissed = true;
+      });
     }
 
     // Since notifications are generally somewhat pressing, the ideal case is that
     // we never have two notifications at once. However, in the event that we do,
     // it's more likely that the older notification has been sitting around for a
     // bit, and so we don't want to hide the new notification behind it. Thus,
     // we want our notifications to behave like a stack instead of a queue.
     this._notifications.unshift(notification);
@@ -158,22 +166,24 @@ var AppMenuNotifications = {
     }
 
     this._updateNotifications();
   },
 
   _removeNotification(notification) {
     // This notification may already be removed, in which case let's just ignore.
     let notifications = this._notifications;
-    if (!notifications)
+    if (!notifications) {
       return;
+    }
 
     var index = notifications.indexOf(notification);
-    if (index == -1)
+    if (index == -1) {
       return;
+    }
 
     // Remove the notification
     notifications.splice(index, 1);
   },
 
   _updateNotifications() {
     Services.obs.notifyObservers(null, "appMenu-notifications", "update");
   },
--- a/toolkit/modules/AsyncPrefs.jsm
+++ b/toolkit/modules/AsyncPrefs.jsm
@@ -1,19 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var EXPORTED_SYMBOLS = ["AsyncPrefs"];
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-const kInChildProcess = Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT;
+const kInChildProcess =
+  Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT;
 
 const kAllowedPrefs = new Set([
   // NB: please leave the testing prefs at the top, and sort the rest alphabetically if you add
   // anything.
   "testing.allowed-prefs.some-bool-pref",
   "testing.allowed-prefs.some-char-pref",
   "testing.allowed-prefs.some-int-pref",
 
@@ -45,18 +46,20 @@ function maybeReturnErrorForSet(pref, va
     return `Setting pref ${pref} from content is not allowed.`;
   }
 
   let valueType = typeof value;
   if (!kPrefTypeMap.has(valueType)) {
     return `Can't set pref ${pref} to value of type ${valueType}.`;
   }
   let prefType = Services.prefs.getPrefType(pref);
-  if (prefType != Services.prefs.PREF_INVALID &&
-      prefType != kPrefTypeMap.get(valueType)) {
+  if (
+    prefType != Services.prefs.PREF_INVALID &&
+    prefType != kPrefTypeMap.get(valueType)
+  ) {
     return `Can't set pref ${pref} to a value with type ${valueType} that doesn't match the pref's type ${prefType}.`;
   }
   return false;
 }
 
 var AsyncPrefs;
 if (kInChildProcess) {
   let gUniqueId = 0;
@@ -66,31 +69,35 @@ if (kInChildProcess) {
     set(pref, value) {
       let error = maybeReturnErrorForSet(pref, value);
       if (error) {
         return Promise.reject(error);
       }
 
       let msgId = ++gUniqueId;
       return new Promise((resolve, reject) => {
-        gMsgMap.set(msgId, {resolve, reject});
-        Services.cpmm.sendAsyncMessage("AsyncPrefs:SetPref", {pref, value, msgId});
+        gMsgMap.set(msgId, { resolve, reject });
+        Services.cpmm.sendAsyncMessage("AsyncPrefs:SetPref", {
+          pref,
+          value,
+          msgId,
+        });
       });
     },
 
     reset(pref) {
       let error = maybeReturnErrorForReset(pref);
       if (error) {
         return Promise.reject(error);
       }
 
       let msgId = ++gUniqueId;
       return new Promise((resolve, reject) => {
-        gMsgMap.set(msgId, {resolve, reject});
-        Services.cpmm.sendAsyncMessage("AsyncPrefs:ResetPref", {pref, msgId});
+        gMsgMap.set(msgId, { resolve, reject });
+        Services.cpmm.sendAsyncMessage("AsyncPrefs:ResetPref", { pref, msgId });
       });
     },
 
     receiveMessage(msg) {
       let promiseRef = gMsgMap.get(msg.data.msgId);
       if (promiseRef) {
         gMsgMap.delete(msg.data.msgId);
         if (msg.data.success) {
@@ -146,31 +153,51 @@ if (kInChildProcess) {
       if (msg.name == "AsyncPrefs:SetPref") {
         this.onPrefSet(msg);
       } else {
         this.onPrefReset(msg);
       }
     },
 
     onPrefReset(msg) {
-      let {pref, msgId} = msg.data;
-      this.reset(pref).then(function() {
-        msg.target.sendAsyncMessage("AsyncPrefs:PrefResetFinished", {msgId, success: true});
-      }, function(msg) {
-        msg.target.sendAsyncMessage("AsyncPrefs:PrefResetFinished", {msgId, success: false, message: msg});
-      });
+      let { pref, msgId } = msg.data;
+      this.reset(pref).then(
+        function() {
+          msg.target.sendAsyncMessage("AsyncPrefs:PrefResetFinished", {
+            msgId,
+            success: true,
+          });
+        },
+        function(msg) {
+          msg.target.sendAsyncMessage("AsyncPrefs:PrefResetFinished", {
+            msgId,
+            success: false,
+            message: msg,
+          });
+        }
+      );
     },
 
     onPrefSet(msg) {
-      let {pref, value, msgId} = msg.data;
-      this.set(pref, value).then(function() {
-        msg.target.sendAsyncMessage("AsyncPrefs:PrefSetFinished", {msgId, success: true});
-      }, function(msg) {
-        msg.target.sendAsyncMessage("AsyncPrefs:PrefSetFinished", {msgId, success: false, message: msg});
-      });
+      let { pref, value, msgId } = msg.data;
+      this.set(pref, value).then(
+        function() {
+          msg.target.sendAsyncMessage("AsyncPrefs:PrefSetFinished", {
+            msgId,
+            success: true,
+          });
+        },
+        function(msg) {
+          msg.target.sendAsyncMessage("AsyncPrefs:PrefSetFinished", {
+            msgId,
+            success: false,
+            message: msg,
+          });
+        }
+      );
     },
 
     init() {
       // PLEASE KEEP THIS LIST IN SYNC WITH THE LISTENERS ADDED IN nsBrowserGlue
       Services.ppmm.addMessageListener("AsyncPrefs:SetPref", this);
       Services.ppmm.addMessageListener("AsyncPrefs:ResetPref", this);
       // PLEASE KEEP THIS LIST IN SYNC WITH THE LISTENERS ADDED IN nsBrowserGlue
     },
--- a/toolkit/modules/AutoCompletePopupContent.jsm
+++ b/toolkit/modules/AutoCompletePopupContent.jsm
@@ -2,27 +2,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var EXPORTED_SYMBOLS = ["AutoCompletePopup"];
 
 /* eslint no-unused-vars: ["error", {args: "none"}] */
 
-ChromeUtils.defineModuleGetter(this, "BrowserUtils",
-  "resource://gre/modules/BrowserUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "BrowserUtils",
+  "resource://gre/modules/BrowserUtils.jsm"
+);
 
 const MESSAGES = [
   "FormAutoComplete:HandleEnter",
   "FormAutoComplete:PopupClosed",
   "FormAutoComplete:PopupOpened",
   "FormAutoComplete:RequestFocus",
 ];
 
-
 class AutoCompletePopup {
   constructor(mm) {
     this.mm = mm;
 
     for (let messageName of MESSAGES) {
       mm.addMessageListener(messageName, this);
     }
 
@@ -30,18 +32,19 @@ class AutoCompletePopup {
     this._popupOpen = false;
   }
 
   receiveMessage(message) {
     switch (message.name) {
       case "FormAutoComplete:HandleEnter": {
         this.selectedIndex = message.data.selectedIndex;
 
-        let controller = Cc["@mozilla.org/autocomplete/controller;1"]
-                           .getService(Ci.nsIAutoCompleteController);
+        let controller = Cc[
+          "@mozilla.org/autocomplete/controller;1"
+        ].getService(Ci.nsIAutoCompleteController);
         controller.handleEnter(message.data.isPopupSelection);
         break;
       }
 
       case "FormAutoComplete:PopupClosed": {
         this._popupOpen = false;
         break;
       }
@@ -55,18 +58,22 @@ class AutoCompletePopup {
         if (this._input) {
           this._input.focus();
         }
         break;
       }
     }
   }
 
-  get input() { return this._input; }
-  get overrideValue() { return null; }
+  get input() {
+    return this._input;
+  }
+  get overrideValue() {
+    return null;
+  }
   set selectedIndex(index) {
     this.mm.sendAsyncMessage("FormAutoComplete:SetSelectedIndex", { index });
   }
   get selectedIndex() {
     // selectedIndex getter must be synchronous because we need the
     // correct value when the controller is in controller::HandleEnter.
     // We can't easily just let the parent inform us the new value every
     // time it changes because not every action that can change the
@@ -83,18 +90,21 @@ class AutoCompletePopup {
       return;
     }
 
     let rect = BrowserUtils.getElementBoundingScreenRect(element);
     let window = element.ownerGlobal;
     let dir = window.getComputedStyle(element).direction;
     let results = this.getResultsFromController(input);
 
-    this.mm.sendAsyncMessage("FormAutoComplete:MaybeOpenPopup",
-                             { results, rect, dir });
+    this.mm.sendAsyncMessage("FormAutoComplete:MaybeOpenPopup", {
+      results,
+      rect,
+      dir,
+    });
     this._input = input;
   }
 
   closePopup() {
     // We set this here instead of just waiting for the
     // PopupClosed message to do it so that we don't end
     // up in a state where the content thinks that a popup
     // is open when it isn't (or soon won't be).
--- a/toolkit/modules/AutoScrollController.jsm
+++ b/toolkit/modules/AutoScrollController.jsm
@@ -1,14 +1,14 @@
 /* -*- 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/. */
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var EXPORTED_SYMBOLS = ["AutoScrollController"];
 
 class AutoScrollController {
   constructor(global) {
     this._scrollable = null;
     this._scrolldir = "";
     this._startX = null;
@@ -21,32 +21,43 @@ class AutoScrollController {
     this._global = global;
     this.autoscrollLoop = this.autoscrollLoop.bind(this);
 
     global.addMessageListener("Autoscroll:Stop", this);
   }
 
   isAutoscrollBlocker(node) {
     let mmPaste = Services.prefs.getBoolPref("middlemouse.paste");
-    let mmScrollbarPosition = Services.prefs.getBoolPref("middlemouse.scrollbarPosition");
+    let mmScrollbarPosition = Services.prefs.getBoolPref(
+      "middlemouse.scrollbarPosition"
+    );
     let content = node.ownerGlobal;
 
     while (node) {
-      if ((node instanceof content.HTMLAnchorElement || node instanceof content.HTMLAreaElement) &&
-          node.hasAttribute("href")) {
+      if (
+        (node instanceof content.HTMLAnchorElement ||
+          node instanceof content.HTMLAreaElement) &&
+        node.hasAttribute("href")
+      ) {
         return true;
       }
 
-      if (mmPaste && (node instanceof content.HTMLInputElement ||
-                      node instanceof content.HTMLTextAreaElement)) {
+      if (
+        mmPaste &&
+        (node instanceof content.HTMLInputElement ||
+          node instanceof content.HTMLTextAreaElement)
+      ) {
         return true;
       }
 
-      if (node instanceof content.XULElement && mmScrollbarPosition
-          && (node.localName == "scrollbar" || node.localName == "scrollcorner")) {
+      if (
+        node instanceof content.XULElement &&
+        mmScrollbarPosition &&
+        (node.localName == "scrollbar" || node.localName == "scrollcorner")
+      ) {
         return true;
       }
 
       node = node.parentNode;
     }
     return false;
   }
 
@@ -70,17 +81,17 @@ class AutoScrollController {
       if (this.getXBLNodes(node, array)) {
         array.push(node);
         return true;
       }
     }
     return false;
   }
 
-  * parentNodeIterator(aNode) {
+  *parentNodeIterator(aNode) {
     let content = aNode.ownerGlobal;
 
     while (aNode) {
       yield aNode;
 
       let parent = aNode.parentNode;
       if (parent && parent instanceof content.XULElement) {
         let anonNodes = content.document.getAnonymousNodes(parent);
@@ -112,91 +123,99 @@ class AutoScrollController {
       // do not use overflow based autoscroll for <html> and <body>
       // Elements or non-html/non-xul elements such as svg or Document nodes
       // also make sure to skip select elements that are not multiline
       if (!this.isScrollableElement(node)) {
         continue;
       }
 
       var overflowx = node.ownerGlobal
-                          .getComputedStyle(node)
-                          .getPropertyValue("overflow-x");
+        .getComputedStyle(node)
+        .getPropertyValue("overflow-x");
       var overflowy = node.ownerGlobal
-                          .getComputedStyle(node)
-                          .getPropertyValue("overflow-y");
+        .getComputedStyle(node)
+        .getPropertyValue("overflow-y");
       // we already discarded non-multiline selects so allow vertical
       // scroll for multiline ones directly without checking for a
       // overflow property
-      var scrollVert = node.scrollTopMax &&
+      var scrollVert =
+        node.scrollTopMax &&
         (node instanceof content.HTMLSelectElement ||
-         scrollingAllowed.includes(overflowy));
+          scrollingAllowed.includes(overflowy));
 
       // do not allow horizontal scrolling for select elements, it leads
       // to visual artifacts and is not the expected behavior anyway
-      if (!(node instanceof content.HTMLSelectElement) &&
-          node.scrollLeftMin != node.scrollLeftMax &&
-          scrollingAllowed.includes(overflowx)) {
+      if (
+        !(node instanceof content.HTMLSelectElement) &&
+        node.scrollLeftMin != node.scrollLeftMax &&
+        scrollingAllowed.includes(overflowx)
+      ) {
         this._scrolldir = scrollVert ? "NSEW" : "EW";
         this._scrollable = node;
         break;
       } else if (scrollVert) {
         this._scrolldir = "NS";
         this._scrollable = node;
         break;
       }
     }
 
     if (!this._scrollable) {
       this._scrollable = aNode.ownerGlobal;
       if (this._scrollable.scrollMaxX != this._scrollable.scrollMinX) {
-        this._scrolldir = this._scrollable.scrollMaxY !=
-                          this._scrollable.scrollMinY ? "NSEW" : "EW";
+        this._scrolldir =
+          this._scrollable.scrollMaxY != this._scrollable.scrollMinY
+            ? "NSEW"
+            : "EW";
       } else if (this._scrollable.scrollMaxY != this._scrollable.scrollMinY) {
         this._scrolldir = "NS";
       } else if (this._scrollable.frameElement) {
         this.findNearestScrollableElement(this._scrollable.frameElement);
       } else {
         this._scrollable = null; // abort scrolling
       }
     }
   }
 
   startScroll(event) {
     this.findNearestScrollableElement(event.originalTarget);
 
-    if (!this._scrollable)
+    if (!this._scrollable) {
       return;
+    }
 
     let content = event.originalTarget.ownerGlobal;
 
     // In some configurations like Print Preview, content.performance
     // (which we use below) is null. Autoscrolling is broken in Print
     // Preview anyways (see bug 1393494), so just don't start it at all.
-    if (!content.performance)
+    if (!content.performance) {
       return;
+    }
 
     let domUtils = content.windowUtils;
     let scrollable = this._scrollable;
     if (scrollable instanceof Ci.nsIDOMWindow) {
       // getViewId() needs an element to operate on.
       scrollable = scrollable.document.documentElement;
     }
     this._scrollId = null;
     try {
       this._scrollId = domUtils.getViewId(scrollable);
     } catch (e) {
       // No view ID - leave this._scrollId as null. Receiving side will check.
     }
     let presShellId = domUtils.getPresShellId();
-    let [result] = this._global.sendSyncMessage("Autoscroll:Start",
-                                                {scrolldir: this._scrolldir,
-                                                 screenX: event.screenX,
-                                                 screenY: event.screenY,
-                                                 scrollId: this._scrollId,
-                                                 presShellId});
+    let [result] = this._global.sendSyncMessage("Autoscroll:Start", {
+      scrolldir: this._scrolldir,
+      screenX: event.screenX,
+      screenY: event.screenY,
+      scrollId: this._scrollId,
+      presShellId,
+    });
     if (!result.autoscrollEnabled) {
       this._scrollable = null;
       return;
     }
 
     Services.els.addSystemEventListener(this._global, "mousemove", this, true);
     this._global.addEventListener("pagehide", this, true);
 
@@ -227,38 +246,46 @@ class AutoScrollController {
     content.requestAnimationFrame(this.autoscrollLoop);
   }
 
   stopScroll() {
     if (this._scrollable) {
       this._scrollable.mozScrollSnap();
       this._scrollable = null;
 
-      Services.els.removeSystemEventListener(this._global, "mousemove", this, true);
+      Services.els.removeSystemEventListener(
+        this._global,
+        "mousemove",
+        this,
+        true
+      );
       this._global.removeEventListener("pagehide", this, true);
       if (this._autoscrollHandledByApz) {
         Services.obs.removeObserver(this, "autoscroll-rejected-by-apz");
       }
     }
   }
 
   accelerate(curr, start) {
     const speed = 12;
     var val = (curr - start) / speed;
 
-    if (val > 1)
+    if (val > 1) {
       return val * Math.sqrt(val) - 1;
-    if (val < -1)
+    }
+    if (val < -1) {
       return val * Math.sqrt(-val) + 1;
+    }
     return 0;
   }
 
   roundToZero(num) {
-    if (num > 0)
+    if (num > 0) {
       return Math.floor(num);
+    }
     return Math.ceil(num);
   }
 
   autoscrollLoop(timestamp) {
     if (!this._scrollable) {
       // Scrolling has been canceled
       return;
     }
@@ -274,47 +301,48 @@ class AutoScrollController {
     var actualScrollX = 0;
     var actualScrollY = 0;
     // don't bother scrolling vertically when the scrolldir is only horizontal
     // and the other way around
     if (this._scrolldir != "EW") {
       var y = this.accelerate(this._screenY, this._startY) * timeCompensation;
       var desiredScrollY = this._scrollErrorY + y;
       actualScrollY = this.roundToZero(desiredScrollY);
-      this._scrollErrorY = (desiredScrollY - actualScrollY);
+      this._scrollErrorY = desiredScrollY - actualScrollY;
     }
     if (this._scrolldir != "NS") {
       var x = this.accelerate(this._screenX, this._startX) * timeCompensation;
       var desiredScrollX = this._scrollErrorX + x;
       actualScrollX = this.roundToZero(desiredScrollX);
-      this._scrollErrorX = (desiredScrollX - actualScrollX);
+      this._scrollErrorX = desiredScrollX - actualScrollX;
     }
 
     this._scrollable.scrollBy({
       left: actualScrollX,
       top: actualScrollY,
       behavior: "instant",
     });
 
     this._scrollable.ownerGlobal.requestAnimationFrame(this.autoscrollLoop);
   }
 
   handleEvent(event) {
     if (event.type == "mousemove") {
       this._screenX = event.screenX;
       this._screenY = event.screenY;
     } else if (event.type == "mousedown") {
-      if (!this._scrollable &&
-          !this.isAutoscrollBlocker(event.originalTarget)) {
+      if (
+        !this._scrollable &&
+        !this.isAutoscrollBlocker(event.originalTarget)
+      ) {
         this.startScroll(event);
       }
     } else if (event.type == "pagehide") {
       if (this._scrollable) {
-        var doc =
-          this._scrollable.ownerDocument || this._scrollable.document;
+        var doc = this._scrollable.ownerDocument || this._scrollable.document;
         if (doc == event.target) {
           this._global.sendAsyncMessage("Autoscroll:Cancel");
         }
       }
     }
   }
 
   receiveMessage(msg) {
--- a/toolkit/modules/BinarySearch.jsm
+++ b/toolkit/modules/BinarySearch.jsm
@@ -1,20 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-var EXPORTED_SYMBOLS = [
-  "BinarySearch",
-];
+var EXPORTED_SYMBOLS = ["BinarySearch"];
 
 var BinarySearch = Object.freeze({
-
   /**
    * Returns the index of the given target in the given array or -1 if the
    * target is not found.
    *
    * See search() for a description of this function's parameters.
    *
    * @return The index of `target` in `array` or -1 if `target` is not found.
    */
@@ -58,18 +55,20 @@ var BinarySearch = Object.freeze({
    */
   search(comparator, array, target) {
     let low = 0;
     let high = array.length - 1;
     while (low <= high) {
       // Thanks to http://jsperf.com/code-review-1480 for this tip.
       let mid = (low + high) >> 1;
       let cmp = comparator(target, array[mid]);
-      if (cmp == 0)
+      if (cmp == 0) {
         return [true, mid];
-      if (cmp < 0)
+      }
+      if (cmp < 0) {
         high = mid - 1;
-      else
+      } else {
         low = mid + 1;
+      }
     }
     return [false, low];
   },
 });
--- a/toolkit/modules/BrowserUtils.jsm
+++ b/toolkit/modules/BrowserUtils.jsm
@@ -1,49 +1,62 @@
 /* -*- mode: js; 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";
 
-var EXPORTED_SYMBOLS = [ "BrowserUtils" ];
+var EXPORTED_SYMBOLS = ["BrowserUtils"];
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-ChromeUtils.defineModuleGetter(this, "PlacesUtils",
-  "resource://gre/modules/PlacesUtils.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PlacesUtils",
+  "resource://gre/modules/PlacesUtils.jsm"
+);
 
 var BrowserUtils = {
-
   /**
    * Prints arguments separated by a space and appends a new line.
    */
   dumpLn(...args) {
-    for (let a of args)
+    for (let a of args) {
       dump(a + " ");
+    }
     dump("\n");
   },
 
   /**
    * restartApplication: Restarts the application, keeping it in
    * safe mode if it is already in safe mode.
    */
   restartApplication() {
-    let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"]
-                       .createInstance(Ci.nsISupportsPRBool);
-    Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
-    if (cancelQuit.data) { // The quit request has been canceled.
+    let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(
+      Ci.nsISupportsPRBool
+    );
+    Services.obs.notifyObservers(
+      cancelQuit,
+      "quit-application-requested",
+      "restart"
+    );
+    if (cancelQuit.data) {
+      // The quit request has been canceled.
       return false;
     }
     // if already in safe mode restart in safe mode
     if (Services.appinfo.inSafeMode) {
-      Services.startup.restartInSafeMode(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
+      Services.startup.restartInSafeMode(
+        Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart
+      );
       return undefined;
     }
-    Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
+    Services.startup.quit(
+      Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart
+    );
     return undefined;
   },
 
   /**
    * urlSecurityCheck: JavaScript wrapper for checkLoadURIWithPrincipal
    * and checkLoadURIStrWithPrincipal.
    * If |aPrincipal| is not allowed to link to |aURL|, this function throws with
    * an error message.
@@ -59,25 +72,26 @@ var BrowserUtils = {
    */
   urlSecurityCheck(aURL, aPrincipal, aFlags) {
     var secMan = Services.scriptSecurityManager;
     if (aFlags === undefined) {
       aFlags = secMan.STANDARD;
     }
 
     try {
-      if (aURL instanceof Ci.nsIURI)
+      if (aURL instanceof Ci.nsIURI) {
         secMan.checkLoadURIWithPrincipal(aPrincipal, aURL, aFlags);
-      else
+      } else {
         secMan.checkLoadURIStrWithPrincipal(aPrincipal, aURL, aFlags);
+      }
     } catch (e) {
       let principalStr = "";
       try {
         principalStr = " from " + aPrincipal.URI.spec;
-      } catch (e2) { }
+      } catch (e2) {}
 
       throw new Error(`Load of ${aURL + principalStr} denied.`);
     }
   },
 
   /**
    * Return or create a principal with the codebase of one, and the originAttributes
    * of an existing principal (e.g. on a docshell, where the originAttributes ought
@@ -100,23 +114,28 @@ var BrowserUtils = {
 
     // If the originAttributes already match, just return the principal as-is.
     if (existingPrincipal.originSuffix == principal.originSuffix) {
       return principal;
     }
 
     let secMan = Services.scriptSecurityManager;
     if (principal.isCodebasePrincipal) {
-      return secMan.createCodebasePrincipal(principal.URI, existingPrincipal.originAttributes);
+      return secMan.createCodebasePrincipal(
+        principal.URI,
+        existingPrincipal.originAttributes
+      );
     }
 
     if (principal.isNullPrincipal) {
       return secMan.createNullPrincipal(existingPrincipal.originAttributes);
     }
-    throw new Error("Can't change the originAttributes of an expanded principal!");
+    throw new Error(
+      "Can't change the originAttributes of an expanded principal!"
+    );
   },
 
   /**
    * Constructs a new URI, using nsIIOService.
    * @param aURL The URI spec.
    * @param aOriginCharset The charset of the URI.
    * @param aBaseURI Base URI to resolve aURL, or null.
    * @return an nsIURI object based on aURL.
@@ -153,28 +172,35 @@ var BrowserUtils = {
    * window. In a content process, the coordinates returned will be relative to
    * the left/top of the topmost content area. If aInScreenCoords is true,
    * screen coordinates will be returned instead.
    */
   getElementBoundingRect(aElement, aInScreenCoords) {
     let rect = aElement.getBoundingClientRect();
     let win = aElement.ownerGlobal;
 
-    let x = rect.left, y = rect.top;
+    let x = rect.left,
+      y = rect.top;
 
     // We need to compensate for any iframes that might shift things
     // over. We also need to compensate for zooming.
     let parentFrame = win.frameElement;
     while (parentFrame) {
       win = parentFrame.ownerGlobal;
       let cstyle = win.getComputedStyle(parentFrame);
 
       let framerect = parentFrame.getBoundingClientRect();
-      x += framerect.left + parseFloat(cstyle.borderLeftWidth) + parseFloat(cstyle.paddingLeft);
-      y += framerect.top + parseFloat(cstyle.borderTopWidth) + parseFloat(cstyle.paddingTop);
+      x +=
+        framerect.left +
+        parseFloat(cstyle.borderLeftWidth) +
+        parseFloat(cstyle.paddingLeft);
+      y +=
+        framerect.top +
+        parseFloat(cstyle.borderTopWidth) +
+        parseFloat(cstyle.paddingTop);
 
       parentFrame = win.frameElement;
     }
 
     if (aInScreenCoords) {
       x += win.mozInnerScreenX;
       y += win.mozInnerScreenY;
     }
@@ -188,105 +214,121 @@ var BrowserUtils = {
     };
 
     return rect;
   },
 
   onBeforeLinkTraversal(originalTarget, linkURI, linkNode, isAppTab) {
     // Don't modify non-default targets or targets that aren't in top-level app
     // tab docshells (isAppTab will be false for app tab subframes).
-    if (originalTarget != "" || !isAppTab)
+    if (originalTarget != "" || !isAppTab) {
       return originalTarget;
+    }
 
     // External links from within app tabs should always open in new tabs
     // instead of replacing the app tab's page (Bug 575561)
     let linkHost;
     let docHost;
     try {
       linkHost = linkURI.host;
       docHost = linkNode.ownerDocument.documentURIObject.host;
     } catch (e) {
       // nsIURI.host can throw for non-nsStandardURL nsIURIs.
       // If we fail to get either host, just return originalTarget.
       return originalTarget;
     }
 
-    if (docHost == linkHost)
+    if (docHost == linkHost) {
       return originalTarget;
+    }
 
     // Special case: ignore "www" prefix if it is part of host string
     let [longHost, shortHost] =
-      linkHost.length > docHost.length ? [linkHost, docHost] : [docHost, linkHost];
-    if (longHost == "www." + shortHost)
+      linkHost.length > docHost.length
+        ? [linkHost, docHost]
+        : [docHost, linkHost];
+    if (longHost == "www." + shortHost) {
       return originalTarget;
+    }
 
     return "_blank";
   },
 
   /**
    * Map the plugin's name to a filtered version more suitable for UI.
    *
    * @param aName The full-length name string of the plugin.
    * @return the simplified name string.
    */
   makeNicePluginName(aName) {
-    if (aName == "Shockwave Flash")
+    if (aName == "Shockwave Flash") {
       return "Adobe Flash";
+    }
     // Regex checks if aName begins with "Java" + non-letter char
-    if (/^Java\W/.exec(aName))
+    if (/^Java\W/.exec(aName)) {
       return "Java";
+    }
 
     // Clean up the plugin name by stripping off parenthetical clauses,
     // trailing version numbers or "plugin".
     // EG, "Foo Bar (Linux) Plugin 1.23_02" --> "Foo Bar"
     // Do this by first stripping the numbers, etc. off the end, and then
     // removing "Plugin" (and then trimming to get rid of any whitespace).
     // (Otherwise, something like "Java(TM) Plug-in 1.7.0_07" gets mangled)
-    let newName = aName.replace(/\(.*?\)/g, "").
-                        replace(/[\s\d\.\-\_\(\)]+$/, "").
-                        replace(/\bplug-?in\b/i, "").trim();
+    let newName = aName
+      .replace(/\(.*?\)/g, "")
+      .replace(/[\s\d\.\-\_\(\)]+$/, "")
+      .replace(/\bplug-?in\b/i, "")
+      .trim();
     return newName;
   },
 
   /**
    * Returns true if |mimeType| is text-based, or false otherwise.
    *
    * @param mimeType
    *        The MIME type to check.
    */
   mimeTypeIsTextBased(mimeType) {
-    return mimeType.startsWith("text/") ||
-           mimeType.endsWith("+xml") ||
-           mimeType == "application/x-javascript" ||
-           mimeType == "application/javascript" ||
-           mimeType == "application/json" ||
-           mimeType == "application/xml" ||
-           mimeType == "mozilla.application/cached-xul";
+    return (
+      mimeType.startsWith("text/") ||
+      mimeType.endsWith("+xml") ||
+      mimeType == "application/x-javascript" ||
+      mimeType == "application/javascript" ||
+      mimeType == "application/json" ||
+      mimeType == "application/xml" ||
+      mimeType == "mozilla.application/cached-xul"
+    );
   },
 
   /**
    * Return true if we should FAYT for this node + window (could be CPOW):
    *
    * @param elt
    *        The element that is focused
    */
   shouldFastFind(elt) {
     if (elt) {
       let win = elt.ownerGlobal;
-      if (elt instanceof win.HTMLInputElement && elt.mozIsTextField(false))
+      if (elt instanceof win.HTMLInputElement && elt.mozIsTextField(false)) {
         return false;
+      }
 
-      if (elt.isContentEditable || win.document.designMode == "on")
+      if (elt.isContentEditable || win.document.designMode == "on") {
         return false;
+      }
 
-      if (elt instanceof win.HTMLTextAreaElement ||
-          elt instanceof win.HTMLSelectElement ||
-          elt instanceof win.HTMLObjectElement ||
-          elt instanceof win.HTMLEmbedElement)
+      if (
+        elt instanceof win.HTMLTextAreaElement ||
+        elt instanceof win.HTMLSelectElement ||
+        elt instanceof win.HTMLObjectElement ||
+        elt instanceof win.HTMLEmbedElement
+      ) {
         return false;
+      }
 
       if (elt instanceof win.HTMLIFrameElement && elt.mozbrowser) {
         // If we're targeting a mozbrowser iframe, it should be allowed to
         // handle FastFind itself.
         return false;
       }
     }
 
@@ -296,35 +338,38 @@ var BrowserUtils = {
   /**
    * Returns true if we can show a find bar, including FAYT, for the specified
    * document location. The location must not be in a blacklist of specific
    * "about:" pages for which find is disabled.
    *
    * This can be called from the parent process or from content processes.
    */
   canFindInPage(location) {
-    return !location.startsWith("about:addons") &&
-           !location.startsWith("about:preferences");
+    return (
+      !location.startsWith("about:addons") &&
+      !location.startsWith("about:preferences")
+    );
   },
 
   _visibleToolbarsMap: new WeakMap(),
 
   /**
    * Return true if any or a specific toolbar that interacts with the content
    * document is visible.
    *
    * @param  {nsIDocShell} docShell The docShell instance that a toolbar should
    *                                be interacting with
    * @param  {String}      which    Identifier of a specific toolbar
    * @return {Boolean}
    */
   isToolbarVisible(docShell, which) {
     let window = this.getRootWindow(docShell);
-    if (!this._visibleToolbarsMap.has(window))
+    if (!this._visibleToolbarsMap.has(window)) {
       return false;
+    }
     let toolbars = this._visibleToolbarsMap.get(window);
     return !!toolbars && toolbars.has(which);
   },
 
   /**
    * Sets the --toolbarbutton-button-height CSS property on the closest
    * toolbar to the provided element. Useful if you need to vertically
    * center a position:absolute element within a toolbar that uses
@@ -348,17 +393,20 @@ var BrowserUtils = {
     }
     let bounds = dwu.getBoundsWithoutFlushing(toolbarItem);
     if (!bounds.height) {
       await window.promiseDocumentFlushed(() => {
         bounds = dwu.getBoundsWithoutFlushing(toolbarItem);
       });
     }
     if (bounds.height) {
-      toolbarItem.style.setProperty("--toolbarbutton-height", bounds.height + "px");
+      toolbarItem.style.setProperty(
+        "--toolbarbutton-height",
+        bounds.height + "px"
+      );
     }
   },
 
   /**
    * Track whether a toolbar is visible for a given a docShell.
    *
    * @param  {nsIDocShell} docShell  The docShell instance that a toolbar should
    *                                 be interacting with
@@ -370,20 +418,21 @@ var BrowserUtils = {
     // We have to get the root window object, because XPConnect WrappedNatives
     // can't be used as WeakMap keys.
     let window = this.getRootWindow(docShell);
     let toolbars = this._visibleToolbarsMap.get(window);
     if (!toolbars) {
       toolbars = new Set();
       this._visibleToolbarsMap.set(window, toolbars);
     }
-    if (!visible)
+    if (!visible) {
       toolbars.delete(which);
-    else
+    } else {
       toolbars.add(which);
+    }
   },
 
   /**
    * Retrieve the root window object (i.e. the top-most content global) for a
    * specific docShell object.
    *
    * @param  {nsIDocShell} docShell
    * @return {nsIDOMWindow}
@@ -429,32 +478,38 @@ var BrowserUtils = {
    *         The top window of the element containing the selection.
    * @param  aCharLen
    *         The maximum string length for the selection text.
    * @return The selection details containing the full and trimmed selection text
    *         and link details for link selections.
    */
   getSelectionDetails(aTopWindow, aCharLen) {
     let focusedWindow = {};
-    let focusedElement = Services.focus.getFocusedElementForWindow(aTopWindow, true, focusedWindow);
+    let focusedElement = Services.focus.getFocusedElementForWindow(
+      aTopWindow,
+      true,
+      focusedWindow
+    );
     focusedWindow = focusedWindow.value;
 
     let selection = focusedWindow.getSelection();
     let selectionStr = selection.toString();
     let fullText;
 
     let url;
     let linkText;
 
     // try getting a selected text in text input.
     if (!selectionStr && focusedElement) {
       // Don't get the selection for password fields. See bug 565717.
-      if (ChromeUtils.getClassName(focusedElement) === "HTMLTextAreaElement" ||
-          (ChromeUtils.getClassName(focusedElement) === "HTMLInputElement" &&
-           focusedElement.mozIsTextField(true))) {
+      if (
+        ChromeUtils.getClassName(focusedElement) === "HTMLTextAreaElement" ||
+        (ChromeUtils.getClassName(focusedElement) === "HTMLInputElement" &&
+          focusedElement.mozIsTextField(true))
+      ) {
         selection = focusedElement.editor.selection;
         selectionStr = selection.toString();
       }
     }
 
     let collapsed = selection.isCollapsed;
 
     if (selectionStr) {
@@ -473,58 +528,70 @@ var BrowserUtils = {
 
         // selection.toString() trims trailing whitespace, so we look for
         // that explicitly in the first and last ranges.
         let beginRange = selection.getRangeAt(0);
         let delimitedAtStart = /^\s/.test(beginRange);
         if (!delimitedAtStart) {
           let container = beginRange.startContainer;
           let offset = beginRange.startOffset;
-          if (container.nodeType == container.TEXT_NODE && offset > 0)
+          if (container.nodeType == container.TEXT_NODE && offset > 0) {
             delimitedAtStart = /\W/.test(container.textContent[offset - 1]);
-          else
+          } else {
             delimitedAtStart = true;
+          }
         }
 
         let delimitedAtEnd = false;
         if (delimitedAtStart) {
           let endRange = selection.getRangeAt(selection.rangeCount - 1);
           delimitedAtEnd = /\s$/.test(endRange);
           if (!delimitedAtEnd) {
             let container = endRange.endContainer;
             let offset = endRange.endOffset;
-            if (container.nodeType == container.TEXT_NODE &&
-                offset < container.textContent.length)
+            if (
+              container.nodeType == container.TEXT_NODE &&
+              offset < container.textContent.length
+            ) {
               delimitedAtEnd = /\W/.test(container.textContent[offset]);
-            else
+            } else {
               delimitedAtEnd = true;
+            }
           }
         }
 
         if (delimitedAtStart && delimitedAtEnd) {
           try {
-            url = Services.uriFixup.createFixupURI(linkText, Services.uriFixup.FIXUP_FLAG_NONE);
+            url = Services.uriFixup.createFixupURI(
+              linkText,
+              Services.uriFixup.FIXUP_FLAG_NONE
+            );
           } catch (ex) {}
         }
       }
     }
 
     if (selectionStr) {
       // Pass up to 16K through unmolested.  If an add-on needs more, they will
       // have to use a content script.
       fullText = selectionStr.substr(0, 16384);
       selectionStr = this.trimSelection(selectionStr, aCharLen);
     }
 
     if (url && !url.host) {
       url = null;
     }
 
-    return { text: selectionStr, docSelectionIsCollapsed: collapsed, fullText,
-             linkURL: url ? url.spec : null, linkText: url ? linkText : "" };
+    return {
+      text: selectionStr,
+      docSelectionIsCollapsed: collapsed,
+      fullText,
+      linkURL: url ? url.spec : null,
+      linkText: url ? linkText : "",
+    };
   },
 
   // Iterates through every docshell in the window and calls PermitUnload.
   canCloseWindow(window) {
     let docShell = window.docShell;
     for (let i = 0; i < docShell.childCount; ++i) {
       let childShell = docShell.getChildAt(i).QueryInterface(Ci.nsIDocShell);
       let contentViewer = childShell.contentViewer;
@@ -547,31 +614,35 @@ var BrowserUtils = {
     let hasGETParam = /%s/i.test(url);
     let decodedPostData = postData ? unescape(postData) : "";
     let hasPOSTParam = /%s/i.test(decodedPostData);
 
     if (!hasGETParam && !hasPOSTParam) {
       if (param) {
         // If nor the url, nor postData contain parameters, but a parameter was
         // provided, return the original input.
-        throw new Error("A param was provided but there's nothing to bind it to");
+        throw new Error(
+          "A param was provided but there's nothing to bind it to"
+        );
       }
       return [url, postData];
     }
 
     let charset = "";
     const re = /^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/;
     let matches = url.match(re);
     if (matches) {
       [, url, charset] = matches;
     } else {
       // Try to fetch a charset from History.
       try {
         // Will return an empty string if character-set is not found.
-        let pageInfo = await PlacesUtils.history.fetch(url, {includeAnnotations: true});
+        let pageInfo = await PlacesUtils.history.fetch(url, {
+          includeAnnotations: true,
+        });
         if (pageInfo && pageInfo.annotations.has(PlacesUtils.CHARSET_ANNO)) {
           charset = pageInfo.annotations.get(PlacesUtils.CHARSET_ANNO);
         }
       } catch (ex) {
         // makeURI() throws if url is invalid.
         Cu.reportError(ex);
       }
     }
@@ -579,33 +650,38 @@ var BrowserUtils = {
     // encodeURIComponent produces UTF-8, and cannot be used for other charsets.
     // escape() works in those cases, but it doesn't uri-encode +, @, and /.
     // Therefore we need to manually replace these ASCII characters by their
     // encodeURIComponent result, to match the behavior of nsEscape() with
     // url_XPAlphas.
     let encodedParam = "";
     if (charset && charset != "UTF-8") {
       try {
-        let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
-                          .createInstance(Ci.nsIScriptableUnicodeConverter);
+        let converter = Cc[
+          "@mozilla.org/intl/scriptableunicodeconverter"
+        ].createInstance(Ci.nsIScriptableUnicodeConverter);
         converter.charset = charset;
         encodedParam = converter.ConvertFromUnicode(param) + converter.Finish();
       } catch (ex) {
         encodedParam = param;
       }
-      encodedParam = escape(encodedParam).replace(/[+@\/]+/g, encodeURIComponent);
+      encodedParam = escape(encodedParam).replace(
+        /[+@\/]+/g,
+        encodeURIComponent
+      );
     } else {
       // Default charset is UTF-8
       encodedParam = encodeURIComponent(param);
     }
 
     url = url.replace(/%s/g, encodedParam).replace(/%S/g, param);
     if (hasPOSTParam) {
-      postData = decodedPostData.replace(/%s/g, encodedParam)
-                                .replace(/%S/g, param);
+      postData = decodedPostData
+        .replace(/%s/g, encodedParam)
+        .replace(/%S/g, param);
     }
     return [url, postData];
   },
 
   /**
    * Generate a document fragment for a localized string that has DOM
    * node replacements. This avoids using getFormattedString followed
    * by assigning to innerHTML. Fluent can probably replace this when
@@ -630,33 +706,40 @@ var BrowserUtils = {
     // Ensure replacement points are indexed:
     for (let i = 1; i <= nodesOrStrings.length; i++) {
       if (!msg.includes("%" + i + "$S")) {
         msg = msg.replace(/%S/, "%" + i + "$S");
       }
     }
     let numberOfInsertionPoints = msg.match(/%\d+\$S/g).length;
     if (numberOfInsertionPoints != nodesOrStrings.length) {
-      Cu.reportError(`Message has ${numberOfInsertionPoints} insertion points, ` +
-                     `but got ${nodesOrStrings.length} replacement parameters!`);
+      Cu.reportError(
+        `Message has ${numberOfInsertionPoints} insertion points, ` +
+          `but got ${nodesOrStrings.length} replacement parameters!`
+      );
     }
 
     let fragment = doc.createDocumentFragment();
     let parts = [msg];
     let insertionPoint = 1;
     for (let replacement of nodesOrStrings) {
-      let insertionString = "%" + (insertionPoint++) + "$S";
-      let partIndex = parts.findIndex(part => typeof part == "string" && part.includes(insertionString));
+      let insertionString = "%" + insertionPoint++ + "$S";
+      let partIndex = parts.findIndex(
+        part => typeof part == "string" && part.includes(insertionString)
+      );
       if (partIndex == -1) {
         fragment.appendChild(doc.createTextNode(msg));
         return fragment;
       }
 
       if (typeof replacement == "string") {
-        parts[partIndex] = parts[partIndex].replace(insertionString, replacement);
+        parts[partIndex] = parts[partIndex].replace(
+          insertionString,
+          replacement
+        );
       } else {
         let [firstBit, lastBit] = parts[partIndex].split(insertionString);
         parts.splice(partIndex, 1, firstBit, replacement, lastBit);
       }
     }
 
     // Put everything in a document fragment:
     for (let part of parts) {
@@ -683,17 +766,17 @@ var BrowserUtils = {
    *        expected notification, false otherwise.
    * @returns {Promise<object>}
    */
   promiseObserved(topic, test = () => true) {
     return new Promise(resolve => {
       let observer = (subject, topic, data) => {
         if (test(subject, data)) {
           Services.obs.removeObserver(observer, topic);
-          resolve({subject, data});
+          resolve({ subject, data });
         }
       };
       Services.obs.addObserver(observer, topic);
     });
   },
 
   /**
    * Returns a URL which has been trimmed by removing 'http://' and any
@@ -710,18 +793,19 @@ var BrowserUtils = {
     let url = aURL.replace(/^((?:http|https|ftp):\/\/[^/]+)\/$/, "$1");
 
     // remove http://
     if (!url.startsWith("http://")) {
       return url;
     }
     let urlWithoutProtocol = url.substring(7);
 
-    let flags = Services.uriFixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP |
-                Services.uriFixup.FIXUP_FLAG_FIX_SCHEME_TYPOS;
+    let flags =
+      Services.uriFixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP |
+      Services.uriFixup.FIXUP_FLAG_FIX_SCHEME_TYPOS;
     let fixedUpURL, expectedURLSpec;
     try {
       fixedUpURL = Services.uriFixup.createFixupURI(urlWithoutProtocol, flags);
       expectedURLSpec = Services.io.newURI(aURL).displaySpec;
     } catch (ex) {
       return url;
     }
     if (fixedUpURL.displaySpec == expectedURLSpec) {
--- a/toolkit/modules/CanonicalJSON.jsm
+++ b/toolkit/modules/CanonicalJSON.jsm
@@ -16,45 +16,53 @@ var CanonicalJSON = {
    * The output will have all unicode chars escaped with the unicode codepoint
    * as lowercase hexadecimal.
    *
    * @usage
    *        CanonicalJSON.stringify(listOfRecords);
    **/
   stringify: function stringify(source, jsescFn) {
     if (typeof jsescFn != "function") {
-      const { jsesc } = ChromeUtils.import("resource://gre/modules/third_party/jsesc/jsesc.js");
+      const { jsesc } = ChromeUtils.import(
+        "resource://gre/modules/third_party/jsesc/jsesc.js"
+      );
       jsescFn = jsesc;
     }
     if (Array.isArray(source)) {
-      const jsonArray = source.map(x => typeof x === "undefined" ? null : x);
-      return "[" + jsonArray.map(item => stringify(item, jsescFn)).join(",") + "]";
+      const jsonArray = source.map(x => (typeof x === "undefined" ? null : x));
+      return (
+        "[" + jsonArray.map(item => stringify(item, jsescFn)).join(",") + "]"
+      );
     }
 
     if (typeof source === "number") {
       if (source === 0) {
-        return (Object.is(source, -0)) ? "-0" : "0";
+        return Object.is(source, -0) ? "-0" : "0";
       }
     }
 
     // Leverage jsesc library, mainly for unicode escaping.
-    const toJSON = (input) => jsescFn(input, {lowercaseHex: true, json: true});
+    const toJSON = input => jsescFn(input, { lowercaseHex: true, json: true });
 
     if (typeof source !== "object" || source === null) {
       return toJSON(source);
     }
 
     // Dealing with objects, ordering keys.
     const sortedKeys = Object.keys(source).sort();
     const lastIndex = sortedKeys.length - 1;
-    return sortedKeys.reduce((serial, key, index) => {
-      const value = source[key];
-      // JSON.stringify drops keys with an undefined value.
-      if (typeof value === "undefined") {
-        return serial;
-      }
-      const jsonValue = value && value.toJSON ? value.toJSON() : value;
-      const suffix = index !== lastIndex ? "," : "";
-      const escapedKey = toJSON(key);
-      return serial + escapedKey + ":" + stringify(jsonValue, jsescFn) + suffix;
-    }, "{") + "}";
+    return (
+      sortedKeys.reduce((serial, key, index) => {
+        const value = source[key];
+        // JSON.stringify drops keys with an undefined value.
+        if (typeof value === "undefined") {
+          return serial;
+        }
+        const jsonValue = value && value.toJSON ? value.toJSON() : value;
+        const suffix = index !== lastIndex ? "," : "";
+        const escapedKey = toJSON(key);
+        return (
+          serial + escapedKey + ":" + stringify(jsonValue, jsescFn) + suffix
+        );
+      }, "{") + "}"
+    );
   },
 };
--- a/toolkit/modules/CertUtils.jsm
+++ b/toolkit/modules/CertUtils.jsm
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 var EXPORTED_SYMBOLS = ["CertUtils"];
 
 const Ce = Components.Exception;
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 /**
  * Reads a set of expected certificate attributes from preferences. The returned
  * array can be passed to validateCert or checkCert to validate that a
  * certificate matches the expected attributes. The preferences should look like
  * this:
  *   prefix.1.attribute1
  *   prefix.1.attribute2
@@ -22,30 +22,33 @@ const {Services} = ChromeUtils.import("r
  * certificates would be accepted by validateCert.
  *
  * @param  aPrefBranch
  *         The prefix for all preferences, should end with a ".".
  * @return An array of JS objects with names / values corresponding to the
  *         expected certificate's attribute names / values.
  */
 function readCertPrefs(aPrefBranch) {
-  if (Services.prefs.getBranch(aPrefBranch).getChildList("").length == 0)
+  if (Services.prefs.getBranch(aPrefBranch).getChildList("").length == 0) {
     return null;
+  }
 
   let certs = [];
   let counter = 1;
   while (true) {
     let prefBranchCert = Services.prefs.getBranch(aPrefBranch + counter + ".");
     let prefCertAttrs = prefBranchCert.getChildList("");
-    if (prefCertAttrs.length == 0)
+    if (prefCertAttrs.length == 0) {
       break;
+    }
 
     let certAttrs = {};
-    for (let prefCertAttr of prefCertAttrs)
+    for (let prefCertAttr of prefCertAttrs) {
       certAttrs[prefCertAttr] = prefBranchCert.getCharPref(prefCertAttr);
+    }
 
     certs.push(certAttrs);
     counter++;
   }
 
   return certs;
 }
 
@@ -62,53 +65,63 @@ function readCertPrefs(aPrefBranch) {
  * @throws NS_ERROR_ILLEGAL_VALUE if a certificate attribute name from the
  *         aCerts param does not exist or the value for a certificate attribute
  *         from the aCerts param is different than the expected value or
  *         aCertificate wasn't specified and aCerts is not null or an empty
  *         array.
  */
 function validateCert(aCertificate, aCerts) {
   // If there are no certificate requirements then just exit
-  if (!aCerts || aCerts.length == 0)
+  if (!aCerts || aCerts.length == 0) {
     return;
+  }
 
   if (!aCertificate) {
     const missingCertErr = "A required certificate was not present.";
     Cu.reportError(missingCertErr);
     throw new Ce(missingCertErr, Cr.NS_ERROR_ILLEGAL_VALUE);
   }
 
   var errors = [];
   for (var i = 0; i < aCerts.length; ++i) {
     var error = false;
     var certAttrs = aCerts[i];
     for (var name in certAttrs) {
       if (!(name in aCertificate)) {
         error = true;
-        errors.push("Expected attribute '" + name + "' not present in " +
-                    "certificate.");
+        errors.push(
+          "Expected attribute '" + name + "' not present in " + "certificate."
+        );
         break;
       }
       if (aCertificate[name] != certAttrs[name]) {
         error = true;
-        errors.push("Expected certificate attribute '" + name + "' " +
-                    "value incorrect, expected: '" + certAttrs[name] +
-                    "', got: '" + aCertificate[name] + "'.");
+        errors.push(
+          "Expected certificate attribute '" +
+            name +
+            "' " +
+            "value incorrect, expected: '" +
+            certAttrs[name] +
+            "', got: '" +
+            aCertificate[name] +
+            "'."
+        );
         break;
       }
     }
 
-    if (!error)
+    if (!error) {
       break;
+    }
   }
 
   if (error) {
     errors.forEach(Cu.reportError.bind(Cu));
-    const certCheckErr = "Certificate checks failed. See previous errors " +
-                         "for details.";
+    const certCheckErr =
+      "Certificate checks failed. See previous errors " + "for details.";
     Cu.reportError(certCheckErr);
     throw new Ce(certCheckErr, Cr.NS_ERROR_ILLEGAL_VALUE);
   }
 }
 
 /**
  * Checks if the connection must be HTTPS and if so, only allows built-in
  * certificates and validates application specified certificate attribute
@@ -131,33 +144,38 @@ function validateCert(aCertificate, aCer
  *         aCerts param does not exist or the value for a certificate attribute
  *         from the aCerts  param is different than the expected value.
  *         NS_ERROR_ABORT if the certificate issuer is not built-in.
  */
 function checkCert(aChannel, aAllowNonBuiltInCerts, aCerts) {
   if (!aChannel.originalURI.schemeIs("https")) {
     // Require https if there are certificate values to verify
     if (aCerts) {
-      throw new Ce("SSL is required and URI scheme is not https.",
-                   Cr.NS_ERROR_UNEXPECTED);
+      throw new Ce(
+        "SSL is required and URI scheme is not https.",
+        Cr.NS_ERROR_UNEXPECTED
+      );
     }
     return;
   }
 
-  let secInfo = aChannel.securityInfo.QueryInterface(Ci.nsITransportSecurityInfo);
+  let secInfo = aChannel.securityInfo.QueryInterface(
+    Ci.nsITransportSecurityInfo
+  );
   let cert = secInfo.serverCert;
 
   validateCert(cert, aCerts);
 
   if (aAllowNonBuiltInCerts === true) {
     return;
   }
 
   let issuerCert = null;
-  for (issuerCert of secInfo.succeededCertChain.getEnumerator());
+  for (issuerCert of secInfo.succeededCertChain.getEnumerator()) {
+  }
 
   const certNotBuiltInErr = "Certificate issuer is not built-in.";
   if (!issuerCert) {
     throw new Ce(certNotBuiltInErr, Cr.NS_ERROR_ABORT);
   }
 
   if (!issuerCert.isBuiltInRoot) {
     throw new Ce(certNotBuiltInErr, Cr.NS_ERROR_ABORT);
@@ -172,41 +190,43 @@ function checkCert(aChannel, aAllowNonBu
  * @param  aAllowNonBuiltInCerts (optional)
  *         When true certificates that aren't builtin are allowed. When false
  *         or not specified the certificate must be a builtin certificate.
  */
 function BadCertHandler(aAllowNonBuiltInCerts) {
   this.allowNonBuiltInCerts = aAllowNonBuiltInCerts;
 }
 BadCertHandler.prototype = {
-
   // nsIChannelEventSink
   asyncOnChannelRedirect(oldChannel, newChannel, flags, callback) {
     if (this.allowNonBuiltInCerts) {
       callback.onRedirectVerifyCallback(Cr.NS_OK);
       return;
     }
 
     // make sure the certificate of the old channel checks out before we follow
     // a redirect from it.  See bug 340198.
     // Don't call checkCert for internal redirects. See bug 569648.
-    if (!(flags & Ci.nsIChannelEventSink.REDIRECT_INTERNAL))
+    if (!(flags & Ci.nsIChannelEventSink.REDIRECT_INTERNAL)) {
       checkCert(oldChannel);
+    }
 
     callback.onRedirectVerifyCallback(Cr.NS_OK);
   },
 
   // nsIInterfaceRequestor
   getInterface(iid) {
     return this.QueryInterface(iid);
   },
 
   // nsISupports
-  QueryInterface: ChromeUtils.generateQI(["nsIChannelEventSink",
-                                          "nsIInterfaceRequestor"]),
+  QueryInterface: ChromeUtils.generateQI([
+    "nsIChannelEventSink",
+    "nsIInterfaceRequestor",
+  ]),
 };
 
 var CertUtils = {
   BadCertHandler,
   checkCert,
   readCertPrefs,
   validateCert,
 };
--- a/toolkit/modules/CharsetMenu.jsm
+++ b/toolkit/modules/CharsetMenu.jsm
@@ -1,29 +1,30 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-var EXPORTED_SYMBOLS = [ "CharsetMenu" ];
+var EXPORTED_SYMBOLS = ["CharsetMenu"];
 
-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.defineLazyGetter(this, "gBundle", function() {
   const kUrl = "chrome://global/locale/charsetMenu.properties";
   return Services.strings.createBundle(kUrl);
 });
 
-ChromeUtils.defineModuleGetter(this, "Deprecated",
-    "resource://gre/modules/Deprecated.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Deprecated",
+  "resource://gre/modules/Deprecated.jsm"
+);
 
-const kAutoDetectors = [
-  ["off", ""],
-  ["ru", "ruprob"],
-  ["uk", "ukprob"],
-];
+const kAutoDetectors = [["off", ""], ["ru", "ruprob"], ["uk", "ukprob"]];
 
 /**
  * This set contains encodings that are in the Encoding Standard, except:
  *  - Japanese encodings are represented by one autodetection item
  *  - x-user-defined, which practically never makes sense as an end-user-chosen
  *    override.
  *  - Encodings that IE11 doesn't have in its corresponding menu.
  */
@@ -74,53 +75,57 @@ const kEncodings = new Set([
   // "ISO-8859-10",
   // "ISO-8859-14",
   // "ISO-8859-15",
   // "ISO-8859-16",
   // "macintosh"
 ]);
 
 // Always at the start of the menu, in this order, followed by a separator.
-const kPinned = [
-  "UTF-8",
-  "windows-1252",
-];
+const kPinned = ["UTF-8", "windows-1252"];
 
 kPinned.forEach(x => kEncodings.delete(x));
 
 function CharsetComparator(a, b) {
   // Normal sorting sorts the part in parenthesis in an order that
   // happens to make the less frequently-used items first.
   let titleA = a.label.replace(/\(.*/, "") + b.value;
   let titleB = b.label.replace(/\(.*/, "") + a.value;
   // Secondarily reverse sort by encoding name to sort "windows"
   return titleA.localeCompare(titleB) || b.value.localeCompare(a.value);
 }
 
 function SetDetector(event) {
-  Services.prefs.setStringPref("intl.charset.detector",
-                               event.target.getAttribute("detector"));
+  Services.prefs.setStringPref(
+    "intl.charset.detector",
+    event.target.getAttribute("detector")
+  );
 }
 
 function UpdateDetectorMenu(event) {
   event.stopPropagation();
-  let detector = Services.prefs.getComplexValue("intl.charset.detector", Ci.nsIPrefLocalizedString);
+  let detector = Services.prefs.getComplexValue(
+    "intl.charset.detector",
+    Ci.nsIPrefLocalizedString
+  );
   let menuitem = this.getElementsByAttribute("detector", detector).item(0);
   if (menuitem) {
     menuitem.setAttribute("checked", "true");
   }
 }
 
 var gDetectorInfoCache, gCharsetInfoCache, gPinnedInfoCache;
 
 var CharsetMenu = {
   build(parent, deprecatedShowAccessKeys = true, showDetector = true) {
     if (!deprecatedShowAccessKeys) {
-      Deprecated.warning("CharsetMenu no longer supports building a menu with no access keys.",
-                         "https://bugzilla.mozilla.org/show_bug.cgi?id=1088710");
+      Deprecated.warning(
+        "CharsetMenu no longer supports building a menu with no access keys.",
+        "https://bugzilla.mozilla.org/show_bug.cgi?id=1088710"
+      );
     }
     function createDOMNode(doc, nodeInfo) {
       let node = doc.createXULElement("menuitem");
       node.setAttribute("type", "radio");
       node.setAttribute("name", nodeInfo.name + "Group");
       node.setAttribute(nodeInfo.name, nodeInfo.value);
       node.setAttribute("label", nodeInfo.label);
       if (nodeInfo.accesskey) {
@@ -133,32 +138,44 @@ var CharsetMenu = {
       // Detector menu or charset menu already built
       return;
     }
     this._ensureDataReady();
     let doc = parent.ownerDocument;
 
     if (showDetector) {
       let menuNode = doc.createXULElement("menu");
-      menuNode.setAttribute("label", gBundle.GetStringFromName("charsetMenuAutodet"));
-      menuNode.setAttribute("accesskey", gBundle.GetStringFromName("charsetMenuAutodet.key"));
+      menuNode.setAttribute(
+        "label",
+        gBundle.GetStringFromName("charsetMenuAutodet")
+      );
+      menuNode.setAttribute(
+        "accesskey",
+        gBundle.GetStringFromName("charsetMenuAutodet.key")
+      );
       parent.appendChild(menuNode);
 
       let menuPopupNode = doc.createXULElement("menupopup");
       menuNode.appendChild(menuPopupNode);
       menuPopupNode.addEventListener("command", SetDetector);
       menuPopupNode.addEventListener("popupshown", UpdateDetectorMenu);
 
-      gDetectorInfoCache.forEach(detectorInfo => menuPopupNode.appendChild(createDOMNode(doc, detectorInfo)));
+      gDetectorInfoCache.forEach(detectorInfo =>
+        menuPopupNode.appendChild(createDOMNode(doc, detectorInfo))
+      );
       parent.appendChild(doc.createXULElement("menuseparator"));
     }
 
-    gPinnedInfoCache.forEach(charsetInfo => parent.appendChild(createDOMNode(doc, charsetInfo)));
+    gPinnedInfoCache.forEach(charsetInfo =>
+      parent.appendChild(createDOMNode(doc, charsetInfo))
+    );
     parent.appendChild(doc.createXULElement("menuseparator"));
-    gCharsetInfoCache.forEach(charsetInfo => parent.appendChild(createDOMNode(doc, charsetInfo)));
+    gCharsetInfoCache.forEach(charsetInfo =>
+      parent.appendChild(createDOMNode(doc, charsetInfo))
+    );
   },
 
   getData() {
     this._ensureDataReady();
     return {
       detectors: gDetectorInfoCache,
       pinnedCharsets: gPinnedInfoCache,
       otherCharsets: gCharsetInfoCache,
@@ -199,17 +216,19 @@ var CharsetMenu = {
   _getDetectorLabel(detector) {
     try {
       return gBundle.GetStringFromName("charsetMenuAutodet." + detector);
     } catch (ex) {}
     return detector;
   },
   _getDetectorAccesskey(detector) {
     try {
-      return gBundle.GetStringFromName("charsetMenuAutodet." + detector + ".key");
+      return gBundle.GetStringFromName(
+        "charsetMenuAutodet." + detector + ".key"
+      );
     } catch (ex) {}
     return "";
   },
 
   _getCharsetLabel(charset) {
     if (charset == "GBK") {
       // Localization key has been revised
       charset = "gbk.bis";
@@ -237,17 +256,17 @@ var CharsetMenu = {
   foldCharset(charset, isAutodetected) {
     if (isAutodetected) {
       switch (charset) {
         case "Shift_JIS":
         case "EUC-JP":
         case "ISO-2022-JP":
           return "Japanese";
         default:
-          // fall through
+        // fall through
       }
     }
     switch (charset) {
       case "ISO-8859-8-I":
         return "windows-1255";
 
       case "gb18030":
         return "GBK";
@@ -256,17 +275,18 @@ var CharsetMenu = {
         return charset;
     }
   },
 
   /**
    * This method is for comm-central callers only.
    */
   update(parent, charset) {
-    let menuitem = parent.getElementsByAttribute("charset", this.foldCharset(charset, false)).item(0);
+    let menuitem = parent
+      .getElementsByAttribute("charset", this.foldCharset(charset, false))
+      .item(0);
     if (menuitem) {
       menuitem.setAttribute("checked", "true");
     }
   },
 };
 
 Object.freeze(CharsetMenu);
-
--- a/toolkit/modules/Color.jsm
+++ b/toolkit/modules/Color.jsm
@@ -56,21 +56,19 @@ class Color {
    * @return {Number} Relative luminance, represented as number between 0 and 1.
    */
   get relativeLuminance() {
     let colorArr = [this.r, this.g, this.b].map(color => {
       color = parseInt(color, 10);
       if (color <= 10) {
         return color / 255 / 12.92;
       }
-      return Math.pow(((color / 255) + 0.055) / 1.055, 2.4);
+      return Math.pow((color / 255 + 0.055) / 1.055, 2.4);
     });
-    return colorArr[0] * 0.2126 +
-           colorArr[1] * 0.7152 +
-           colorArr[2] * 0.0722;
+    return colorArr[0] * 0.2126 + colorArr[1] * 0.7152 + colorArr[2] * 0.0722;
   }
 
   /**
    * @return {Boolean} TRUE if you need to use a bright color (e.g. 'white'), when
    *                   this color is set as the background.
    */
   get useBrightText() {
     return this.relativeLuminance <= CONTRAST_BRIGHTTEXT_THRESHOLD;
@@ -89,18 +87,20 @@ class Color {
    */
   contrastRatio(otherColor) {
     if (!(otherColor instanceof Color)) {
       throw new TypeError("The first argument should be an instance of Color");
     }
 
     let luminance = this.relativeLuminance;
     let otherLuminance = otherColor.relativeLuminance;
-    return (Math.max(luminance, otherLuminance) + 0.05) /
-      (Math.min(luminance, otherLuminance) + 0.05);
+    return (
+      (Math.max(luminance, otherLuminance) + 0.05) /
+      (Math.min(luminance, otherLuminance) + 0.05)
+    );
   }
 
   /**
    * Method to check if the contrast ratio between two colors is high enough to
    * be discernable.
    *
    * @param  {Color}  otherColor Color instance to calculate the contrast with
    * @param  {String} [level]    WCAG conformance level that maps to the minimum
--- a/toolkit/modules/Console.jsm
+++ b/toolkit/modules/Console.jsm
@@ -15,20 +15,23 @@
  * - The Firebug console API is implemented in many places with differences in
  *   the implementations, so there isn't a single reference to adhere to
  * - The Firebug console is a rich display compared with dump(), so there will
  *   be many things that we can't replicate
  * - The primary use of this API is debugging and error logging so the perfect
  *   implementation isn't always required (or even well defined)
  */
 
-var EXPORTED_SYMBOLS = [ "console", "ConsoleAPI" ];
+var EXPORTED_SYMBOLS = ["console", "ConsoleAPI"];
 
-ChromeUtils.defineModuleGetter(this, "Services",
-                               "resource://gre/modules/Services.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Services",
+  "resource://gre/modules/Services.jsm"
+);
 
 var gTimerRegistry = new Map();
 
 /**
  * String utility to ensure that strings are a specified length. Strings
  * that are too long are truncated to the max length and the last char is
  * set to "_". Strings that are too short are padded with spaces.
  *
@@ -55,26 +58,26 @@ function fmt(aStr, aMaxLen, aMinLen, aOp
   }
   if (aStr == null) {
     aStr = "";
   }
   if (aStr.length > aMaxLen) {
     if (aOptions && aOptions.truncate == "start") {
       return "_" + aStr.substring(aStr.length - aMaxLen + 1);
     } else if (aOptions && aOptions.truncate == "center") {
-      let start = aStr.substring(0, (aMaxLen / 2));
+      let start = aStr.substring(0, aMaxLen / 2);
 
-      let end = aStr.substring((aStr.length - (aMaxLen / 2)) + 1);
+      let end = aStr.substring(aStr.length - aMaxLen / 2 + 1);
       return start + "_" + end;
     }
     return aStr.substring(0, aMaxLen - 1) + "_";
   }
   if (aStr.length < aMinLen) {
     let padding = Array(aMinLen - aStr.length + 1).join(" ");
-    aStr = (aOptions.align === "end") ? padding + aStr : aStr + padding;
+    aStr = aOptions.align === "end" ? padding + aStr : aStr + padding;
   }
   return aStr;
 }
 
 /**
  * Utility to extract the constructor name of an object.
  * Object.toString gives: "[object ?????]"; we want the "?????".
  *
@@ -102,20 +105,21 @@ function getCtorName(aObj) {
  * Indicates whether an object is a JS or `Components.Exception` error.
  *
  * @param {object} aThing
           The object to check
  * @return {boolean}
           Is this object an error?
  */
 function isError(aThing) {
-  return aThing && (
-           (typeof aThing.name == "string" &&
-            aThing.name.startsWith("NS_ERROR_")) ||
-           getCtorName(aThing).endsWith("Error"));
+  return (
+    aThing &&
+    ((typeof aThing.name == "string" && aThing.name.startsWith("NS_ERROR_")) ||
+      getCtorName(aThing).endsWith("Error"))
+  );
 }
 
 /**
  * A single line stringification of an object designed for use by humans
  *
  * @param {any} aThing
  *        The object to be stringified
  * @param {boolean} aAllowNewLines
@@ -136,17 +140,17 @@ function stringify(aThing, aAllowNewLine
     return "Message: " + aThing;
   }
 
   if (typeof aThing == "object") {
     let type = getCtorName(aThing);
     if (Element.isInstance(aThing)) {
       return debugElement(aThing);
     }
-    type = (type == "Object" ? "" : type + " ");
+    type = type == "Object" ? "" : type + " ";
     let json;
     try {
       json = JSON.stringify(aThing);
     } catch (ex) {
       // Can't use a real ellipsis here, because cmd.exe isn't unicode-enabled
       json = "{" + Object.keys(aThing).join(":..,") + ":.., }";
     }
     return type + json;
@@ -167,22 +171,25 @@ function stringify(aThing, aAllowNewLine
  * Create a simple debug representation of a given element.
  *
  * @param {Element} aElement
  *        The element to debug
  * @return {string}
  *        A simple single line representation of aElement
  */
 function debugElement(aElement) {
-  return "<" + aElement.tagName +
-      (aElement.id ? "#" + aElement.id : "") +
-      (aElement.className && aElement.className.split ?
-          "." + aElement.className.split(" ").join(" .") :
-          "") +
-      ">";
+  return (
+    "<" +
+    aElement.tagName +
+    (aElement.id ? "#" + aElement.id : "") +
+    (aElement.className && aElement.className.split
+      ? "." + aElement.className.split(" ").join(" .")
+      : "") +
+    ">"
+  );
 }
 
 /**
  * A multi line stringification of an object, designed for use by humans
  *
  * @param {any} aThing
  *        The object to be stringified
  * @return {string}
@@ -277,34 +284,34 @@ function logProperty(aProp, aValue) {
     reply += formatTrace(trace);
   } else {
     reply += "    - " + aProp + " = " + stringify(aValue) + "\n";
   }
   return reply;
 }
 
 const LOG_LEVELS = {
-  "all": Number.MIN_VALUE,
-  "debug": 2,
-  "log": 3,
-  "info": 3,
-  "clear": 3,
-  "trace": 3,
-  "timeEnd": 3,
-  "time": 3,
-  "assert": 3,
-  "group": 3,
-  "groupEnd": 3,
-  "profile": 3,
-  "profileEnd": 3,
-  "dir": 3,
-  "dirxml": 3,
-  "warn": 4,
-  "error": 5,
-  "off": Number.MAX_VALUE,
+  all: Number.MIN_VALUE,
+  debug: 2,
+  log: 3,
+  info: 3,
+  clear: 3,
+  trace: 3,
+  timeEnd: 3,
+  time: 3,
+  assert: 3,
+  group: 3,
+  groupEnd: 3,
+  profile: 3,
+  profileEnd: 3,
+  dir: 3,
+  dirxml: 3,
+  warn: 4,
+  error: 5,
+  off: Number.MAX_VALUE,
 };
 
 /**
  * Helper to tell if a console message of `aLevel` type
  * should be logged in stdout and sent to consoles given
  * the current maximum log level being defined in `console.maxLogLevel`
  *
  * @param {string} aLevel
@@ -385,19 +392,23 @@ function getStack(aFrame, aMaxDepth = 0)
  *
  * @param {object[]} aTrace
  *        Array of trace objects as created by parseStack()
  * @return {string} Multi line report of the stack trace
  */
 function formatTrace(aTrace) {
   let reply = "";
   aTrace.forEach(function(frame) {
-    reply += fmt(frame.filename, 20, 20, { truncate: "start" }) + " " +
-             fmt(frame.lineNumber, 5, 5) + " " +
-             fmt(frame.functionName, 75, 0, { truncate: "center" }) + "\n";
+    reply +=
+      fmt(frame.filename, 20, 20, { truncate: "start" }) +
+      " " +
+      fmt(frame.lineNumber, 5, 5) +
+      " " +
+      fmt(frame.functionName, 75, 0, { truncate: "center" }) +
+      "\n";
   });
   return reply;
 }
 
 /**
  * Create a new timer by recording the current time under the specified name.
  *
  * @param {string} aName
@@ -444,19 +455,22 @@ function stopTimer(aName, aTimestamp) {
  *        ConsoleAPI instance
  * @param {string} aLevel
  *        The string identifier for the message log level
  * @param {string} aMessage
  *        The string message to print to stdout
  */
 function dumpMessage(aConsole, aLevel, aMessage) {
   aConsole.dump(
-    "console." + aLevel + ": " +
-    (aConsole.prefix ? aConsole.prefix + ": " : "") +
-    aMessage + "\n"
+    "console." +
+      aLevel +
+      ": " +
+      (aConsole.prefix ? aConsole.prefix + ": " : "") +
+      aMessage +
+      "\n"
   );
 }
 
 /**
  * Create a function which will output a concise level of output when used
  * as a logging function
  *
  * @param {string} aLevel
@@ -561,18 +575,19 @@ function sendConsoleAPIMessage(aConsole,
       } catch (ex) {
         Cu.reportError(ex);
         Cu.reportError(ex.stack);
         return;
       }
       break;
   }
 
-  let ConsoleAPIStorage = Cc["@mozilla.org/consoleAPI-storage;1"]
-                            .getService(Ci.nsIConsoleAPIStorage);
+  let ConsoleAPIStorage = Cc["@mozilla.org/consoleAPI-storage;1"].getService(
+    Ci.nsIConsoleAPIStorage
+  );
   if (ConsoleAPIStorage) {
     ConsoleAPIStorage.recordEvent("jsm", null, consoleEvent);
   }
 }
 
 /**
  * This creates a console object that somewhat replicates Firebug's console
  * object
@@ -607,31 +622,39 @@ function ConsoleAPI(aConsoleOptions = {}
   this.dump = aConsoleOptions.dump || dump;
   this.prefix = aConsoleOptions.prefix || "";
   this.maxLogLevel = aConsoleOptions.maxLogLevel;
   this.innerID = aConsoleOptions.innerID || null;
   this.consoleID = aConsoleOptions.consoleID || "";
 
   // Setup maxLogLevelPref watching
   let updateMaxLogLevel = () => {
-    if (Services.prefs.getPrefType(aConsoleOptions.maxLogLevelPref) == Services.prefs.PREF_STRING) {
-      this._maxLogLevel = Services.prefs.getCharPref(aConsoleOptions.maxLogLevelPref).toLowerCase();
+    if (
+      Services.prefs.getPrefType(aConsoleOptions.maxLogLevelPref) ==
+      Services.prefs.PREF_STRING
+    ) {
+      this._maxLogLevel = Services.prefs
+        .getCharPref(aConsoleOptions.maxLogLevelPref)
+        .toLowerCase();
     } else {
       this._maxLogLevel = this._maxExplicitLogLevel;
     }
   };
 
   if (aConsoleOptions.maxLogLevelPref) {
     updateMaxLogLevel();
-    Services.prefs.addObserver(aConsoleOptions.maxLogLevelPref, updateMaxLogLevel);
+    Services.prefs.addObserver(
+      aConsoleOptions.maxLogLevelPref,
+      updateMaxLogLevel
+    );
   }
 
   // Bind all the functions to this object.
   for (let prop in this) {
-    if (typeof(this[prop]) === "function") {
+    if (typeof this[prop] === "function") {
       this[prop] = this[prop].bind(this);
     }
   }
 }
 
 ConsoleAPI.prototype = {
   /**
    * The last log level that was specified via the constructor or setter. This
@@ -651,18 +674,17 @@ ConsoleAPI.prototype = {
   exception: createMultiLineDumper("error"),
 
   trace: function Console_trace() {
     if (!shouldLog("trace", this.maxLogLevel)) {
       return;
     }
     let args = Array.prototype.slice.call(arguments, 0);
     let trace = getStack(Components.stack.caller);
-    sendConsoleAPIMessage(this, "trace", trace[0], args,
-                          { stacktrace: trace });
+    sendConsoleAPIMessage(this, "trace", trace[0], args, { stacktrace: trace });
     dumpMessage(this, "trace", "\n" + formatTrace(trace));
   },
   clear: function Console_clear() {},
 
   dir: createMultiLineDumper("dir"),
   dirxml: createMultiLineDumper("dirxml"),
   group: createDumper("group"),
   groupEnd: createDumper("groupEnd"),
@@ -670,57 +692,65 @@ ConsoleAPI.prototype = {
   time: function Console_time() {
     if (!shouldLog("time", this.maxLogLevel)) {
       return;
     }
     let args = Array.prototype.slice.call(arguments, 0);
     let frame = getStack(Components.stack.caller, 1)[0];
     let timer = startTimer(args[0]);
     sendConsoleAPIMessage(this, "time", frame, args, { timer });
-    dumpMessage(this, "time",
-                "'" + timer.name + "' @ " + (new Date()));
+    dumpMessage(this, "time", "'" + timer.name + "' @ " + new Date());
   },
 
   timeEnd: function Console_timeEnd() {
     if (!shouldLog("timeEnd", this.maxLogLevel)) {
       return;
     }
     let args = Array.prototype.slice.call(arguments, 0);
     let frame = getStack(Components.stack.caller, 1)[0];
     let timer = stopTimer(args[0]);
     sendConsoleAPIMessage(this, "timeEnd", frame, args, { timer });
-    dumpMessage(this, "timeEnd",
-                "'" + timer.name + "' " + timer.duration + "ms");
+    dumpMessage(
+      this,
+      "timeEnd",
+      "'" + timer.name + "' " + timer.duration + "ms"
+    );
   },
 
   profile(profileName) {
     if (!shouldLog("profile", this.maxLogLevel)) {
       return;
     }
-    Services.obs.notifyObservers({
-      wrappedJSObject: {
-        action: "profile",
-        arguments: [ profileName ],
-        chromeContext: true,
+    Services.obs.notifyObservers(
+      {
+        wrappedJSObject: {
+          action: "profile",
+          arguments: [profileName],
+          chromeContext: true,
+        },
       },
-    }, "console-api-profiler");
+      "console-api-profiler"
+    );
     dumpMessage(this, "profile", `'${profileName}'`);
   },
 
   profileEnd(profileName) {
     if (!shouldLog("profileEnd", this.maxLogLevel)) {
       return;
     }
-    Services.obs.notifyObservers({
-      wrappedJSObject: {
-        action: "profileEnd",
-        arguments: [ profileName ],
-        chromeContext: true,
+    Services.obs.notifyObservers(
+      {
+        wrappedJSObject: {
+          action: "profileEnd",
+          arguments: [profileName],
+          chromeContext: true,
+        },
       },
-    }, "console-api-profiler");
+      "console-api-profiler"
+    );
     dumpMessage(this, "profileEnd", `'${profileName}'`);
   },
 
   get maxLogLevel() {
     return this._maxLogLevel || "all";
   },
 
   set maxLogLevel(aValue) {
--- a/toolkit/modules/ContentDOMReference.jsm
+++ b/toolkit/modules/ContentDOMReference.jsm
@@ -11,21 +11,26 @@
  * element hasn't had all of its other references dropped).
  *
  * The hope is that this module can eliminate the need for passing CPOW references
  * between processes during runtime.
  */
 
 var EXPORTED_SYMBOLS = ["ContentDOMReference"];
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 
-XPCOMUtils.defineLazyServiceGetter(this, "finalizationService",
-                                   "@mozilla.org/toolkit/finalizationwitness;1",
-                                   "nsIFinalizationWitnessService");
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "finalizationService",
+  "@mozilla.org/toolkit/finalizationwitness;1",
+  "nsIFinalizationWitnessService"
+);
 
 /**
  * @typedef {number} ElementID
  * @typedef {Object} ElementIdentifier
  */
 
 const FINALIZATION_TOPIC = "content-dom-reference-finalized";
 
@@ -45,17 +50,19 @@ const finalizerRoots = new WeakMap();
  *
  *   elementToID:
  *     A WeakMap from a DOM element to an ID that refers to it.
  */
 var gRegistry = new WeakMap();
 
 var ContentDOMReference = {
   _init() {
-    const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+    const { Services } = ChromeUtils.import(
+      "resource://gre/modules/Services.jsm"
+    );
     Services.obs.addObserver(this, FINALIZATION_TOPIC);
   },
 
   observe(subject, topic, data) {
     if (topic !== FINALIZATION_TOPIC) {
       throw new Error("Unexpected observer topic");
     }
 
@@ -67,21 +74,24 @@ var ContentDOMReference = {
    * Generate and return an identifier for a given DOM element.
    *
    * @param {Element} element The DOM element to generate the identifier for.
    * @return {ElementIdentifier} The identifier for the DOM element that can be passed between
    * processes as a message.
    */
   get(element) {
     if (!element) {
-      throw new Error("Can't create a ContentDOMReference identifier for " +
-                      "non-existant nodes.");
+      throw new Error(
+        "Can't create a ContentDOMReference identifier for " +
+          "non-existant nodes."
+      );
     }
 
-    let browsingContext = element.ownerGlobal.getWindowGlobalChild().browsingContext;
+    let browsingContext = element.ownerGlobal.getWindowGlobalChild()
+      .browsingContext;
     let mappings = gRegistry.get(browsingContext);
     if (!mappings) {
       mappings = {
         IDToElement: new Map(),
         elementToID: new WeakMap(),
       };
       gRegistry.set(browsingContext, mappings);
     }
@@ -95,48 +105,48 @@ var ContentDOMReference = {
     // We must be registering a new element at this point.
     id = Math.random();
     mappings.elementToID.set(element, id);
     mappings.IDToElement.set(id, Cu.getWeakReference(element));
 
     let identifier = { browsingContextId: browsingContext.id, id };
 
     finalizerRoots.set(
-        element,
-        finalizationService.make(FINALIZATION_TOPIC,
-                                 JSON.stringify(identifier)));
+      element,
+      finalizationService.make(FINALIZATION_TOPIC, JSON.stringify(identifier))
+    );
 
     return identifier;
   },
 
   /**
    * Resolves an identifier back into the DOM Element that it was generated from.
    *
    * @param {ElementIdentifier} The identifier generated via ContentDOMReference.get for a
    * DOM element.
    * @return {Element} The DOM element that the identifier was generated for, or
    * null if the element does not still exist.
    */
   resolve(identifier) {
     let browsingContext = BrowsingContext.get(identifier.browsingContextId);
-    let {id} = identifier;
+    let { id } = identifier;
     return this._resolveIDToElement(browsingContext, id);
   },
 
   /**
    * Removes an identifier from the registry so that subsequent attempts
    * to resolve it will result in null. This is done automatically when the
    * target node is GCed.
    *
    * @param {ElementIdentifier} The identifier to revoke, issued by ContentDOMReference.get for
    * a DOM element.
    */
   _revoke(identifier) {
     let browsingContext = BrowsingContext.get(identifier.browsingContextId);
-    let {id} = identifier;
+    let { id } = identifier;
 
     let mappings = gRegistry.get(browsingContext);
     if (!mappings) {
       return;
     }
 
     mappings.IDToElement.delete(id);
   },
--- a/toolkit/modules/CreditCard.jsm
+++ b/toolkit/modules/CreditCard.jsm
@@ -88,17 +88,17 @@ class CreditCard {
     this._expirationYear = CreditCard.normalizeExpirationYear(value);
   }
 
   get expirationYear() {
     return this._expirationYear;
   }
 
   set expirationString(value) {
-    let {month, year} = CreditCard.parseExpirationString(value);
+    let { month, year } = CreditCard.parseExpirationString(value);
     this.expirationMonth = month;
     this.expirationYear = year;
   }
 
   set ccv(value) {
     this._ccv = value;
   }
 
@@ -115,18 +115,19 @@ class CreditCard {
    * @throws if the value is an invalid credit card number
    */
   set number(value) {
     if (value) {
       let normalizedNumber = value.replace(/[-\s]/g, "");
       // Based on the information on wiki[1], the shortest valid length should be
       // 12 digits (Maestro).
       // [1] https://en.wikipedia.org/wiki/Payment_card_number
-      normalizedNumber = normalizedNumber.match(/^\d{12,}$/) ?
-        normalizedNumber : "";
+      normalizedNumber = normalizedNumber.match(/^\d{12,}$/)
+        ? normalizedNumber
+        : "";
       this._number = normalizedNumber;
     } else {
       this._number = "";
     }
 
     if (value && !this.isValidNumber()) {
       this._number = "";
       throw new Error("Invalid credit card number");
@@ -191,33 +192,35 @@ class CreditCard {
     let currentDate = new Date();
     let currentYear = currentDate.getFullYear();
     if (this._expirationYear > currentYear) {
       return true;
     }
 
     // getMonth is 0-based, so add 1 because credit cards are 1-based
     let currentMonth = currentDate.getMonth() + 1;
-    return this._expirationYear == currentYear &&
-           this._expirationMonth >= currentMonth;
+    return (
+      this._expirationYear == currentYear &&
+      this._expirationMonth >= currentMonth
+    );
   }
 
   get maskedNumber() {
     return CreditCard.getMaskedNumber(this._number);
   }
 
   get longMaskedNumber() {
     return CreditCard.getLongMaskedNumber(this._number);
   }
 
   /**
    * Get credit card display label. It should display masked numbers and the
    * cardholder's name, separated by a comma.
    */
-  static getLabel({number, name}) {
+  static getLabel({ number, name }) {
     let parts = [];
 
     if (number) {
       parts.push(CreditCard.getMaskedNumber(number));
     }
     if (name) {
       parts.push(name);
     }
@@ -259,17 +262,19 @@ class CreditCard {
         regex: "(\\d{1,2})[-/](\\d{1,2})",
       },
       {
         regex: "(\\d{2})(\\d{2})",
       },
     ];
 
     for (let rule of rules) {
-      let result = new RegExp(`(?:^|\\D)${rule.regex}(?!\\d)`).exec(expirationString);
+      let result = new RegExp(`(?:^|\\D)${rule.regex}(?!\\d)`).exec(
+        expirationString
+      );
       if (!result) {
         continue;
       }
 
       let year, month;
 
       if (!rule.yearIndex || !rule.monthIndex) {
         month = parseInt(result[1], 10);
@@ -279,35 +284,42 @@ class CreditCard {
         } else {
           year = parseInt(result[2], 10);
         }
       } else {
         year = parseInt(result[rule.yearIndex], 10);
         month = parseInt(result[rule.monthIndex], 10);
       }
 
-      if ((month < 1 || month > 12) ||
-          (year >= 100 && year < 2000)) {
+      if (month < 1 || month > 12 || (year >= 100 && year < 2000)) {
         continue;
       }
 
-      return {month, year};
+      return { month, year };
     }
-    return {month: undefined, year: undefined};
+    return { month: undefined, year: undefined };
   }
 
-  static normalizeExpiration({expirationString, expirationMonth, expirationYear}) {
+  static normalizeExpiration({
+    expirationString,
+    expirationMonth,
+    expirationYear,
+  }) {
     // Only prefer the string version if missing one or both parsed formats.
     let parsedExpiration = {};
     if (expirationString && (!expirationMonth || !expirationYear)) {
       parsedExpiration = CreditCard.parseExpirationString(expirationString);
     }
     return {
-      month: CreditCard.normalizeExpirationMonth(parsedExpiration.month || expirationMonth),
-      year: CreditCard.normalizeExpirationYear(parsedExpiration.year || expirationYear),
+      month: CreditCard.normalizeExpirationMonth(
+        parsedExpiration.month || expirationMonth
+      ),
+      year: CreditCard.normalizeExpirationYear(
+        parsedExpiration.year || expirationYear
+      ),
     };
   }
 
   static formatMaskedNumber(maskedNumber) {
     return {
       affix: "****",
       label: maskedNumber.replace(/^\**/, ""),
     };
@@ -322,21 +334,20 @@ class CreditCard {
   }
 
   /*
    * Validates the number according to the Luhn algorithm. This
    * method does not throw an exception if the number is invalid.
    */
   static isValidNumber(number) {
     try {
-      new CreditCard({number});
+      new CreditCard({ number });
     } catch (ex) {
       return false;
     }
     return true;
   }
 
   static isValidNetwork(network) {
     return SUPPORTED_NETWORKS.includes(network);
   }
 }
 CreditCard.SUPPORTED_NETWORKS = SUPPORTED_NETWORKS;
-
--- a/toolkit/modules/DateTimePickerPanel.jsm
+++ b/toolkit/modules/DateTimePickerPanel.jsm
@@ -1,19 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-var EXPORTED_SYMBOLS = [
-  "DateTimePickerPanel",
-];
+var EXPORTED_SYMBOLS = ["DateTimePickerPanel"];
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var DateTimePickerPanel = class {
   constructor(element) {
     this.element = element;
 
     this.TIME_PICKER_WIDTH = "12em";
     this.TIME_PICKER_HEIGHT = "21em";
     this.DATE_PICKER_WIDTH = "23.1em";
@@ -31,207 +29,222 @@ var DateTimePickerPanel = class {
   }
 
   openPicker(type, anchor, detail) {
     this.type = type;
     this.pickerState = {};
     // TODO: Resize picker according to content zoom level
     this.element.style.fontSize = "10px";
     switch (type) {
-      case "time":
-        {
-          this.detail = detail;
-          this.dateTimePopupFrame.addEventListener("load", this, true);
-          this.dateTimePopupFrame.setAttribute("src", "chrome://global/content/timepicker.xhtml");
-          this.dateTimePopupFrame.style.width = this.TIME_PICKER_WIDTH;
-          this.dateTimePopupFrame.style.height = this.TIME_PICKER_HEIGHT;
-          break;
-        }
-      case "date":
-        {
-          this.detail = detail;
-          this.dateTimePopupFrame.addEventListener("load", this, true);
-          this.dateTimePopupFrame.setAttribute("src", "chrome://global/content/datepicker.xhtml");
-          this.dateTimePopupFrame.style.width = this.DATE_PICKER_WIDTH;
-          this.dateTimePopupFrame.style.height = this.DATE_PICKER_HEIGHT;
-          break;
-        }
+      case "time": {
+        this.detail = detail;
+        this.dateTimePopupFrame.addEventListener("load", this, true);
+        this.dateTimePopupFrame.setAttribute(
+          "src",
+          "chrome://global/content/timepicker.xhtml"
+        );
+        this.dateTimePopupFrame.style.width = this.TIME_PICKER_WIDTH;
+        this.dateTimePopupFrame.style.height = this.TIME_PICKER_HEIGHT;
+        break;
+      }
+      case "date": {
+        this.detail = detail;
+        this.dateTimePopupFrame.addEventListener("load", this, true);
+        this.dateTimePopupFrame.setAttribute(
+          "src",
+          "chrome://global/content/datepicker.xhtml"
+        );
+        this.dateTimePopupFrame.style.width = this.DATE_PICKER_WIDTH;
+        this.dateTimePopupFrame.style.height = this.DATE_PICKER_HEIGHT;
+        break;
+      }
     }
     this.element.hidden = false;
     this.element.openPopup(anchor, "after_start", 0, 0);
   }
 
   closePicker() {
     this.setInputBoxValue(true);
     this.pickerState = {};
     this.type = undefined;
     this.dateTimePopupFrame.removeEventListener("load", this, true);
-    this.dateTimePopupFrame.contentDocument.removeEventListener("message", this);
+    this.dateTimePopupFrame.contentDocument.removeEventListener(
+      "message",
+      this
+    );
     this.dateTimePopupFrame.setAttribute("src", "");
     this.element.hidden = true;
   }
 
   setPopupValue(data) {
     switch (this.type) {
-      case "time":
-        {
-          this.postMessageToPicker({
-            name: "PickerSetValue",
-            detail: data.value,
-          });
-          break;
-        }
-      case "date":
-        {
-          const { year, month, day } = data.value;
-          this.postMessageToPicker({
-            name: "PickerSetValue",
-            detail: {
-              year,
-              // Month value from input box starts from 1 instead of 0
-              month: month == undefined ? undefined : month - 1,
-              day,
-            },
-          });
-          break;
-        }
+      case "time": {
+        this.postMessageToPicker({
+          name: "PickerSetValue",
+          detail: data.value,
+        });
+        break;
+      }
+      case "date": {
+        const { year, month, day } = data.value;
+        this.postMessageToPicker({
+          name: "PickerSetValue",
+          detail: {
+            year,
+            // Month value from input box starts from 1 instead of 0
+            month: month == undefined ? undefined : month - 1,
+            day,
+          },
+        });
+        break;
+      }
     }
   }
 
   initPicker(detail) {
     // TODO: When bug 1376616 lands, replace this.setGregorian with
     //       mozIntl.Locale for setting calendar to Gregorian
     const locale = this.setGregorian(Services.locale.webExposedLocales[0]);
     const dir = Services.intl.getLocaleInfo(locale).direction;
 
     switch (this.type) {
-      case "time":
-        {
-          const { hour, minute } = detail.value;
-          const format = detail.format || "12";
+      case "time": {
+        const { hour, minute } = detail.value;
+        const format = detail.format || "12";
 
-          this.postMessageToPicker({
-            name: "PickerInit",
-            detail: {
-              hour,
-              minute,
-              format,
-              locale,
-              min: detail.min,
-              max: detail.max,
-              step: detail.step,
-            },
-          });
-          break;
-        }
-      case "date":
-        {
-          const { year, month, day } = detail.value;
-          const { firstDayOfWeek, weekends } = this.getCalendarInfo(locale);
-          const monthStrings = this.getDisplayNames(
-            locale, [
-              "dates/gregorian/months/january",
-              "dates/gregorian/months/february",
-              "dates/gregorian/months/march",
-              "dates/gregorian/months/april",
-              "dates/gregorian/months/may",
-              "dates/gregorian/months/june",
-              "dates/gregorian/months/july",
-              "dates/gregorian/months/august",
-              "dates/gregorian/months/september",
-              "dates/gregorian/months/october",
-              "dates/gregorian/months/november",
-              "dates/gregorian/months/december",
-            ], "short");
-          const weekdayStrings = this.getDisplayNames(
-            locale, [
-              "dates/gregorian/weekdays/sunday",
-              "dates/gregorian/weekdays/monday",
-              "dates/gregorian/weekdays/tuesday",
-              "dates/gregorian/weekdays/wednesday",
-              "dates/gregorian/weekdays/thursday",
-              "dates/gregorian/weekdays/friday",
-              "dates/gregorian/weekdays/saturday",
-            ], "short");
+        this.postMessageToPicker({
+          name: "PickerInit",
+          detail: {
+            hour,
+            minute,
+            format,
+            locale,
+            min: detail.min,
+            max: detail.max,
+            step: detail.step,
+          },
+        });
+        break;
+      }
+      case "date": {
+        const { year, month, day } = detail.value;
+        const { firstDayOfWeek, weekends } = this.getCalendarInfo(locale);
+        const monthStrings = this.getDisplayNames(
+          locale,
+          [
+            "dates/gregorian/months/january",
+            "dates/gregorian/months/february",
+            "dates/gregorian/months/march",
+            "dates/gregorian/months/april",
+            "dates/gregorian/months/may",
+            "dates/gregorian/months/june",
+            "dates/gregorian/months/july",
+            "dates/gregorian/months/august",
+            "dates/gregorian/months/september",
+            "dates/gregorian/months/october",
+            "dates/gregorian/months/november",
+            "dates/gregorian/months/december",
+          ],
+          "short"
+        );
+        const weekdayStrings = this.getDisplayNames(
+          locale,
+          [
+            "dates/gregorian/weekdays/sunday",
+            "dates/gregorian/weekdays/monday",
+            "dates/gregorian/weekdays/tuesday",
+            "dates/gregorian/weekdays/wednesday",
+            "dates/gregorian/weekdays/thursday",
+            "dates/gregorian/weekdays/friday",
+            "dates/gregorian/weekdays/saturday",
+          ],
+          "short"
+        );
 
-          this.postMessageToPicker({
-            name: "PickerInit",
-            detail: {
-              year,
-              // Month value from input box starts from 1 instead of 0
-              month: month == undefined ? undefined : month - 1,
-              day,
-              firstDayOfWeek,
-              weekends,
-              monthStrings,
-              weekdayStrings,
-              locale,
-              dir,
-              min: detail.min,
-              max: detail.max,
-              step: detail.step,
-              stepBase: detail.stepBase,
-            },
-          });
-          break;
-        }
+        this.postMessageToPicker({
+          name: "PickerInit",
+          detail: {
+            year,
+            // Month value from input box starts from 1 instead of 0
+            month: month == undefined ? undefined : month - 1,
+            day,
+            firstDayOfWeek,
+            weekends,
+            monthStrings,
+            weekdayStrings,
+            locale,
+            dir,
+            min: detail.min,
+            max: detail.max,
+            step: detail.step,
+            stepBase: detail.stepBase,
+          },
+        });
+        break;
+      }
     }
   }
 
   /**
    * @param {Boolean} passAllValues: Pass spinner values regardless if they've been set/changed or not
    */
   setInputBoxValue(passAllValues) {
     switch (this.type) {
-      case "time":
-        {
-          const { hour, minute, isHourSet, isMinuteSet, isDayPeriodSet } = this.pickerState;
-          const isAnyValueSet = isHourSet || isMinuteSet || isDayPeriodSet;
-          if (passAllValues && isAnyValueSet) {
-            this.sendPickerValueChanged({ hour, minute });
-          } else {
-            this.sendPickerValueChanged({
-              hour: isHourSet || isDayPeriodSet ? hour : undefined,
-              minute: isMinuteSet ? minute : undefined,
-            });
-          }
-          break;
+      case "time": {
+        const {
+          hour,
+          minute,
+          isHourSet,
+          isMinuteSet,
+          isDayPeriodSet,
+        } = this.pickerState;
+        const isAnyValueSet = isHourSet || isMinuteSet || isDayPeriodSet;
+        if (passAllValues && isAnyValueSet) {
+          this.sendPickerValueChanged({ hour, minute });
+        } else {
+          this.sendPickerValueChanged({
+            hour: isHourSet || isDayPeriodSet ? hour : undefined,
+            minute: isMinuteSet ? minute : undefined,
+          });
         }
-      case "date":
-        {
-          this.sendPickerValueChanged(this.pickerState);
-          break;
-        }
+        break;
+      }
+      case "date": {
+        this.sendPickerValueChanged(this.pickerState);
+        break;
+      }
     }
   }
 
   sendPickerValueChanged(value) {
     switch (this.type) {
-      case "time":
-        {
-          this.element.dispatchEvent(new CustomEvent("DateTimePickerValueChanged", {
+      case "time": {
+        this.element.dispatchEvent(
+          new CustomEvent("DateTimePickerValueChanged", {
             detail: {
               hour: value.hour,
               minute: value.minute,
             },
-          }));
-          break;
-        }
-      case "date":
-        {
-          this.element.dispatchEvent(new CustomEvent("DateTimePickerValueChanged", {
+          })
+        );
+        break;
+      }
+      case "date": {
+        this.element.dispatchEvent(
+          new CustomEvent("DateTimePickerValueChanged", {
             detail: {
               year: value.year,
               // Month value from input box starts from 1 instead of 0
               month: value.month == undefined ? undefined : value.month + 1,
               day: value.day,
             },
-          }));
-          break;
-        }
+          })
+        );
+        break;
+      }
     }
   }
 
   getCalendarInfo(locale) {
     const calendarInfo = Services.intl.getCalendarInfo(locale);
 
     // Day of week from calendarInfo starts from 1 as Sunday to 7 as Saturday,
     // so they need to be mapped to JavaScript convention with 0 as Sunday
@@ -268,49 +281,49 @@ var DateTimePickerPanel = class {
     if (locale.match(/u-ca-/)) {
       return locale.replace(/u-ca-[^-]+/, "u-ca-gregory");
     }
     return locale + "-u-ca-gregory";
   }
 
   handleEvent(aEvent) {
     switch (aEvent.type) {
-      case "load":
-        {
-          this.initPicker(this.detail);
-          this.dateTimePopupFrame.contentWindow.addEventListener("message", this);
-          break;
-        }
-      case "message":
-        {
-          this.handleMessage(aEvent);
-          break;
-        }
+      case "load": {
+        this.initPicker(this.detail);
+        this.dateTimePopupFrame.contentWindow.addEventListener("message", this);
+        break;
+      }
+      case "message": {
+        this.handleMessage(aEvent);
+        break;
+      }
     }
   }
 
   handleMessage(aEvent) {
-    if (!this.dateTimePopupFrame.contentDocument.nodePrincipal.isSystemPrincipal) {
+    if (
+      !this.dateTimePopupFrame.contentDocument.nodePrincipal.isSystemPrincipal
+    ) {
       return;
     }
 
     switch (aEvent.data.name) {
-      case "PickerPopupChanged":
-        {
-          this.pickerState = aEvent.data.detail;
-          this.setInputBoxValue();
-          break;
-        }
-      case "ClosePopup":
-        {
-          this.element.hidePopup();
-          this.closePicker();
-          break;
-        }
+      case "PickerPopupChanged": {
+        this.pickerState = aEvent.data.detail;
+        this.setInputBoxValue();
+        break;
+      }
+      case "ClosePopup": {
+        this.element.hidePopup();
+        this.closePicker();
+        break;
+      }
     }
   }
 
   postMessageToPicker(data) {
-    if (this.dateTimePopupFrame.contentDocument.nodePrincipal.isSystemPrincipal) {
+    if (
+      this.dateTimePopupFrame.contentDocument.nodePrincipal.isSystemPrincipal
+    ) {
       this.dateTimePopupFrame.contentWindow.postMessage(data, "*");
     }
   }
 };
--- a/toolkit/modules/DeferredTask.jsm
+++ b/toolkit/modules/DeferredTask.jsm
@@ -1,19 +1,17 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80 filetype=javascript: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-var EXPORTED_SYMBOLS = [
-  "DeferredTask",
-];
+var EXPORTED_SYMBOLS = ["DeferredTask"];
 
 /**
  * Sets up a function or an asynchronous task whose execution can be triggered
  * after a defined delay.  Multiple attempts to run the task before the delay
  * has passed are coalesced.  The task cannot be re-entered while running, but
  * can be executed again after a previous run finished.
  *
  * A common use case occurs when a data structure should be saved into a file
@@ -79,21 +77,27 @@ var EXPORTED_SYMBOLS = [
  *
  *   saveDeferredTask.disarm();
  *   saveDeferredTask.finalize().then(() => OS.File.remove(...))
  *                              .then(null, Components.utils.reportError);
  */
 
 // Globals
 
-ChromeUtils.defineModuleGetter(this, "PromiseUtils",
-                               "resource://gre/modules/PromiseUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "PromiseUtils",
+  "resource://gre/modules/PromiseUtils.jsm"
+);
 
-const Timer = Components.Constructor("@mozilla.org/timer;1", "nsITimer",
-                                     "initWithCallback");
+const Timer = Components.Constructor(
+  "@mozilla.org/timer;1",
+  "nsITimer",
+  "initWithCallback"
+);
 
 // DeferredTask
 
 /**
  * Sets up a task whose execution can be triggered after a delay.
  *
  * @param aTaskFn
  *        Function to execute.  If the function returns a promise, the task is
@@ -156,18 +160,21 @@ this.DeferredTask.prototype = {
    * task is running or there is no task scheduled for execution.
    */
   _timer: null,
 
   /**
    * Actually starts the timer with the delay specified on construction.
    */
   _startTimer() {
-    this._timer = new Timer(this._timerCallback.bind(this), this._delayMs,
-                            Ci.nsITimer.TYPE_ONE_SHOT);
+    this._timer = new Timer(
+      this._timerCallback.bind(this),
+      this._delayMs,
+      Ci.nsITimer.TYPE_ONE_SHOT
+    );
   },
 
   /**
    * Requests the execution of the task after the delay specified on
    * construction.  Multiple calls don't introduce further delays.  If the task
    * is running, the delay will start when the current execution finishes.
    *
    * The task will always be executed on a different tick of the event loop,
@@ -266,38 +273,40 @@ this.DeferredTask.prototype = {
     // timer callback, to prevent race conditions and to ensure that all the
     // methods behave consistently even if called from inside the task.  This
     // means that the assignment of "this._runningPromise" must complete before
     // the task gets a chance to start.
     this._timer = null;
     this._armed = false;
     this._runningPromise = runningDeferred.promise;
 
-    runningDeferred.resolve((async () => {
-      // Execute the provided function asynchronously.
-      await this._runTask();
+    runningDeferred.resolve(
+      (async () => {
+        // Execute the provided function asynchronously.
+        await this._runTask();
 
-      // Now that the task has finished, we check the state of the object to
-      // determine if we should restart the task again.
-      if (this._armed) {
-        if (!this._finalized) {
-          this._startTimer();
-        } else {
-          // Execute the task again immediately, for the last time.  The isArmed
-          // property should return false while the task is running, and should
-          // remain false after the last execution terminates.
-          this._armed = false;
-          await this._runTask();
+        // Now that the task has finished, we check the state of the object to
+        // determine if we should restart the task again.
+        if (this._armed) {
+          if (!this._finalized) {
+            this._startTimer();
+          } else {
+            // Execute the task again immediately, for the last time.  The isArmed
+            // property should return false while the task is running, and should
+            // remain false after the last execution terminates.
+            this._armed = false;
+            await this._runTask();
+          }
         }
-      }
 
-      // Indicate that the execution of the task has finished.  This happens
-      // synchronously with the previous state changes in the function.
-      this._runningPromise = null;
-    })().catch(Cu.reportError));
+        // Indicate that the execution of the task has finished.  This happens
+        // synchronously with the previous state changes in the function.
+        this._runningPromise = null;
+      })().catch(Cu.reportError)
+    );
   },
 
   /**
    * Executes the associated task in an idle callback and catches exceptions.
    */
   async _runTask() {
     try {
       // If we're being finalized, execute the task immediately, so we don't
--- a/toolkit/modules/Deprecated.jsm
+++ b/toolkit/modules/Deprecated.jsm
@@ -1,27 +1,30 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-var EXPORTED_SYMBOLS = [ "Deprecated" ];
+var EXPORTED_SYMBOLS = ["Deprecated"];
 
 const PREF_DEPRECATION_WARNINGS = "devtools.errorconsole.deprecation_warnings";
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // A flag that indicates whether deprecation warnings should be logged.
 var logWarnings = Services.prefs.getBoolPref(PREF_DEPRECATION_WARNINGS);
 
-Services.prefs.addObserver(PREF_DEPRECATION_WARNINGS,
-  function(aSubject, aTopic, aData) {
-    logWarnings = Services.prefs.getBoolPref(PREF_DEPRECATION_WARNINGS);
-  });
+Services.prefs.addObserver(PREF_DEPRECATION_WARNINGS, function(
+  aSubject,
+  aTopic,
+  aData
+) {
+  logWarnings = Services.prefs.getBoolPref(PREF_DEPRECATION_WARNINGS);
+});
 
 /**
  * Build a callstack log message.
  *
  * @param nsIStackFrame aStack
  *        A callstack to be converted into a string log message.
  */
 function stringifyCallstack(aStack) {
@@ -29,18 +32,17 @@ function stringifyCallstack(aStack) {
   if (!aStack || !(aStack instanceof Ci.nsIStackFrame)) {
     aStack = Components.stack.caller;
   }
 
   let frame = aStack.caller;
   let msg = "";
   // Get every frame in the callstack.
   while (frame) {
-    msg += frame.filename + " " + frame.lineNumber +
-      " " + frame.name + "\n";
+    msg += frame.filename + " " + frame.lineNumber + " " + frame.name + "\n";
     frame = frame.caller;
   }
   return msg;
 }
 
 var Deprecated = {
   /**
    * Log a deprecation warning.
@@ -57,23 +59,28 @@ var Deprecated = {
    */
   warning(aText, aUrl, aStack) {
     if (!logWarnings) {
       return;
     }
 
     // If URL is not provided, report an error.
     if (!aUrl) {
-      Cu.reportError("Error in Deprecated.warning: warnings must " +
-        "provide a URL documenting this deprecation.");
+      Cu.reportError(
+        "Error in Deprecated.warning: warnings must " +
+          "provide a URL documenting this deprecation."
+      );
       return;
     }
 
-    let textMessage = "DEPRECATION WARNING: " + aText +
+    let textMessage =
+      "DEPRECATION WARNING: " +
+      aText +
       "\nYou may find more details about this deprecation at: " +
-      aUrl + "\n" +
+      aUrl +
+      "\n" +
       // Append a callstack part to the deprecation message.
       stringifyCallstack(aStack);
 
     // Report deprecation warning.
     Cu.reportError(textMessage);
   },
 };
--- a/toolkit/modules/E10SUtils.jsm
+++ b/toolkit/modules/E10SUtils.jsm
@@ -1,37 +1,71 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var EXPORTED_SYMBOLS = ["E10SUtils"];
 
-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.defineLazyPreferenceGetter(this, "useSeparateFileUriProcess",
-                                      "browser.tabs.remote.separateFileUriProcess", false);
-XPCOMUtils.defineLazyPreferenceGetter(this, "allowLinkedWebInFileUriProcess",
-                                      "browser.tabs.remote.allowLinkedWebInFileUriProcess", false);
-XPCOMUtils.defineLazyPreferenceGetter(this, "useSeparatePrivilegedAboutContentProcess",
-                                      "browser.tabs.remote.separatePrivilegedContentProcess", false);
-XPCOMUtils.defineLazyPreferenceGetter(this, "separatePrivilegedMozillaWebContentProcess",
-                                      "browser.tabs.remote.separatePrivilegedMozillaWebContentProcess", false);
-XPCOMUtils.defineLazyPreferenceGetter(this, "separatedMozillaDomains",
-                                      "browser.tabs.remote.separatedMozillaDomains", false,
-                                      false, val => val.split(","));
-XPCOMUtils.defineLazyPreferenceGetter(this, "useHttpResponseProcessSelection",
-                                      "browser.tabs.remote.useHTTPResponseProcessSelection", false);
-XPCOMUtils.defineLazyPreferenceGetter(this, "useCrossOriginOpenerPolicy",
-                                      "browser.tabs.remote.useCrossOriginOpenerPolicy", false);
-XPCOMUtils.defineLazyServiceGetter(this, "serializationHelper",
-                                   "@mozilla.org/network/serialization-helper;1",
-                                   "nsISerializationHelper");
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "useSeparateFileUriProcess",
+  "browser.tabs.remote.separateFileUriProcess",
+  false
+);
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "allowLinkedWebInFileUriProcess",
+  "browser.tabs.remote.allowLinkedWebInFileUriProcess",
+  false
+);
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "useSeparatePrivilegedAboutContentProcess",
+  "browser.tabs.remote.separatePrivilegedContentProcess",
+  false
+);
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "separatePrivilegedMozillaWebContentProcess",
+  "browser.tabs.remote.separatePrivilegedMozillaWebContentProcess",
+  false
+);
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "separatedMozillaDomains",
+  "browser.tabs.remote.separatedMozillaDomains",
+  false,
+  false,
+  val => val.split(",")
+);
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "useHttpResponseProcessSelection",
+  "browser.tabs.remote.useHTTPResponseProcessSelection",
+  false
+);
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "useCrossOriginOpenerPolicy",
+  "browser.tabs.remote.useCrossOriginOpenerPolicy",
+  false
+);
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "serializationHelper",
+  "@mozilla.org/network/serialization-helper;1",
+  "nsISerializationHelper"
+);
 
 function debug(msg) {
   Cu.reportError(new Error("E10SUtils: " + msg));
 }
 
 function getAboutModule(aURL) {
   // Needs to match NS_GetAboutModuleName
   let moduleName = aURL.pathQueryRef.replace(/[#?].*/, "").toLowerCase();
@@ -53,24 +87,34 @@ const FILE_REMOTE_TYPE = "file";
 const EXTENSION_REMOTE_TYPE = "extension";
 const PRIVILEGEDABOUT_REMOTE_TYPE = "privilegedabout";
 const PRIVILEGEDMOZILLA_REMOTE_TYPE = "privilegedmozilla";
 
 // This must start with the WEB_REMOTE_TYPE above.
 const LARGE_ALLOCATION_REMOTE_TYPE = "webLargeAllocation";
 const DEFAULT_REMOTE_TYPE = WEB_REMOTE_TYPE;
 
-function validatedWebRemoteType(aPreferredRemoteType, aTargetUri, aCurrentUri, aRemoteSubframes) {
+function validatedWebRemoteType(
+  aPreferredRemoteType,
+  aTargetUri,
+  aCurrentUri,
+  aRemoteSubframes
+) {
   // To load into the Privileged Mozilla Content Process you must be https,
   // and be an exact match or a subdomain of an allowlisted domain.
-  if (separatePrivilegedMozillaWebContentProcess &&
-      aTargetUri.asciiHost && aTargetUri.scheme == "https" &&
-      separatedMozillaDomains.some(function(val) {
-        return aTargetUri.asciiHost == val || aTargetUri.asciiHost.endsWith("." + val);
-      })) {
+  if (
+    separatePrivilegedMozillaWebContentProcess &&
+    aTargetUri.asciiHost &&
+    aTargetUri.scheme == "https" &&
+    separatedMozillaDomains.some(function(val) {
+      return (
+        aTargetUri.asciiHost == val || aTargetUri.asciiHost.endsWith("." + val)
+      );
+    })
+  ) {
     return PRIVILEGEDMOZILLA_REMOTE_TYPE;
   }
 
   // If the domain is whitelisted to allow it to use file:// URIs, then we have
   // to run it in a file content process, in case it uses file:// sub-resources.
   const sm = Services.scriptSecurityManager;
   if (sm.inFileURIAllowlist(aTargetUri)) {
     return FILE_REMOTE_TYPE;
@@ -86,18 +130,20 @@ function validatedWebRemoteType(aPreferr
   if (!aPreferredRemoteType) {
     return WEB_REMOTE_TYPE;
   }
 
   if (aPreferredRemoteType.startsWith(WEB_REMOTE_TYPE)) {
     return aPreferredRemoteType;
   }
 
-  if (allowLinkedWebInFileUriProcess &&
-      aPreferredRemoteType == FILE_REMOTE_TYPE) {
+  if (
+    allowLinkedWebInFileUriProcess &&
+    aPreferredRemoteType == FILE_REMOTE_TYPE
+  ) {
     // If aCurrentUri is passed then we should only allow FILE_REMOTE_TYPE
     // when it is same origin as target.
     if (aCurrentUri) {
       try {
         // checkSameOriginURI throws when not same origin.
         // todo: if you intend to update CheckSameOriginURI to log the error to the
         // console you also need to update the 'aFromPrivateWindow' argument.
         sm.checkSameOriginURI(aCurrentUri, aTargetUri, false, false);
@@ -152,221 +198,281 @@ var E10SUtils = {
   /**
    * Deserialize a base64 encoded csp (serialized with
    * Utils::serializeCSP).
    *
    * @param {String} csp_b64 A base64 encoded serialized csp.
    * @return {nsIContentSecurityPolicy} A deserialized csp.
    */
   deserializeCSP(csp_b64) {
-    if (!csp_b64)
+    if (!csp_b64) {
       return null;
+    }
 
     try {
       let csp = serializationHelper.deserializeObject(csp_b64);
       csp.QueryInterface(Ci.nsIContentSecurityPolicy);
       return csp;
     } catch (e) {
       debug(`Failed to deserialize csp_b64 '${csp_b64}' ${e}`);
     }
     return null;
   },
 
-  canLoadURIInRemoteType(aURL, aRemoteSubframes,
-                         aRemoteType = DEFAULT_REMOTE_TYPE,
-                         aPreferredRemoteType = undefined) {
+  canLoadURIInRemoteType(
+    aURL,
+    aRemoteSubframes,
+    aRemoteType = DEFAULT_REMOTE_TYPE,
+    aPreferredRemoteType = undefined
+  ) {
     // We need a strict equality here because the value of `NOT_REMOTE` is
     // `null`, and there is a possibility that `undefined` is passed as an
     // argument, which might result a load in the parent process.
     if (aPreferredRemoteType === undefined) {
-      aPreferredRemoteType = aRemoteType === NOT_REMOTE
-        ? NOT_REMOTE
-        : DEFAULT_REMOTE_TYPE;
+      aPreferredRemoteType =
+        aRemoteType === NOT_REMOTE ? NOT_REMOTE : DEFAULT_REMOTE_TYPE;
     }
 
-    return aRemoteType == this.getRemoteTypeForURI(aURL, true, aRemoteSubframes, aPreferredRemoteType);
+    return (
+      aRemoteType ==
+      this.getRemoteTypeForURI(
+        aURL,
+        true,
+        aRemoteSubframes,
+        aPreferredRemoteType
+      )
+    );
   },
 
-  getRemoteTypeForURI(aURL, aMultiProcess, aRemoteSubframes,
-                      aPreferredRemoteType = DEFAULT_REMOTE_TYPE,
-                      aCurrentUri) {
+  getRemoteTypeForURI(
+    aURL,
+    aMultiProcess,
+    aRemoteSubframes,
+    aPreferredRemoteType = DEFAULT_REMOTE_TYPE,
+    aCurrentUri
+  ) {
     if (!aMultiProcess) {
       return NOT_REMOTE;
     }
 
     // loadURI in browser.js treats null as about:blank
     if (!aURL) {
       aURL = "about:blank";
     }
 
     let uri;
     try {
-      uri = Services.uriFixup.createFixupURI(aURL, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
+      uri = Services.uriFixup.createFixupURI(
+        aURL,
+        Ci.nsIURIFixup.FIXUP_FLAG_NONE
+      );
     } catch (e) {
       // If we have an invalid URI, it's still possible that it might get
       // fixed-up into a valid URI later on. However, we don't want to return
       // aPreferredRemoteType here, in case the URI gets fixed-up into
       // something that wouldn't normally run in that process.
       return DEFAULT_REMOTE_TYPE;
     }
 
-    return this.getRemoteTypeForURIObject(uri, aMultiProcess, aRemoteSubframes,
-                                          aPreferredRemoteType, aCurrentUri);
+    return this.getRemoteTypeForURIObject(
+      uri,
+      aMultiProcess,
+      aRemoteSubframes,
+      aPreferredRemoteType,
+      aCurrentUri
+    );
   },
 
-  getRemoteTypeForURIObject(aURI, aMultiProcess, aRemoteSubframes,
-                            aPreferredRemoteType = DEFAULT_REMOTE_TYPE,
-                            aCurrentUri) {
+  getRemoteTypeForURIObject(
+    aURI,
+    aMultiProcess,
+    aRemoteSubframes,
+    aPreferredRemoteType = DEFAULT_REMOTE_TYPE,
+    aCurrentUri
+  ) {
     if (!aMultiProcess) {
       return NOT_REMOTE;
     }
 
     switch (aURI.scheme) {
       case "javascript":
         // javascript URIs can load in any, they apply to the current document.
         return aPreferredRemoteType;
 
       case "data":
       case "blob":
         // We need data: and blob: URIs to load in any remote process, because
         // they need to be able to load in whatever is the current process
         // unless it is non-remote. In that case we don't want to load them in
         // the parent process, so we load them in the default remote process,
         // which is sandboxed and limits any risk.
-        return aPreferredRemoteType == NOT_REMOTE ? DEFAULT_REMOTE_TYPE
-                                                  : aPreferredRemoteType;
+        return aPreferredRemoteType == NOT_REMOTE
+          ? DEFAULT_REMOTE_TYPE
+          : aPreferredRemoteType;
 
       case "file":
-        return useSeparateFileUriProcess ? FILE_REMOTE_TYPE
-                                         : DEFAULT_REMOTE_TYPE;
+        return useSeparateFileUriProcess
+          ? FILE_REMOTE_TYPE
+          : DEFAULT_REMOTE_TYPE;
 
       case "about":
         let module = getAboutModule(aURI);
         // If the module doesn't exist then an error page will be loading, that
         // should be ok to load in any process
         if (!module) {
           return aPreferredRemoteType;
         }
 
         let flags = module.getURIFlags(aURI);
         if (flags & Ci.nsIAboutModule.URI_MUST_LOAD_IN_EXTENSION_PROCESS) {
-          return WebExtensionPolicy.useRemoteWebExtensions ? EXTENSION_REMOTE_TYPE : NOT_REMOTE;
+          return WebExtensionPolicy.useRemoteWebExtensions
+            ? EXTENSION_REMOTE_TYPE
+            : NOT_REMOTE;
         }
 
         if (flags & Ci.nsIAboutModule.URI_MUST_LOAD_IN_CHILD) {
-          if ((flags & Ci.nsIAboutModule.URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS) &&
-              useSeparatePrivilegedAboutContentProcess) {
+          if (
+            flags & Ci.nsIAboutModule.URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS &&
+            useSeparatePrivilegedAboutContentProcess
+          ) {
             return PRIVILEGEDABOUT_REMOTE_TYPE;
           }
           return DEFAULT_REMOTE_TYPE;
         }
 
         // If the about page can load in parent or child, it should be safe to
         // load in any remote type.
         if (flags & Ci.nsIAboutModule.URI_CAN_LOAD_IN_CHILD) {
           return aPreferredRemoteType;
         }
 
         return NOT_REMOTE;
 
       case "chrome":
-        let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].
-                        getService(Ci.nsIXULChromeRegistry);
+        let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(
+          Ci.nsIXULChromeRegistry
+        );
         if (chromeReg.mustLoadURLRemotely(aURI)) {
           return DEFAULT_REMOTE_TYPE;
         }
 
-        if (chromeReg.canLoadURLRemotely(aURI) &&
-            aPreferredRemoteType != NOT_REMOTE) {
+        if (
+          chromeReg.canLoadURLRemotely(aURI) &&
+          aPreferredRemoteType != NOT_REMOTE
+        ) {
           return DEFAULT_REMOTE_TYPE;
         }
 
         return NOT_REMOTE;
 
       case "moz-extension":
-        return WebExtensionPolicy.useRemoteWebExtensions ? EXTENSION_REMOTE_TYPE : NOT_REMOTE;
+        return WebExtensionPolicy.useRemoteWebExtensions
+          ? EXTENSION_REMOTE_TYPE
+          : NOT_REMOTE;
 
       default:
         // WebExtensions may set up protocol handlers for protocol names
         // beginning with ext+.  These may redirect to http(s) pages or to
         // moz-extension pages.  We can't actually tell here where one of
         // these pages will end up loading but Talos tests use protocol
         // handlers that redirect to extension pages that rely on this
         // behavior so a pageloader frame script is injected correctly.
         // Protocols that redirect to http(s) will just flip back to a
         // regular content process after the redirect.
         if (aURI.scheme.startsWith("ext+")) {
-          return WebExtensionPolicy.useRemoteWebExtensions ? EXTENSION_REMOTE_TYPE : NOT_REMOTE;
+          return WebExtensionPolicy.useRemoteWebExtensions
+            ? EXTENSION_REMOTE_TYPE
+            : NOT_REMOTE;
         }
 
         // For any other nested URIs, we use the innerURI to determine the
         // remote type. In theory we should use the innermost URI, but some URIs
         // have fake inner URIs (e.g. about URIs with inner moz-safe-about) and
         // if such URIs are wrapped in other nested schemes like view-source:,
         // we don't want to "skip" past "about:" by going straight to the
         // innermost URI. Any URIs like this will need to be handled in the
         // cases above, so we don't still end up using the fake inner URI here.
         if (aURI instanceof Ci.nsINestedURI) {
           let innerURI = aURI.QueryInterface(Ci.nsINestedURI).innerURI;
-          return this.getRemoteTypeForURIObject(innerURI, aMultiProcess,
-                                                aRemoteSubframes,
-                                                aPreferredRemoteType,
-                                                aCurrentUri);
+          return this.getRemoteTypeForURIObject(
+            innerURI,
+            aMultiProcess,
+            aRemoteSubframes,
+            aPreferredRemoteType,
+            aCurrentUri
+          );
         }
 
-        return validatedWebRemoteType(aPreferredRemoteType, aURI, aCurrentUri, aRemoteSubframes);
+        return validatedWebRemoteType(
+          aPreferredRemoteType,
+          aURI,
+          aCurrentUri,
+          aRemoteSubframes
+        );
     }
   },
 
-  getRemoteTypeForPrincipal(aPrincipal, aMultiProcess, aRemoteSubframes,
-                            aPreferredRemoteType = DEFAULT_REMOTE_TYPE,
-                            aCurrentPrincipal) {
+  getRemoteTypeForPrincipal(
+    aPrincipal,
+    aMultiProcess,
+    aRemoteSubframes,
+    aPreferredRemoteType = DEFAULT_REMOTE_TYPE,
+    aCurrentPrincipal
+  ) {
     if (!aMultiProcess) {
       return NOT_REMOTE;
     }
 
     // We can't pick a process based on a system principal or expanded
     // principal. In fact, we should never end up with one here!
     if (aPrincipal.isSystemPrincipal || aPrincipal.isExpandedPrincipal) {
       throw Cr.NS_ERROR_UNEXPECTED;
     }
 
     // Null principals can be loaded in any remote process.
     if (aPrincipal.isNullPrincipal) {
-      return aPreferredRemoteType == NOT_REMOTE ? DEFAULT_REMOTE_TYPE
-                                                : aPreferredRemoteType;
+      return aPreferredRemoteType == NOT_REMOTE
+        ? DEFAULT_REMOTE_TYPE
+        : aPreferredRemoteType;
     }
 
     // We might care about the currently loaded URI. Pull it out of our current
     // principal. We never care about the current URI when working with a
     // non-codebase principal.
-    let currentURI = (aCurrentPrincipal && aCurrentPrincipal.isCodebasePrincipal)
-                     ? aCurrentPrincipal.URI : null;
-    return E10SUtils.getRemoteTypeForURIObject(aPrincipal.URI,
-                                               aMultiProcess,
-                                               aRemoteSubframes,
-                                               aPreferredRemoteType,
-                                               currentURI);
+    let currentURI =
+      aCurrentPrincipal && aCurrentPrincipal.isCodebasePrincipal
+        ? aCurrentPrincipal.URI
+        : null;
+    return E10SUtils.getRemoteTypeForURIObject(
+      aPrincipal.URI,
+      aMultiProcess,
+      aRemoteSubframes,
+      aPreferredRemoteType,
+      currentURI
+    );
   },
 
   makeInputStream(data) {
     if (typeof data == "string") {
-      let stream = Cc["@mozilla.org/io/string-input-stream;1"].
-                   createInstance(Ci.nsISupportsCString);
+      let stream = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(
+        Ci.nsISupportsCString
+      );
       stream.data = data;
       return stream; // XPConnect will QI this to nsIInputStream for us.
     }
 
-    let stream = Cc["@mozilla.org/io/string-input-stream;1"].
-                 createInstance(Ci.nsISupportsCString);
+    let stream = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(
+      Ci.nsISupportsCString
+    );
     stream.data = data.content;
 
     if (data.headers) {
-      let mimeStream = Cc["@mozilla.org/network/mime-input-stream;1"]
-          .createInstance(Ci.nsIMIMEInputStream);
+      let mimeStream = Cc[
+        "@mozilla.org/network/mime-input-stream;1"
+      ].createInstance(Ci.nsIMIMEInputStream);
 
       mimeStream.setData(stream);
       for (let [name, value] of data.headers) {
         mimeStream.addHeader(name, value);
       }
       return mimeStream;
     }
 
@@ -379,17 +485,19 @@ var E10SUtils = {
    * @param {nsIPrincipal} principal The principal to serialize.
    * @return {String} The base64 encoded principal data.
    */
   serializePrincipal(principal) {
     let serializedPrincipal = null;
 
     try {
       if (principal) {
-        serializedPrincipal = btoa(Services.scriptSecurityManager.principalToJSON(principal));
+        serializedPrincipal = btoa(
+          Services.scriptSecurityManager.principalToJSON(principal)
+        );
       }
     } catch (e) {
       debug(`Failed to serialize principal '${principal}' ${e}`);
     }
 
     return serializedPrincipal;
   },
 
@@ -398,17 +506,19 @@ var E10SUtils = {
    * serializePrincipal).
    *
    * @param {String} principal_b64 A base64 encoded serialized principal.
    * @return {nsIPrincipal} A deserialized principal.
    */
   deserializePrincipal(principal_b64, fallbackPrincipalCallback = null) {
     if (!principal_b64) {
       if (!fallbackPrincipalCallback) {
-        debug("No principal passed to deserializePrincipal and no fallbackPrincipalCallback");
+        debug(
+          "No principal passed to deserializePrincipal and no fallbackPrincipalCallback"
+        );
         return null;
       }
 
       return fallbackPrincipalCallback();
     }
 
     try {
       let principal;
@@ -423,163 +533,208 @@ var E10SUtils = {
         principal = serializationHelper.deserializeObject(principal_b64);
       }
       principal.QueryInterface(Ci.nsIPrincipal);
       return principal;
     } catch (e) {
       debug(`Failed to deserialize principal_b64 '${principal_b64}' ${e}`);
     }
     if (!fallbackPrincipalCallback) {
-      debug("No principal passed to deserializePrincipal and no fallbackPrincipalCallback");
+      debug(
+        "No principal passed to deserializePrincipal and no fallbackPrincipalCallback"
+      );
       return null;
     }
     return fallbackPrincipalCallback();
   },
 
-  shouldLoadURIInBrowser(browser, uri, multiProcess = true, remoteSubframes = false,
-                         flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE) {
+  shouldLoadURIInBrowser(
+    browser,
+    uri,
+    multiProcess = true,
+    remoteSubframes = false,
+    flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE
+  ) {
     let currentRemoteType = browser.remoteType;
     let requiredRemoteType;
     let uriObject;
     try {
       let fixupFlags = Ci.nsIURIFixup.FIXUP_FLAG_NONE;
       if (flags & Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP) {
         fixupFlags |= Ci.nsIURIFixup.FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP;
       }
       if (flags & Ci.nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS) {
         fixupFlags |= Ci.nsIURIFixup.FIXUP_FLAG_FIX_SCHEME_TYPOS;
       }
       uriObject = Services.uriFixup.createFixupURI(uri, fixupFlags);
       // Note that I had thought that we could set uri = uriObject.spec here, to
       // save on fixup later on, but that changes behavior and breaks tests.
-      requiredRemoteType =
-        this.getRemoteTypeForURIObject(uriObject, multiProcess, remoteSubframes,
-                                       currentRemoteType, browser.currentURI);
+      requiredRemoteType = this.getRemoteTypeForURIObject(
+        uriObject,
+        multiProcess,
+        remoteSubframes,
+        currentRemoteType,
+        browser.currentURI
+      );
     } catch (e) {
       // createFixupURI throws if it can't create a URI. If that's the case then
       // we still need to pass down the uri because docshell handles this case.
       requiredRemoteType = multiProcess ? DEFAULT_REMOTE_TYPE : NOT_REMOTE;
     }
 
     let mustChangeProcess = requiredRemoteType != currentRemoteType;
     let newFrameloader = false;
-    if (browser.getAttribute("preloadedState") === "consumed" &&
-        uri != "about:newtab") {
+    if (
+      browser.getAttribute("preloadedState") === "consumed" &&
+      uri != "about:newtab"
+    ) {
       // Leaving about:newtab from a used to be preloaded browser should run the process
       // selecting algorithm again.
       mustChangeProcess = true;
       newFrameloader = true;
     }
 
     return {
       uriObject,
       requiredRemoteType,
       mustChangeProcess,
       newFrameloader,
     };
   },
 
   shouldLoadURIInThisProcess(aURI, aRemoteSubframes) {
     let remoteType = Services.appinfo.remoteType;
-    return remoteType == this.getRemoteTypeForURIObject(aURI,
-                                                        /* remote */ true,
-                                                        aRemoteSubframes,
-                                                        remoteType);
+    return (
+      remoteType ==
+      this.getRemoteTypeForURIObject(
+        aURI,
+        /* remote */ true,
+        aRemoteSubframes,
+        remoteType
+      )
+    );
   },
 
   shouldLoadURI(aDocShell, aURI, aReferrer, aHasPostData) {
     let remoteSubframes = aDocShell.useRemoteSubframes;
 
     // Inner frames should always load in the current process
     // XXX(nika): Handle shouldLoadURI-triggered process switches for remote
     // subframes! (bug 1548942)
     if (aDocShell.sameTypeParent) {
       return true;
     }
 
     let webNav = aDocShell.QueryInterface(Ci.nsIWebNavigation);
     let sessionHistory = webNav.sessionHistory;
-    if (!aHasPostData &&
-        Services.appinfo.remoteType == WEB_REMOTE_TYPE &&
-        sessionHistory.count == 1 &&
-        webNav.currentURI.spec == "about:newtab") {
+    if (
+      !aHasPostData &&
+      Services.appinfo.remoteType == WEB_REMOTE_TYPE &&
+      sessionHistory.count == 1 &&
+      webNav.currentURI.spec == "about:newtab"
+    ) {
       // This is possibly a preloaded browser and we're about to navigate away for
       // the first time. On the child side there is no way to tell for sure if that
       // is the case, so let's redirect this request to the parent to decide if a new
       // process is needed. But we don't currently properly handle POST data in
       // redirects (bug 1457520), so if there is POST data, don't return false here.
       return false;
     }
 
     // If we are performing HTTP response process selection, and are loading an
     // HTTP URI, we can start the load in the current process, and then perform
     // the switch later-on using the RedirectProcessChooser mechanism.
     //
     // We should never be sending a POST request from the parent process to a
     // http(s) uri, so make sure we switch if we're currently in that process.
-    if (useHttpResponseProcessSelection &&
-        (aURI.scheme == "http" || aURI.scheme == "https") &&
-        Services.appinfo.remoteType != NOT_REMOTE) {
+    if (
+      useHttpResponseProcessSelection &&
+      (aURI.scheme == "http" || aURI.scheme == "https") &&
+      Services.appinfo.remoteType != NOT_REMOTE
+    ) {
       return true;
     }
 
     // If we are in a Large-Allocation process, and it wouldn't be content visible
     // to change processes, we want to load into a new process so that we can throw
     // this one out. We don't want to move into a new process if we have post data,
     // because we would accidentally throw out that data.
-    if (!aHasPostData &&
-        Services.appinfo.remoteType == LARGE_ALLOCATION_REMOTE_TYPE &&
-        !aDocShell.awaitingLargeAlloc &&
-        aDocShell.isOnlyToplevelInTabGroup) {
+    if (
+      !aHasPostData &&
+      Services.appinfo.remoteType == LARGE_ALLOCATION_REMOTE_TYPE &&
+      !aDocShell.awaitingLargeAlloc &&
+      aDocShell.isOnlyToplevelInTabGroup
+    ) {
       return false;
     }
 
     // Allow history load if loaded in this process before.
     let requestedIndex = sessionHistory.legacySHistory.requestedIndex;
     if (requestedIndex >= 0) {
-      if (sessionHistory.legacySHistory.getEntryAtIndex(requestedIndex).loadedInThisProcess) {
+      if (
+        sessionHistory.legacySHistory.getEntryAtIndex(requestedIndex)
+          .loadedInThisProcess
+      ) {
         return true;
       }
 
       // If not originally loaded in this process allow it if the URI would
       // normally be allowed to load in this process by default.
       let remoteType = Services.appinfo.remoteType;
-      return remoteType ==
-        this.getRemoteTypeForURIObject(aURI, true, remoteSubframes,
-                                       remoteType, webNav.currentURI);
+      return (
+        remoteType ==
+        this.getRemoteTypeForURIObject(
+          aURI,
+          true,
+          remoteSubframes,
+          remoteType,
+          webNav.currentURI
+        )
+      );
     }
 
     // If the URI can be loaded in the current process then continue
     return this.shouldLoadURIInThisProcess(aURI, remoteSubframes);
   },
 
-  redirectLoad(aDocShell, aURI, aReferrer, aTriggeringPrincipal, aFreshProcess, aFlags, aCsp) {
+  redirectLoad(
+    aDocShell,
+    aURI,
+    aReferrer,
+    aTriggeringPrincipal,
+    aFreshProcess,
+    aFlags,
+    aCsp
+  ) {
     // Retarget the load to the correct process
     let messageManager = aDocShell.messageManager;
-    let sessionHistory = aDocShell.QueryInterface(Ci.nsIWebNavigation).sessionHistory;
+    let sessionHistory = aDocShell.QueryInterface(Ci.nsIWebNavigation)
+      .sessionHistory;
 
     messageManager.sendAsyncMessage("Browser:LoadURI", {
       loadOptions: {
         uri: aURI.spec,
         flags: aFlags || Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
         referrer: aReferrer ? aReferrer.spec : null,
-        triggeringPrincipal: this.serializePrincipal(aTriggeringPrincipal || Services.scriptSecurityManager.createNullPrincipal({})),
+        triggeringPrincipal: this.serializePrincipal(
+          aTriggeringPrincipal ||
+            Services.scriptSecurityManager.createNullPrincipal({})
+        ),
         csp: aCsp ? this.serializeCSP(aCsp) : null,
         reloadInFreshProcess: !!aFreshProcess,
       },
       historyIndex: sessionHistory.legacySHistory.requestedIndex,
     });
     return false;
   },
 
   wrapHandlingUserInput(aWindow, aIsHandling, aCallback) {
     var handlingUserInput;
     try {
-      handlingUserInput = aWindow.windowUtils
-                                 .setHandlingUserInput(aIsHandling);
+      handlingUserInput = aWindow.windowUtils.setHandlingUserInput(aIsHandling);
       aCallback();
     } finally {
       handlingUserInput.destruct();
     }
   },
 
   /**
    * Serialize referrerInfo.
@@ -606,18 +761,26 @@ var E10SUtils = {
    */
   deserializeReferrerInfo(referrerInfo_b64) {
     let deserialized = null;
     if (referrerInfo_b64) {
       try {
         deserialized = serializationHelper.deserializeObject(referrerInfo_b64);
         deserialized.QueryInterface(Ci.nsIReferrerInfo);
       } catch (e) {
-        debug(`Failed to deserialize referrerInfo_b64 '${referrerInfo_b64}' ${e}`);
+        debug(
+          `Failed to deserialize referrerInfo_b64 '${referrerInfo_b64}' ${e}`
+        );
       }
     }
     return deserialized;
   },
 };
 
-XPCOMUtils.defineLazyGetter(E10SUtils, "SERIALIZED_SYSTEMPRINCIPAL", function() {
-  return E10SUtils.serializePrincipal(Services.scriptSecurityManager.getSystemPrincipal());
-});
+XPCOMUtils.defineLazyGetter(
+  E10SUtils,
+  "SERIALIZED_SYSTEMPRINCIPAL",
+  function() {
+    return E10SUtils.serializePrincipal(
+      Services.scriptSecurityManager.getSystemPrincipal()
+    );
+  }
+);
--- a/toolkit/modules/EventEmitter.jsm
+++ b/toolkit/modules/EventEmitter.jsm
@@ -1,22 +1,25 @@
 /* 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 { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-ChromeUtils.defineModuleGetter(this, "console",
-                               "resource://gre/modules/Console.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "console",
+  "resource://gre/modules/Console.jsm"
+);
 
 var EXPORTED_SYMBOLS = ["EventEmitter"];
 
-let EventEmitter = this.EventEmitter = function() {};
+let EventEmitter = (this.EventEmitter = function() {});
 
 let loggingEnabled = Services.prefs.getBoolPref("toolkit.dump.emit");
 Services.prefs.addObserver("toolkit.dump.emit", {
   observe: () => {
     loggingEnabled = Services.prefs.getBoolPref("toolkit.dump.emit");
   },
 });
 
@@ -111,45 +114,53 @@ EventEmitter.prototype = {
    *        The listener to remove.
    */
   off(event, listener) {
     if (!this._eventEmitterListeners) {
       return;
     }
     let listeners = this._eventEmitterListeners.get(event);
     if (listeners) {
-      this._eventEmitterListeners.set(event, listeners.filter(l => {
-        return l !== listener && l._originalListener !== listener;
-      }));
+      this._eventEmitterListeners.set(
+        event,
+        listeners.filter(l => {
+          return l !== listener && l._originalListener !== listener;
+        })
+      );
     }
   },
 
   /**
    * Emit an event.  All arguments to this method will
    * be sent to listener functions.
    */
   emit(event) {
     this.logEvent(event, arguments);
 
-    if (!this._eventEmitterListeners || !this._eventEmitterListeners.has(event)) {
+    if (
+      !this._eventEmitterListeners ||
+      !this._eventEmitterListeners.has(event)
+    ) {
       return;
     }
 
     let originalListeners = this._eventEmitterListeners.get(event);
     for (let listener of this._eventEmitterListeners.get(event)) {
       // If the object was destroyed during event emission, stop
       // emitting.
       if (!this._eventEmitterListeners) {
         break;
       }
 
       // If listeners were removed during emission, make sure the
       // event handler we're going to fire wasn't removed.
-      if (originalListeners === this._eventEmitterListeners.get(event) ||
-        this._eventEmitterListeners.get(event).some(l => l === listener)) {
+      if (
+        originalListeners === this._eventEmitterListeners.get(event) ||
+        this._eventEmitterListeners.get(event).some(l => l === listener)
+      ) {
         try {
           listener.apply(null, arguments);
         } catch (ex) {
           // Prevent a bad listener from interfering with the others.
           let msg = ex + ": " + ex.stack;
           console.error(msg);
           if (loggingEnabled) {
             dump(msg + "\n");
--- a/toolkit/modules/FileUtils.jsm
+++ b/toolkit/modules/FileUtils.jsm
@@ -1,20 +1,25 @@
 /* -*- 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/. */
 
-var EXPORTED_SYMBOLS = [ "FileUtils" ];
+var EXPORTED_SYMBOLS = ["FileUtils"];
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 
-XPCOMUtils.defineLazyServiceGetter(this, "gDirService",
-                                   "@mozilla.org/file/directory_service;1",
-                                   "nsIProperties");
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "gDirService",
+  "@mozilla.org/file/directory_service;1",
+  "nsIProperties"
+);
 
 var FileUtils = {
   MODE_RDONLY: 0x01,
   MODE_WRONLY: 0x02,
   MODE_RDWR: 0x04,
   MODE_CREATE: 0x08,
   MODE_APPEND: 0x10,
   MODE_TRUNCATE: 0x20,
@@ -30,18 +35,22 @@ var FileUtils = {
    *          An array of path components to locate beneath the directory
    *          specified by |key|. The last item in this array must be the
    *          leaf name of a file.
    * @return  nsIFile object for the file specified. The file is NOT created
    *          if it does not exist, however all required directories along
    *          the way are if pathArray has more than one item.
    */
   getFile: function FileUtils_getFile(key, pathArray, followLinks) {
-    var file = this.getDir(key, pathArray.slice(0, -1), pathArray.length > 1,
-                           followLinks);
+    var file = this.getDir(
+      key,
+      pathArray.slice(0, -1),
+      pathArray.length > 1,
+      followLinks
+    );
     file.append(pathArray[pathArray.length - 1]);
     return file;
   },
 
   /**
    * Gets a directory at the specified hierarchy under a nsIDirectoryService
    * key.
    * @param   key
@@ -68,104 +77,128 @@ var FileUtils = {
       } catch (ex) {
         if (ex.result != Cr.NS_ERROR_FILE_ALREADY_EXISTS) {
           throw ex;
         }
         // Ignore the exception due to a directory that already exists.
       }
     }
 
-    if (!followLinks)
+    if (!followLinks) {
       dir.followLinks = false;
+    }
     return dir;
   },
 
   /**
    * Opens a file output stream for writing.
    * @param   file
    *          The file to write to.
    * @param   modeFlags
    *          (optional) File open flags. Can be undefined.
    * @returns nsIFileOutputStream to write to.
    * @note The stream is initialized with the DEFER_OPEN behavior flag.
    *       See nsIFileOutputStream.
    */
-  openFileOutputStream: function FileUtils_openFileOutputStream(file, modeFlags) {
-    var fos = Cc["@mozilla.org/network/file-output-stream;1"].
-              createInstance(Ci.nsIFileOutputStream);
+  openFileOutputStream: function FileUtils_openFileOutputStream(
+    file,
+    modeFlags
+  ) {
+    var fos = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(
+      Ci.nsIFileOutputStream
+    );
     return this._initFileOutputStream(fos, file, modeFlags);
   },
 
   /**
    * Opens an atomic file output stream for writing.
    * @param   file
    *          The file to write to.
    * @param   modeFlags
    *          (optional) File open flags. Can be undefined.
    * @returns nsIFileOutputStream to write to.
    * @note The stream is initialized with the DEFER_OPEN behavior flag.
    *       See nsIFileOutputStream.
    *       OpeanAtomicFileOutputStream is generally better than openSafeFileOutputStream
    *       baecause flushing is not needed in most of the issues.
    */
-  openAtomicFileOutputStream: function FileUtils_openAtomicFileOutputStream(file, modeFlags) {
-    var fos = Cc["@mozilla.org/network/atomic-file-output-stream;1"].
-              createInstance(Ci.nsIFileOutputStream);
+  openAtomicFileOutputStream: function FileUtils_openAtomicFileOutputStream(
+    file,
+    modeFlags
+  ) {
+    var fos = Cc[
+      "@mozilla.org/network/atomic-file-output-stream;1"
+    ].createInstance(Ci.nsIFileOutputStream);
     return this._initFileOutputStream(fos, file, modeFlags);
   },
 
   /**
    * Opens a safe file output stream for writing.
    * @param   file
    *          The file to write to.
    * @param   modeFlags
    *          (optional) File open flags. Can be undefined.
    * @returns nsIFileOutputStream to write to.
    * @note The stream is initialized with the DEFER_OPEN behavior flag.
    *       See nsIFileOutputStream.
    */
-  openSafeFileOutputStream: function FileUtils_openSafeFileOutputStream(file, modeFlags) {
-    var fos = Cc["@mozilla.org/network/safe-file-output-stream;1"].
-              createInstance(Ci.nsIFileOutputStream);
+  openSafeFileOutputStream: function FileUtils_openSafeFileOutputStream(
+    file,
+    modeFlags
+  ) {
+    var fos = Cc[
+      "@mozilla.org/network/safe-file-output-stream;1"
+    ].createInstance(Ci.nsIFileOutputStream);
     return this._initFileOutputStream(fos, file, modeFlags);
   },
 
- _initFileOutputStream: function FileUtils__initFileOutputStream(fos, file, modeFlags) {
-    if (modeFlags === undefined)
+  _initFileOutputStream: function FileUtils__initFileOutputStream(
+    fos,
+    file,
+    modeFlags
+  ) {
+    if (modeFlags === undefined) {
       modeFlags = this.MODE_WRONLY | this.MODE_CREATE | this.MODE_TRUNCATE;
+    }
     fos.init(file, modeFlags, this.PERMS_FILE, fos.DEFER_OPEN);
     return fos;
   },
 
   /**
    * Closes an atomic file output stream.
    * @param   stream
    *          The stream to close.
    */
-  closeAtomicFileOutputStream: function FileUtils_closeAtomicFileOutputStream(stream) {
+  closeAtomicFileOutputStream: function FileUtils_closeAtomicFileOutputStream(
+    stream
+  ) {
     if (stream instanceof Ci.nsISafeOutputStream) {
       try {
         stream.finish();
         return;
-      } catch (e) {
-      }
+      } catch (e) {}
     }
     stream.close();
   },
 
   /**
    * Closes a safe file output stream.
    * @param   stream
    *          The stream to close.
    */
-  closeSafeFileOutputStream: function FileUtils_closeSafeFileOutputStream(stream) {
+  closeSafeFileOutputStream: function FileUtils_closeSafeFileOutputStream(
+    stream
+  ) {
     if (stream instanceof Ci.nsISafeOutputStream) {
       try {
         stream.finish();
         return;
-      } catch (e) {
-      }
+      } catch (e) {}
     }
     stream.close();
   },
 
-  File: Components.Constructor("@mozilla.org/file/local;1", Ci.nsIFile, "initWithPath"),
+  File: Components.Constructor(
+    "@mozilla.org/file/local;1",
+    Ci.nsIFile,
+    "initWithPath"
+  ),
 };
--- a/toolkit/modules/FindBarContent.jsm
+++ b/toolkit/modules/FindBarContent.jsm
@@ -1,20 +1,25 @@
 // vim: set ts=2 sw=2 sts=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";
 
 var EXPORTED_SYMBOLS = ["FindBarContent"];
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 
-ChromeUtils.defineModuleGetter(this, "Services",
-                               "resource://gre/modules/Services.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Services",
+  "resource://gre/modules/Services.jsm"
+);
 
 /* Please keep in sync with toolkit/content/widgets/findbar.xml */
 const FIND_NORMAL = 0;
 const FIND_TYPEAHEAD = 1;
 const FIND_LINKS = 2;
 
 class FindBarContent {
   constructor(mm) {
@@ -29,18 +34,20 @@ class FindBarContent {
   }
 
   start(event) {
     this.inPassThrough = true;
   }
 
   startQuickFind(event, autostart = false) {
     let mode = FIND_TYPEAHEAD;
-    if (event.charCode == "'".charAt(0) ||
-        autostart && FindBarContent.typeAheadLinksOnly) {
+    if (
+      event.charCode == "'".charAt(0) ||
+      (autostart && FindBarContent.typeAheadLinksOnly)
+    ) {
       mode = FIND_LINKS;
     }
 
     // Set findMode immediately (without waiting for child->parent->child roundtrip)
     // to ensure we pass any further keypresses, too.
     this.findMode = mode;
     this.passKeyToParent(event);
   }
@@ -66,37 +73,52 @@ class FindBarContent {
         this.onMouseup(event);
         break;
     }
   }
 
   onKeypress(event) {
     if (this.inPassThrough) {
       this.passKeyToParent(event);
-    } else if (this.findMode != FIND_NORMAL && this.inQuickFind && event.charCode) {
+    } else if (
+      this.findMode != FIND_NORMAL &&
+      this.inQuickFind &&
+      event.charCode
+    ) {
       this.passKeyToParent(event);
     }
   }
 
   passKeyToParent(event) {
     event.preventDefault();
     // These are the properties required to dispatch another 'real' event
     // to the findbar in the parent in _dispatchKeypressEvent in findbar.xml .
     // If you make changes here, verify that that method can still do its job.
     const kRequiredProps = [
-      "type", "bubbles", "cancelable", "ctrlKey", "altKey", "shiftKey",
-      "metaKey", "keyCode", "charCode",
+      "type",
+      "bubbles",
+      "cancelable",
+      "ctrlKey",
+      "altKey",
+      "shiftKey",
+      "metaKey",
+      "keyCode",
+      "charCode",
     ];
     let fakeEvent = {};
     for (let prop of kRequiredProps) {
       fakeEvent[prop] = event[prop];
     }
     this.mm.sendAsyncMessage("Findbar:Keypress", fakeEvent);
   }
 
   onMouseup(event) {
-    if (this.findMode != FIND_NORMAL)
+    if (this.findMode != FIND_NORMAL) {
       this.mm.sendAsyncMessage("Findbar:Mouseup");
+    }
   }
 }
 
-XPCOMUtils.defineLazyPreferenceGetter(FindBarContent, "typeAheadLinksOnly",
-  "accessibility.typeaheadfind.linksonly");
+XPCOMUtils.defineLazyPreferenceGetter(
+  FindBarContent,
+  "typeAheadLinksOnly",
+  "accessibility.typeaheadfind.linksonly"
+);
--- a/toolkit/modules/Finder.jsm
+++ b/toolkit/modules/Finder.jsm
@@ -1,179 +1,219 @@
 // vim: set ts=2 sw=2 sts=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/.
 
 var EXPORTED_SYMBOLS = ["Finder", "GetClipboardSearchString"];
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-const {Rect} = ChromeUtils.import("resource://gre/modules/Geometry.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
+const { Rect } = ChromeUtils.import("resource://gre/modules/Geometry.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-ChromeUtils.defineModuleGetter(this, "BrowserUtils",
-  "resource://gre/modules/BrowserUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "BrowserUtils",
+  "resource://gre/modules/BrowserUtils.jsm"
+);
 
-XPCOMUtils.defineLazyServiceGetter(this, "Clipboard",
-                                         "@mozilla.org/widget/clipboard;1",
-                                         "nsIClipboard");
-XPCOMUtils.defineLazyServiceGetter(this, "ClipboardHelper",
-                                         "@mozilla.org/widget/clipboardhelper;1",
-                                         "nsIClipboardHelper");
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "Clipboard",
+  "@mozilla.org/widget/clipboard;1",
+  "nsIClipboard"
+);
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "ClipboardHelper",
+  "@mozilla.org/widget/clipboardhelper;1",
+  "nsIClipboardHelper"
+);
 
 const kSelectionMaxLen = 150;
 const kMatchesCountLimitPref = "accessibility.typeaheadfind.matchesCountLimit";
 
 function Finder(docShell) {
-  this._fastFind = Cc["@mozilla.org/typeaheadfind;1"].createInstance(Ci.nsITypeAheadFind);
+  this._fastFind = Cc["@mozilla.org/typeaheadfind;1"].createInstance(
+    Ci.nsITypeAheadFind
+  );
   this._fastFind.init(docShell);
 
   this._currentFoundRange = null;
   this._docShell = docShell;
   this._listeners = [];
   this._previousLink = null;
   this._searchString = null;
   this._highlighter = null;
 
-  docShell.QueryInterface(Ci.nsIInterfaceRequestor)
-          .getInterface(Ci.nsIWebProgress)
-          .addProgressListener(this, Ci.nsIWebProgress.NOTIFY_LOCATION);
-  BrowserUtils.getRootWindow(this._docShell).addEventListener("unload",
-    this.onLocationChange.bind(this, { isTopLevel: true }));
+  docShell
+    .QueryInterface(Ci.nsIInterfaceRequestor)
+    .getInterface(Ci.nsIWebProgress)
+    .addProgressListener(this, Ci.nsIWebProgress.NOTIFY_LOCATION);
+  BrowserUtils.getRootWindow(this._docShell).addEventListener(
+    "unload",
+    this.onLocationChange.bind(this, { isTopLevel: true })
+  );
 }
 
 Finder.prototype = {
   get iterator() {
-    if (this._iterator)
+    if (this._iterator) {
       return this._iterator;
-    this._iterator = ChromeUtils.import("resource://gre/modules/FinderIterator.jsm", null).FinderIterator;
+    }
+    this._iterator = ChromeUtils.import(
+      "resource://gre/modules/FinderIterator.jsm",
+      null
+    ).FinderIterator;
     return this._iterator;
   },
 
   destroy() {
-    if (this._iterator)
+    if (this._iterator) {
       this._iterator.reset();
+    }
     let window = this._getWindow();
     if (this._highlighter && window) {
       // if we clear all the references before we hide the highlights (in both
       // highlighting modes), we simply can't use them to find the ranges we
       // need to clear from the selection.
       this._highlighter.hide(window);
       this._highlighter.clear(window);
     }
     this.listeners = [];
-    this._docShell.QueryInterface(Ci.nsIInterfaceRequestor)
+    this._docShell
+      .QueryInterface(Ci.nsIInterfaceRequestor)
       .getInterface(Ci.nsIWebProgress)
       .removeProgressListener(this, Ci.nsIWebProgress.NOTIFY_LOCATION);
     this._listeners = [];
-    this._currentFoundRange = this._fastFind = this._docShell = this._previousLink =
-      this._highlighter = null;
+    this._currentFoundRange = this._fastFind = this._docShell = this._previousLink = this._highlighter = null;
   },
 
   addResultListener(aListener) {
-    if (!this._listeners.includes(aListener))
+    if (!this._listeners.includes(aListener)) {
       this._listeners.push(aListener);
+    }
   },
 
   removeResultListener(aListener) {
     this._listeners = this._listeners.filter(l => l != aListener);
   },
 
   _notify(options) {
-    if (typeof options.storeResult != "boolean")
+    if (typeof options.storeResult != "boolean") {
       options.storeResult = true;
+    }
 
     if (options.storeResult) {
       this._searchString = options.searchString;
       this.clipboardSearchString = options.searchString;
     }
 
     let foundLink = this._fastFind.foundLink;
     let linkURL = null;
     if (foundLink) {
       let docCharset = null;
       let ownerDoc = foundLink.ownerDocument;
-      if (ownerDoc)
+      if (ownerDoc) {
         docCharset = ownerDoc.characterSet;
+      }
 
-      linkURL = Services.textToSubURI.unEscapeURIForUI(docCharset, foundLink.href);
+      linkURL = Services.textToSubURI.unEscapeURIForUI(
+        docCharset,
+        foundLink.href
+      );
     }
 
     options.linkURL = linkURL;
     options.rect = this._getResultRect();
     options.searchString = this._searchString;
 
-    if (!this.iterator.continueRunning({
-      caseSensitive: this._fastFind.caseSensitive,
-      entireWord: this._fastFind.entireWord,
-      linksOnly: options.linksOnly,
-      word: options.searchString,
-    })) {
+    if (
+      !this.iterator.continueRunning({
+        caseSensitive: this._fastFind.caseSensitive,
+        entireWord: this._fastFind.entireWord,
+        linksOnly: options.linksOnly,
+        word: options.searchString,
+      })
+    ) {
       this.iterator.stop();
     }
 
     this.highlighter.update(options);
     this.requestMatchesCount(options.searchString, options.linksOnly);
 
     this._outlineLink(options.drawOutline);
 
     for (let l of this._listeners) {
       try {
         l.onFindResult(options);
       } catch (ex) {}
     }
   },
 
   get searchString() {
-    if (!this._searchString && this._fastFind.searchString)
+    if (!this._searchString && this._fastFind.searchString) {
       this._searchString = this._fastFind.searchString;
+    }
     return this._searchString;
   },
 
   get clipboardSearchString() {
-    return GetClipboardSearchString(this._getWindow()
-                                        .docShell
-                                        .QueryInterface(Ci.nsILoadContext));
+    return GetClipboardSearchString(
+      this._getWindow().docShell.QueryInterface(Ci.nsILoadContext)
+    );
   },
 
   set clipboardSearchString(aSearchString) {
-    if (!aSearchString || !Clipboard.supportsFindClipboard())
+    if (!aSearchString || !Clipboard.supportsFindClipboard()) {
       return;
+    }
 
-    ClipboardHelper.copyStringToClipboard(aSearchString,
-                                          Ci.nsIClipboard.kFindClipboard);
+    ClipboardHelper.copyStringToClipboard(
+      aSearchString,
+      Ci.nsIClipboard.kFindClipboard
+    );
   },
 
   set caseSensitive(aSensitive) {
-    if (this._fastFind.caseSensitive === aSensitive)
+    if (this._fastFind.caseSensitive === aSensitive) {
       return;
+    }
     this._fastFind.caseSensitive = aSensitive;
     this.iterator.reset();
   },
 
   set entireWord(aEntireWord) {
-    if (this._fastFind.entireWord === aEntireWord)
+    if (this._fastFind.entireWord === aEntireWord) {
       return;
+    }
     this._fastFind.entireWord = aEntireWord;
     this.iterator.reset();
   },
 
   get highlighter() {
-    if (this._highlighter)
+    if (this._highlighter) {
       return this._highlighter;
+    }
 
-    const {FinderHighlighter} = ChromeUtils.import("resource://gre/modules/FinderHighlighter.jsm");
-    return this._highlighter = new FinderHighlighter(this);
+    const { FinderHighlighter } = ChromeUtils.import(
+      "resource://gre/modules/FinderHighlighter.jsm"
+    );
+    return (this._highlighter = new FinderHighlighter(this));
   },
 
   get matchesCountLimit() {
-    if (typeof this._matchesCountLimit == "number")
+    if (typeof this._matchesCountLimit == "number") {
       return this._matchesCountLimit;
+    }
 
-    this._matchesCountLimit = Services.prefs.getIntPref(kMatchesCountLimitPref) || 0;
+    this._matchesCountLimit =
+      Services.prefs.getIntPref(kMatchesCountLimitPref) || 0;
     return this._matchesCountLimit;
   },
 
   _lastFindResult: null,
 
   /**
    * Used for normal search operations, highlights the first match.
    *
@@ -219,18 +259,19 @@ Finder.prototype = {
   /**
    * Forcibly set the search string of the find clipboard to the currently
    * selected text in the window, on supported platforms (i.e. OSX).
    */
   setSearchStringToSelection() {
     let searchString = this.getActiveSelectionText();
 
     // Empty strings are rather useless to search for.
-    if (!searchString.length)
+    if (!searchString.length) {
       return null;
+    }
 
     this.clipboardSearchString = searchString;
     return searchString;
   },
 
   async highlight(aHighlight, aWord, aLinksOnly) {
     await this.highlighter.highlight(aHighlight, aWord, aLinksOnly);
   },
@@ -243,81 +284,93 @@ Finder.prototype = {
           l.onCurrentSelection(initialSelection, true);
         } catch (ex) {}
       }
     }, 0);
   },
 
   getActiveSelectionText() {
     let focusedWindow = {};
-    let focusedElement =
-      Services.focus.getFocusedElementForWindow(this._getWindow(), true,
-                                                focusedWindow);
+    let focusedElement = Services.focus.getFocusedElementForWindow(
+      this._getWindow(),
+      true,
+      focusedWindow
+    );
     focusedWindow = focusedWindow.value;
 
     let selText;
 
     if (focusedElement && focusedElement.editor) {
       // The user may have a selection in an input or textarea.
       selText = focusedElement.editor.selectionController
         .getSelection(Ci.nsISelectionController.SELECTION_NORMAL)
         .toString();
     } else {
       // Look for any selected text on the actual page.
       selText = focusedWindow.getSelection().toString();
     }
 
-    if (!selText)
+    if (!selText) {
       return "";
+    }
 
     // Process our text to get rid of unwanted characters.
     selText = selText.trim().replace(/\s+/g, " ");
     let truncLength = kSelectionMaxLen;
     if (selText.length > truncLength) {
       let truncChar = selText.charAt(truncLength).charCodeAt(0);
-      if (truncChar >= 0xDC00 && truncChar <= 0xDFFF)
+      if (truncChar >= 0xdc00 && truncChar <= 0xdfff) {
         truncLength++;
+      }
       selText = selText.substr(0, truncLength);
     }
 
     return selText;
   },
 
   enableSelection() {
-    this._fastFind.setSelectionModeAndRepaint(Ci.nsISelectionController.SELECTION_ON);
+    this._fastFind.setSelectionModeAndRepaint(
+      Ci.nsISelectionController.SELECTION_ON
+    );
     this._restoreOriginalOutline();
   },
 
   removeSelection() {
     this._fastFind.collapseSelection();
     this.enableSelection();
     this.highlighter.clear(this._getWindow());
   },
 
   focusContent() {
     // Allow Finder listeners to cancel focusing the content.
     for (let l of this._listeners) {
       try {
-        if ("shouldFocusContent" in l &&
-            !l.shouldFocusContent())
+        if ("shouldFocusContent" in l && !l.shouldFocusContent()) {
           return;
+        }
       } catch (ex) {
         Cu.reportError(ex);
       }
     }
 
     let fastFind = this._fastFind;
     try {
       // Try to find the best possible match that should receive focus and
       // block scrolling on focus since find already scrolls. Further
       // scrolling is due to user action, so don't override this.
       if (fastFind.foundLink) {
-        Services.focus.setFocus(fastFind.foundLink, Services.focus.FLAG_NOSCROLL);
+        Services.focus.setFocus(
+          fastFind.foundLink,
+          Services.focus.FLAG_NOSCROLL
+        );
       } else if (fastFind.foundEditable) {
-        Services.focus.setFocus(fastFind.foundEditable, Services.focus.FLAG_NOSCROLL);
+        Services.focus.setFocus(
+          fastFind.foundEditable,
+          Services.focus.FLAG_NOSCROLL
+        );
         fastFind.collapseSelection();
       } else {
         this._getWindow().focus();
       }
     } catch (e) {}
   },
 
   onFindbarClose() {
@@ -327,43 +380,48 @@ Finder.prototype = {
     BrowserUtils.trackToolbarVisibility(this._docShell, "findbar", false);
   },
 
   onFindbarOpen() {
     BrowserUtils.trackToolbarVisibility(this._docShell, "findbar", true);
   },
 
   onModalHighlightChange(useModalHighlight) {
-    if (this._highlighter)
+    if (this._highlighter) {
       this._highlighter.onModalHighlightChange(useModalHighlight);
+    }
   },
 
   onHighlightAllChange(highlightAll) {
-    if (this._highlighter)
+    if (this._highlighter) {
       this._highlighter.onHighlightAllChange(highlightAll);
-    if (this._iterator)
+    }
+    if (this._iterator) {
       this._iterator.reset();
+    }
   },
 
   keyPress(aEvent) {
     let controller = this._getSelectionController(this._getWindow());
 
     switch (aEvent.keyCode) {
       case aEvent.DOM_VK_RETURN:
         if (this._fastFind.foundLink) {
           let view = this._fastFind.foundLink.ownerGlobal;
-          this._fastFind.foundLink.dispatchEvent(new view.MouseEvent("click", {
-            view,
-            cancelable: true,
-            bubbles: true,
-            ctrlKey: aEvent.ctrlKey,
-            altKey: aEvent.altKey,
-            shiftKey: aEvent.shiftKey,
-            metaKey: aEvent.metaKey,
-          }));
+          this._fastFind.foundLink.dispatchEvent(
+            new view.MouseEvent("click", {
+              view,
+              cancelable: true,
+              bubbles: true,
+              ctrlKey: aEvent.ctrlKey,
+              altKey: aEvent.altKey,
+              shiftKey: aEvent.shiftKey,
+              metaKey: aEvent.metaKey,
+            })
+          );
         }
         break;
       case aEvent.DOM_VK_TAB:
         let direction = Services.focus.MOVEFOCUS_FORWARD;
         if (aEvent.shiftKey) {
           direction = Services.focus.MOVEFOCUS_BACKWARD;
         }
         Services.focus.moveFocus(this._getWindow(), null, direction, 0);
@@ -382,78 +440,94 @@ Finder.prototype = {
         break;
     }
   },
 
   _notifyMatchesCount(result = this._currentMatchesCountResult) {
     // The `_currentFound` property is only used for internal bookkeeping.
     delete result._currentFound;
     result.limit = this.matchesCountLimit;
-    if (result.total == result.limit)
+    if (result.total == result.limit) {
       result.total = -1;
+    }
 
     for (let l of this._listeners) {
       try {
         l.onMatchesCountResult(result);
       } catch (ex) {}
     }
 
     this._currentMatchesCountResult = null;
   },
 
   requestMatchesCount(aWord, aLinksOnly) {
-    if (this._lastFindResult == Ci.nsITypeAheadFind.FIND_NOTFOUND ||
-        this.searchString == "" || !aWord || !this.matchesCountLimit) {
+    if (
+      this._lastFindResult == Ci.nsITypeAheadFind.FIND_NOTFOUND ||
+      this.searchString == "" ||
+      !aWord ||
+      !this.matchesCountLimit
+    ) {
       this._notifyMatchesCount({
         total: 0,
         current: 0,
       });
       return;
     }
 
     this._currentFoundRange = this._fastFind.getFoundRange();
 
     let params = {
       caseSensitive: this._fastFind.caseSensitive,
       entireWord: this._fastFind.entireWord,
       linksOnly: aLinksOnly,
       word: aWord,
     };
-    if (!this.iterator.continueRunning(params))
+    if (!this.iterator.continueRunning(params)) {
       this.iterator.stop();
+    }
 
-    this.iterator.start(Object.assign(params, {
-      finder: this,
-      limit: this.matchesCountLimit,
-      listener: this,
-      useCache: true,
-    })).then(() => {
-      // Without a valid result, there's nothing to notify about. This happens
-      // when the iterator was started before and won the race.
-      if (!this._currentMatchesCountResult || !this._currentMatchesCountResult.total)
-        return;
-      this._notifyMatchesCount();
-    });
+    this.iterator
+      .start(
+        Object.assign(params, {
+          finder: this,
+          limit: this.matchesCountLimit,
+          listener: this,
+          useCache: true,
+        })
+      )
+      .then(() => {
+        // Without a valid result, there's nothing to notify about. This happens
+        // when the iterator was started before and won the race.
+        if (
+          !this._currentMatchesCountResult ||
+          !this._currentMatchesCountResult.total
+        ) {
+          return;
+        }
+        this._notifyMatchesCount();
+      });
   },
 
   // FinderIterator listener implementation
 
   onIteratorRangeFound(range) {
     let result = this._currentMatchesCountResult;
-    if (!result)
+    if (!result) {
       return;
+    }
 
     ++result.total;
     if (!result._currentFound) {
       ++result.current;
-      result._currentFound = (this._currentFoundRange &&
+      result._currentFound =
+        this._currentFoundRange &&
         range.startContainer == this._currentFoundRange.startContainer &&
         range.startOffset == this._currentFoundRange.startOffset &&
         range.endContainer == this._currentFoundRange.endContainer &&
-        range.endOffset == this._currentFoundRange.endOffset);
+        range.endOffset == this._currentFoundRange.endOffset;
     }
   },
 
   onIteratorReset() {},
 
   onIteratorRestart({ word, linksOnly }) {
     this.requestMatchesCount(word, linksOnly);
   },
@@ -462,40 +536,44 @@ Finder.prototype = {
     this._currentMatchesCountResult = {
       total: 0,
       current: 0,
       _currentFound: false,
     };
   },
 
   _getWindow() {
-    if (!this._docShell)
+    if (!this._docShell) {
       return null;
+    }
     return this._docShell.domWindow;
   },
 
   /**
    * Get the bounding selection rect in CSS px relative to the origin of the
    * top-level content document.
    */
   _getResultRect() {
     let topWin = this._getWindow();
     let win = this._fastFind.currentWindow;
-    if (!win)
+    if (!win) {
       return null;
+    }
 
     let selection = win.getSelection();
     if (!selection.rangeCount || selection.isCollapsed) {
       // The selection can be into an input or a textarea element.
       let nodes = win.document.querySelectorAll("input, textarea");
       for (let node of nodes) {
         if (node.editor) {
           try {
             let sc = node.editor.selectionController;
-            selection = sc.getSelection(Ci.nsISelectionController.SELECTION_NORMAL);
+            selection = sc.getSelection(
+              Ci.nsISelectionController.SELECTION_NORMAL
+            );
             if (selection.rangeCount && !selection.isCollapsed) {
               break;
             }
           } catch (e) {
             // If this textarea is hidden, then its selection controller might
             // not be intialized. Ignore the failure.
           }
         }
@@ -503,17 +581,18 @@ Finder.prototype = {
     }
 
     if (!selection.rangeCount || selection.isCollapsed) {
       return null;
     }
 
     let utils = topWin.windowUtils;
 
-    let scrollX = {}, scrollY = {};
+    let scrollX = {},
+      scrollY = {};
     utils.getScrollXY(false, scrollX, scrollY);
 
     for (let frame = win; frame != topWin; frame = frame.parent) {
       let rect = frame.frameElement.getBoundingClientRect();
       let left = frame.getComputedStyle(frame.frameElement).borderLeftWidth;
       let top = frame.getComputedStyle(frame.frameElement).borderTopWidth;
       scrollX.value += rect.left + parseInt(left, 10);
       scrollY.value += rect.top + parseInt(top, 10);
@@ -522,18 +601,19 @@ Finder.prototype = {
     return rect.translate(scrollX.value, scrollY.value);
   },
 
   _outlineLink(aDrawOutline) {
     let foundLink = this._fastFind.foundLink;
 
     // Optimization: We are drawing outlines and we matched
     // the same link before, so don't duplicate work.
-    if (foundLink == this._previousLink && aDrawOutline)
+    if (foundLink == this._previousLink && aDrawOutline) {
       return;
+    }
 
     this._restoreOriginalOutline();
 
     if (foundLink && aDrawOutline) {
       // Backup original outline
       this._tmpOutline = foundLink.style.outline;
       this._tmpOutlineOffset = foundLink.style.outlineOffset;
 
@@ -556,68 +636,75 @@ Finder.prototype = {
       this._previousLink.style.outlineOffset = this._tmpOutlineOffset;
       this._previousLink = null;
     }
   },
 
   _getSelectionController(aWindow) {
     // display: none iframes don't have a selection controller, see bug 493658
     try {
-      if (!aWindow.innerWidth || !aWindow.innerHeight)
+      if (!aWindow.innerWidth || !aWindow.innerHeight) {
         return null;
+      }
     } catch (e) {
       // If getting innerWidth or innerHeight throws, we can't get a selection
       // controller.
       return null;
     }
 
     // Yuck. See bug 138068.
     let docShell = aWindow.docShell;
 
-    let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
-                             .getInterface(Ci.nsISelectionDisplay)
-                             .QueryInterface(Ci.nsISelectionController);
+    let controller = docShell
+      .QueryInterface(Ci.nsIInterfaceRequestor)
+      .getInterface(Ci.nsISelectionDisplay)
+      .QueryInterface(Ci.nsISelectionController);
     return controller;
   },
 
   // Start of nsIWebProgressListener implementation.
 
   onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {
-    if (!aWebProgress.isTopLevel)
+    if (!aWebProgress.isTopLevel) {
       return;
+    }
     // Ignore events that don't change the document.
-    if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT)
+    if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
       return;
+    }
 
     // Avoid leaking if we change the page.
     this._lastFindResult = this._previousLink = this._currentFoundRange = null;
     this.highlighter.onLocationChange();
     this.iterator.reset();
   },
 
-  QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener,
-                                          Ci.nsISupportsWeakReference]),
+  QueryInterface: ChromeUtils.generateQI([
+    Ci.nsIWebProgressListener,
+    Ci.nsISupportsWeakReference,
+  ]),
 };
 
 function GetClipboardSearchString(aLoadContext) {
   let searchString = "";
-  if (!Clipboard.supportsFindClipboard())
+  if (!Clipboard.supportsFindClipboard()) {
     return searchString;
+  }
 
   try {
-    let trans = Cc["@mozilla.org/widget/transferable;1"]
-                  .createInstance(Ci.nsITransferable);
+    let trans = Cc["@mozilla.org/widget/transferable;1"].createInstance(
+      Ci.nsITransferable
+    );
     trans.init(aLoadContext);
     trans.addDataFlavor("text/unicode");
 
     Clipboard.getData(trans, Ci.nsIClipboard.kFindClipboard);
 
     let data = {};
     trans.getTransferData("text/unicode", data);
     if (data.value) {
       data = data.value.QueryInterface(Ci.nsISupportsString);
       searchString = data.toString();
     }
   } catch (ex) {}
 
   return searchString;
 }
-
--- a/toolkit/modules/FinderHighlighter.jsm
+++ b/toolkit/modules/FinderHighlighter.jsm
@@ -1,42 +1,71 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var EXPORTED_SYMBOLS = ["FinderHighlighter"];
 
-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"
+);
 
-ChromeUtils.defineModuleGetter(this, "Color", "resource://gre/modules/Color.jsm");
-ChromeUtils.defineModuleGetter(this, "Rect", "resource://gre/modules/Geometry.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Color",
+  "resource://gre/modules/Color.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "Rect",
+  "resource://gre/modules/Geometry.jsm"
+);
 XPCOMUtils.defineLazyGetter(this, "kDebug", () => {
   const kDebugPref = "findbar.modalHighlight.debug";
-  return Services.prefs.getPrefType(kDebugPref) && Services.prefs.getBoolPref(kDebugPref);
+  return (
+    Services.prefs.getPrefType(kDebugPref) &&
+    Services.prefs.getBoolPref(kDebugPref)
+  );
 });
 
 const kContentChangeThresholdPx = 5;
 const kBrightTextSampleSize = 5;
 // This limit is arbitrary and doesn't scale for low-powered machines or
 // high-powered machines. Netbooks will probably need a much lower limit, for
 // example. Though getting something out there is better than nothing.
 const kPageIsTooBigPx = 500000;
 const kModalHighlightRepaintLoFreqMs = 100;
 const kModalHighlightRepaintHiFreqMs = 16;
 const kHighlightAllPref = "findbar.highlightAll";
 const kModalHighlightPref = "findbar.modalHighlight";
-const kFontPropsCSS = ["color", "font-family", "font-kerning", "font-size",
-  "font-size-adjust", "font-stretch", "font-variant", "font-weight", "line-height",
-  "letter-spacing", "text-emphasis", "text-orientation", "text-transform", "word-spacing"];
+const kFontPropsCSS = [
+  "color",
+  "font-family",
+  "font-kerning",
+  "font-size",
+  "font-size-adjust",
+  "font-stretch",
+  "font-variant",
+  "font-weight",
+  "line-height",
+  "letter-spacing",
+  "text-emphasis",
+  "text-orientation",
+  "text-transform",
+  "word-spacing",
+];
 const kFontPropsCamelCase = kFontPropsCSS.map(prop => {
   let parts = prop.split("-");
-  return parts.shift() + parts.map(part => part.charAt(0).toUpperCase() + part.slice(1)).join("");
+  return (
+    parts.shift() +
+    parts.map(part => part.charAt(0).toUpperCase() + part.slice(1)).join("")
+  );
 });
 const kRGBRE = /^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*/i;
 // This uuid is used to prefix HTML element IDs in order to make them unique and
 // hard to clash with IDs content authors come up with.
 const kModalIdPrefix = "cedee4d0-74c5-4f2d-ab43-4d37c0f9d463";
 const kModalOutlineId = kModalIdPrefix + "-findbar-modalHighlight-outline";
 const kOutlineBoxColor = "255,197,53";
 const kOutlineBoxBorderSize = 1;
@@ -45,86 +74,91 @@ const kModalStyles = {
   outlineNode: [
     ["background-color", `rgb(${kOutlineBoxColor})`],
     ["background-clip", "padding-box"],
     ["border", `${kOutlineBoxBorderSize}px solid rgba(${kOutlineBoxColor},.7)`],
     ["border-radius", `${kOutlineBoxBorderRadius}px`],
     ["box-shadow", `0 2px 0 0 rgba(0,0,0,.1)`],
     ["color", "#000"],
     ["display", "-moz-box"],
-    ["margin", `-${kOutlineBoxBorderSize}px 0 0 -${kOutlineBoxBorderSize}px !important`],
+    [
+      "margin",
+      `-${kOutlineBoxBorderSize}px 0 0 -${kOutlineBoxBorderSize}px !important`,
+    ],
     ["overflow", "hidden"],
     ["pointer-events", "none"],
     ["position", "absolute"],
     ["white-space", "nowrap"],
     ["will-change", "transform"],
     ["z-index", 2],
   ],
-  outlineNodeDebug: [ ["z-index", 2147483647] ],
+  outlineNodeDebug: [["z-index", 2147483647]],
   outlineText: [
     ["margin", "0 !important"],
     ["padding", "0 !important"],
     ["vertical-align", "top !important"],
   ],
   maskNode: [
     ["background", "rgba(0,0,0,.25)"],
     ["pointer-events", "none"],
     ["position", "absolute"],
     ["z-index", 1],
   ],
-  maskNodeTransition: [
-    ["transition", "background .2s ease-in"],
-  ],
-  maskNodeDebug: [
-    ["z-index", 2147483646],
-    ["top", 0],
-    ["left", 0],
-  ],
-  maskNodeBrightText: [ ["background", "rgba(255,255,255,.25)"] ],
+  maskNodeTransition: [["transition", "background .2s ease-in"]],
+  maskNodeDebug: [["z-index", 2147483646], ["top", 0], ["left", 0]],
+  maskNodeBrightText: [["background", "rgba(255,255,255,.25)"]],
 };
 const kModalOutlineAnim = {
-  "keyframes": [
+  keyframes: [
     { transform: "scaleX(1) scaleY(1)" },
-    { transform: "scaleX(1.5) scaleY(1.5)", offset: .5, easing: "ease-in" },
+    { transform: "scaleX(1.5) scaleY(1.5)", offset: 0.5, easing: "ease-in" },
     { transform: "scaleX(1) scaleY(1)" },
   ],
   duration: 50,
 };
 const kNSHTML = "http://www.w3.org/1999/xhtml";
 const kRepaintSchedulerStopped = 1;
 const kRepaintSchedulerPaused = 2;
 const kRepaintSchedulerRunning = 3;
 
 function mockAnonymousContentNode(domNode) {
   return {
     setTextContentForElement(id, text) {
       (domNode.querySelector("#" + id) || domNode).textContent = text;
     },
     getAttributeForElement(id, attrName) {
       let node = domNode.querySelector("#" + id) || domNode;
-      if (!node.hasAttribute(attrName))
+      if (!node.hasAttribute(attrName)) {
         return undefined;
+      }
       return node.getAttribute(attrName);
     },
     setAttributeForElement(id, attrName, attrValue) {
-      (domNode.querySelector("#" + id) || domNode).setAttribute(attrName, attrValue);
+      (domNode.querySelector("#" + id) || domNode).setAttribute(
+        attrName,
+        attrValue
+      );
     },
     removeAttributeForElement(id, attrName) {
       let node = domNode.querySelector("#" + id) || domNode;
-      if (!node.hasAttribute(attrName))
+      if (!node.hasAttribute(attrName)) {
         return;
+      }
       node.removeAttribute(attrName);
     },
     remove() {
       try {
         domNode.remove();
       } catch (ex) {}
     },
     setAnimationForElement(id, keyframes, duration) {
-      return (domNode.querySelector("#" + id) || domNode).animate(keyframes, duration);
+      return (domNode.querySelector("#" + id) || domNode).animate(
+        keyframes,
+        duration
+      );
     },
     setCutoutRectsForElement(id, rects) {
       // no-op for now.
     },
   };
 }
 
 let gWindows = new WeakMap();
@@ -138,19 +172,23 @@ let gWindows = new WeakMap();
 function FinderHighlighter(finder) {
   this._highlightAll = Services.prefs.getBoolPref(kHighlightAllPref);
   this._modal = Services.prefs.getBoolPref(kModalHighlightPref);
   this.finder = finder;
 }
 
 FinderHighlighter.prototype = {
   get iterator() {
-    if (this._iterator)
+    if (this._iterator) {
       return this._iterator;
-    this._iterator = ChromeUtils.import("resource://gre/modules/FinderIterator.jsm", null).FinderIterator;
+    }
+    this._iterator = ChromeUtils.import(
+      "resource://gre/modules/FinderIterator.jsm",
+      null
+    ).FinderIterator;
     return this._iterator;
   },
 
   /**
    * Each window is unique, globally, and the relation between an active
    * highlighting session and a window is 1:1.
    * For each window we track a number of properties which _at least_ consist of
    *  - {Boolean} detectedGeometryChange Whether the geometry of the found ranges'
@@ -216,32 +254,38 @@ FinderHighlighter.prototype = {
       return;
     }
 
     if (highlight) {
       let params = {
         allowDistance: 1,
         caseSensitive: this.finder._fastFind.caseSensitive,
         entireWord: this.finder._fastFind.entireWord,
-        linksOnly, word,
+        linksOnly,
+        word,
         finder: this.finder,
         listener: this,
         useCache: true,
         window,
       };
-      if (this.iterator.isAlreadyRunning(params) ||
-          (this._modal && this.iterator._areParamsEqual(params, dict.lastIteratorParams))) {
+      if (
+        this.iterator.isAlreadyRunning(params) ||
+        (this._modal &&
+          this.iterator._areParamsEqual(params, dict.lastIteratorParams))
+      ) {
         return;
       }
 
-      if (!this._modal)
+      if (!this._modal) {
         dict.visible = true;
+      }
       await this.iterator.start(params);
-      if (this._found)
+      if (this._found) {
         this.finder._outlineLink(drawOutline);
+      }
     } else {
       this.hide(window);
 
       // Removing the highlighting always succeeds, so return true.
       this._found = true;
     }
 
     this.notifyFinished({ highlight, found: this._found });
@@ -260,18 +304,19 @@ FinderHighlighter.prototype = {
     this.clear(this.finder._getWindow());
   },
 
   onIteratorStart(params) {
     let window = this.finder._getWindow();
     let dict = this.getForWindow(window);
     // Save a clean params set for use later in the `update()` method.
     dict.lastIteratorParams = params;
-    if (!this._modal)
+    if (!this._modal) {
       this.hide(window, this.finder._fastFind.getFoundRange());
+    }
     this.clear(window);
   },
 
   /**
    * Add a range to the find selection, i.e. highlight it, and if it's inside an
    * editable node, track it.
    *
    * @param {Range} range Range object to be highlighted
@@ -283,17 +328,19 @@ FinderHighlighter.prototype = {
     let controller = this.finder._getSelectionController(window);
     if (editableNode) {
       controller = editableNode.editor.selectionController;
     }
 
     if (this._modal) {
       this._modalHighlight(range, controller, window);
     } else {
-      let findSelection = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
+      let findSelection = controller.getSelection(
+        Ci.nsISelectionController.SELECTION_FIND
+      );
       findSelection.addRange(range);
       // Check if the range is inside an (i)frame.
       if (window != window.top) {
         let dict = this.getForWindow(window.top);
         // Add this frame to the list, so that we'll be able to find it later
         // when we need to clear its selection(s).
         dict.frames.set(window, {});
       }
@@ -311,18 +358,19 @@ FinderHighlighter.prototype = {
    * the page.
    *
    * @param {nsIDOMWindow} window The dimmed background will overlay this window.
    *                              Optional, defaults to the finder window.
    */
   show(window = null) {
     window = (window || this.finder._getWindow()).top;
     let dict = this.getForWindow(window);
-    if (!this._modal || dict.visible)
+    if (!this._modal || dict.visible) {
       return;
+    }
 
     dict.visible = true;
 
     this._maybeCreateModalHighlightNodes(window);
     this._addModalHighlightListeners(window);
   },
 
   /**
@@ -343,25 +391,41 @@ FinderHighlighter.prototype = {
       Cu.reportError(ex);
       return;
     }
     let dict = this.getForWindow(window);
 
     let isBusySelecting = dict.busySelecting;
     dict.busySelecting = false;
     // Do not hide on anything but a left-click.
-    if (event && event.type == "click" && (event.button !== 0 || event.altKey ||
-        event.ctrlKey || event.metaKey || event.shiftKey || event.relatedTarget ||
-        isBusySelecting || (event.target.localName == "a" && event.target.href))) {
+    if (
+      event &&
+      event.type == "click" &&
+      (event.button !== 0 ||
+        event.altKey ||
+        event.ctrlKey ||
+        event.metaKey ||
+        event.shiftKey ||
+        event.relatedTarget ||
+        isBusySelecting ||
+        (event.target.localName == "a" && event.target.href))
+    ) {
       return;
     }
 
-    this._clearSelection(this.finder._getSelectionController(window), skipRange);
-    for (let frame of dict.frames.keys())
-      this._clearSelection(this.finder._getSelectionController(frame), skipRange);
+    this._clearSelection(
+      this.finder._getSelectionController(window),
+      skipRange
+    );
+    for (let frame of dict.frames.keys()) {
+      this._clearSelection(
+        this.finder._getSelectionController(frame),
+        skipRange
+      );
+    }
 
     // Next, check our editor cache, for editors belonging to this
     // document
     if (this._editors) {
       let doc = window.document;
       for (let x = this._editors.length - 1; x >= 0; --x) {
         if (this._editors[x].document == doc) {
           this._clearSelection(this._editors[x].selectionController, skipRange);
@@ -406,61 +470,79 @@ FinderHighlighter.prototype = {
    *   {Boolean} storeResult   Indicator if the search string should be stored
    *                           by the consumer of the Finder.
    */
   update(data) {
     let window = this.finder._getWindow();
     let dict = this.getForWindow(window);
     let foundRange = this.finder._fastFind.getFoundRange();
 
-    if (data.result == Ci.nsITypeAheadFind.FIND_NOTFOUND || !data.searchString || !foundRange) {
+    if (
+      data.result == Ci.nsITypeAheadFind.FIND_NOTFOUND ||
+      !data.searchString ||
+      !foundRange
+    ) {
       this.hide(window);
       return;
     }
 
     if (!this._modal) {
       if (this._highlightAll) {
         dict.previousFoundRange = dict.currentFoundRange;
         dict.currentFoundRange = foundRange;
         let params = this.iterator.params;
-        if (dict.visible && this.iterator._areParamsEqual(params, dict.lastIteratorParams))
+        if (
+          dict.visible &&
+          this.iterator._areParamsEqual(params, dict.lastIteratorParams)
+        ) {
           return;
-        if (!dict.visible && !params)
-          params = {word: data.searchString, linksOnly: data.linksOnly};
-        if (params)
-          this.highlight(true, params.word, params.linksOnly, params.drawOutline);
+        }
+        if (!dict.visible && !params) {
+          params = { word: data.searchString, linksOnly: data.linksOnly };
+        }
+        if (params) {
+          this.highlight(
+            true,
+            params.word,
+            params.linksOnly,
+            params.drawOutline
+          );
+        }
       }
       return;
     }
 
     dict.animateOutline = true;
     // Immediately finish running animations, if any.
     this._finishOutlineAnimations(dict);
 
     if (foundRange !== dict.currentFoundRange || data.findAgain) {
       dict.previousFoundRange = dict.currentFoundRange;
       dict.currentFoundRange = foundRange;
 
-      if (!dict.visible)
+      if (!dict.visible) {
         this.show(window);
-      else
+      } else {
         this._maybeCreateModalHighlightNodes(window);
+      }
     }
 
-    if (this._highlightAll)
+    if (this._highlightAll) {
       this.highlight(true, data.searchString, data.linksOnly, data.drawOutline);
+    }
   },
 
   /**
    * Invalidates the list by clearing the map of highlighted ranges that we
    * keep to build the mask for.
    */
   clear(window = null) {
-    if (!window || !window.top)
+    if (!window || !window.top) {
       return;
+    }
 
     let dict = this.getForWindow(window.top);
     this._finishOutlineAnimations(dict);
     dict.dynamicRangesSet.clear();
     dict.frames.clear();
     dict.modalHighlightRectsMap.clear();
     dict.brightText = null;
   },
@@ -468,18 +550,19 @@ FinderHighlighter.prototype = {
   /**
    * When the current page is refreshed or navigated away from, the CanvasFrame
    * contents is not valid anymore, i.e. all anonymous content is destroyed.
    * We need to clear the references we keep, which'll make sure we redraw
    * everything when the user starts to find in page again.
    */
   onLocationChange() {
     let window = this.finder._getWindow();
-    if (!window || !window.top)
+    if (!window || !window.top) {
       return;
+    }
     this.hide(window);
     this.clear(window);
     this._removeRangeOutline(window);
 
     gWindows.delete(window.top);
   },
 
   /**
@@ -503,52 +586,55 @@ FinderHighlighter.prototype = {
    * and when it's turned off, the found occurrences will be removed from the mask.
    *
    * @param {Boolean} highlightAll
    */
   onHighlightAllChange(highlightAll) {
     this._highlightAll = highlightAll;
     if (!highlightAll) {
       let window = this.finder._getWindow();
-      if (!this._modal)
+      if (!this._modal) {
         this.hide(window);
+      }
       this.clear(window);
       this._scheduleRepaintOfMask(window);
     }
   },
 
   /**
    * Utility; removes all ranges from the find selection that belongs to a
    * controller. Optionally skips a specific range.
    *
    * @param  {nsISelectionController} controller
    * @param  {Range}                  restoreRange
    */
   _clearSelection(controller, restoreRange = null) {
-    if (!controller)
+    if (!controller) {
       return;
+    }
     let sel = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
     sel.removeAllRanges();
     if (restoreRange) {
       sel = controller.getSelection(Ci.nsISelectionController.SELECTION_NORMAL);
       sel.addRange(restoreRange);
-      controller.setDisplaySelection(Ci.nsISelectionController.SELECTION_ATTENTION);
+      controller.setDisplaySelection(
+        Ci.nsISelectionController.SELECTION_ATTENTION
+      );
       controller.repaintSelection(Ci.nsISelectionController.SELECTION_NORMAL);
     }
   },
 
   /**
    * Utility; get the nsIDOMWindowUtils for a window.
    *
    * @param  {nsIDOMWindow} window Optional, defaults to the finder window.
    * @return {nsIDOMWindowUtils}
    */
   _getDWU(window = null) {
-    return (window || this.finder._getWindow())
-      .windowUtils;
+    return (window || this.finder._getWindow()).windowUtils;
   },
 
   /**
    * Utility; returns the bounds of the page relative to the viewport.
    * If the pages is part of a frameset or inside an iframe of any kind, its
    * offset is accounted for.
    * Geometry.jsm takes care of the DOMRect calculations.
    *
@@ -610,37 +696,46 @@ FinderHighlighter.prototype = {
    *
    * @param  {nsIDOMWindow} window          Window to read the boundary rect from
    * @return {Object}       Simple object that contains the following two properties:
    *                        - {Number} x Offset along the horizontal axis.
    *                        - {Number} y Offset along the vertical axis.
    */
   _getFrameElementOffsets(window) {
     let frame = window.frameElement;
-    if (!frame)
+    if (!frame) {
       return { x: 0, y: 0 };
+    }
 
     // Getting style info is super expensive, causing reflows, so let's cache
     // frame border widths and padding values aggressively.
     let dict = this.getForWindow(window.top);
     let frameData = dict.frames.get(window);
-    if (!frameData)
-      dict.frames.set(window, frameData = {});
-    if (frameData.offset)
+    if (!frameData) {
+      dict.frames.set(window, (frameData = {}));
+    }
+    if (frameData.offset) {
       return frameData.offset;
+    }
 
     let style = frame.ownerGlobal.getComputedStyle(frame);
     // We only need to left sides, because ranges are offset from point 0,0 in
     // the top-left corner.
-    let borderOffset = [parseInt(style.borderLeftWidth, 10) || 0, parseInt(style.borderTopWidth, 10) || 0];
-    let paddingOffset = [parseInt(style.paddingLeft, 10) || 0, parseInt(style.paddingTop, 10) || 0];
-    return frameData.offset = {
+    let borderOffset = [
+      parseInt(style.borderLeftWidth, 10) || 0,
+      parseInt(style.borderTopWidth, 10) || 0,
+    ];
+    let paddingOffset = [
+      parseInt(style.paddingLeft, 10) || 0,
+      parseInt(style.paddingTop, 10) || 0,
+    ];
+    return (frameData.offset = {
       x: borderOffset[0] + paddingOffset[0],
       y: borderOffset[1] + paddingOffset[1],
-    };
+    });
   },
 
   /**
    * Utility; fetch the full width and height of the current window, excluding
    * scrollbars.
    *
    * @param  {nsiDOMWindow} window The current finder window.
    * @return {Object} The current full page dimensions with `width` and `height`
@@ -670,40 +765,43 @@ FinderHighlighter.prototype = {
    * Utility; get all available font styles as applied to the content of a given
    * range. The CSS properties we look for can be found in `kFontPropsCSS`.
    *
    * @param  {Range} range Range to fetch style info from.
    * @return {Object} Dictionary consisting of the styles that were found.
    */
   _getRangeFontStyle(range) {
     let node = range.startContainer;
-    while (node.nodeType != 1)
+    while (node.nodeType != 1) {
       node = node.parentNode;
+    }
     let style = node.ownerGlobal.getComputedStyle(node);
     let props = {};
     for (let prop of kFontPropsCamelCase) {
-      if (prop in style && style[prop])
+      if (prop in style && style[prop]) {
         props[prop] = style[prop];
+      }
     }
     return props;
   },
 
   /**
    * Utility; transform a dictionary object as returned by `_getRangeFontStyle`
    * above into a HTML style attribute value.
    *
    * @param  {Object} fontStyle
    * @return {String}
    */
   _getHTMLFontStyle(fontStyle) {
     let style = [];
     for (let prop of Object.getOwnPropertyNames(fontStyle)) {
       let idx = kFontPropsCamelCase.indexOf(prop);
-      if (idx == -1)
+      if (idx == -1) {
         continue;
+      }
       style.push(`${kFontPropsCSS[idx]}: ${fontStyle[prop]}`);
     }
     return style.join("; ");
   },
 
   /**
    * Transform a style definition array as defined in `kModalStyles` into a CSS
    * string that can be used to set the 'style' property of a DOM node.
@@ -712,34 +810,38 @@ FinderHighlighter.prototype = {
    * @param  {...Array} [additionalStyles] Optional set of style pairs that will
    *                                       augment or override the styles defined
    *                                       by `stylePairs`
    * @return {String}
    */
   _getStyleString(stylePairs, ...additionalStyles) {
     let baseStyle = new Map(stylePairs);
     for (let additionalStyle of additionalStyles) {
-      for (let [prop, value] of additionalStyle)
+      for (let [prop, value] of additionalStyle) {
         baseStyle.set(prop, value);
+      }
     }
-    return [...baseStyle].map(([cssProp, cssVal]) => `${cssProp}: ${cssVal}`).join("; ");
+    return [...baseStyle]
+      .map(([cssProp, cssVal]) => `${cssProp}: ${cssVal}`)
+      .join("; ");
   },
 
   /**
    * Checks whether a CSS RGB color value can be classified as being 'bright'.
    *
    * @param  {String} cssColor RGB color value in the default format rgb[a](r,g,b)
    * @return {Boolean}
    */
   _isColorBright(cssColor) {
     cssColor = cssColor.match(kRGBRE);
-    if (!cssColor || !cssColor.length)
+    if (!cssColor || !cssColor.length) {
       return false;
+    }
     cssColor.shift();
-    return !(new Color(...cssColor)).useBrightText;
+    return !new Color(...cssColor).useBrightText;
   },
 
   /**
    * Detects if the overall text color in the page can be described as bright.
    * This is done according to the following algorithm:
    *  1. With the entire set of ranges that we have found thusfar;
    *  2. Get an odd-numbered `sampleSize`, with a maximum of `kBrightTextSampleSize`
    *     ranges,
@@ -749,17 +851,20 @@ FinderHighlighter.prototype = {
    *  5. When the majority of ranges are counted as contain bright colored text,
    *     the page is considered to contain bright text overall.
    *
    * @param {Object} dict Dictionary of properties belonging to the
    *                      currently active window. The page text color property
    *                      will be recorded in `dict.brightText` as `true` or `false`.
    */
   _detectBrightText(dict) {
-    let sampleSize = Math.min(dict.modalHighlightRectsMap.size, kBrightTextSampleSize);
+    let sampleSize = Math.min(
+      dict.modalHighlightRectsMap.size,
+      kBrightTextSampleSize
+    );
     let ranges = [...dict.modalHighlightRectsMap.keys()];
     let rangesCount = ranges.length;
     // Make sure the sample size is an odd number.
     if (sampleSize % 2 == 0) {
       // Make the previously or currently found range weigh heavier.
       if (dict.previousFoundRange || dict.currentFoundRange) {
         ranges.push(dict.previousFoundRange || dict.currentFoundRange);
         ++sampleSize;
@@ -767,53 +872,60 @@ FinderHighlighter.prototype = {
       } else {
         --sampleSize;
       }
     }
     let brightCount = 0;
     for (let i = 0; i < sampleSize; ++i) {
       let range = ranges[Math.floor((rangesCount / sampleSize) * i)];
       let fontStyle = this._getRangeFontStyle(range);
-      if (this._isColorBright(fontStyle.color))
+      if (this._isColorBright(fontStyle.color)) {
         ++brightCount;
+      }
     }
 
-    dict.brightText = (brightCount >= Math.ceil(sampleSize / 2));
+    dict.brightText = brightCount >= Math.ceil(sampleSize / 2);
   },
 
   /**
    * Checks if a range is inside a DOM node that's positioned in a way that it
    * doesn't scroll along when the document is scrolled and/ or zoomed. This
    * is the case for 'fixed' and 'sticky' positioned elements, elements inside
    * (i)frames and elements that have their overflow styles set to 'auto' or
    * 'scroll'.
    *
    * @param  {Range} range Range that be enclosed in a dynamic container
    * @return {Boolean}
    */
   _isInDynamicContainer(range) {
     const kFixed = new Set(["fixed", "sticky", "scroll", "auto"]);
     let node = range.startContainer;
-    while (node.nodeType != 1)
+    while (node.nodeType != 1) {
       node = node.parentNode;
+    }
     let document = node.ownerDocument;
     let window = document.defaultView;
     let dict = this.getForWindow(window.top);
 
     // Check if we're in a frameset (including iframes).
     if (window != window.top) {
-      if (!dict.frames.has(window))
+      if (!dict.frames.has(window)) {
         dict.frames.set(window, {});
+      }
       return true;
     }
 
     do {
       let style = window.getComputedStyle(node);
-      if (kFixed.has(style.position) || kFixed.has(style.overflow) ||
-          kFixed.has(style.overflowX) || kFixed.has(style.overflowY)) {
+      if (
+        kFixed.has(style.position) ||
+        kFixed.has(style.overflow) ||
+        kFixed.has(style.overflowX) ||
+        kFixed.has(style.overflowY)
+      ) {
         return true;
       }
       node = node.parentNode;
     } while (node && node != document.documentElement);
 
     return false;
   },
 
@@ -828,37 +940,39 @@ FinderHighlighter.prototype = {
    */
   _getRangeRectsAndTexts(range, dict = null) {
     let window = range.startContainer.ownerGlobal;
     let bounds;
     // If the window is part of a frameset, try to cache the bounds query.
     if (dict && dict.frames.has(window)) {
       let frameData = dict.frames.get(window);
       bounds = frameData.bounds;
-      if (!bounds)
+      if (!bounds) {
         bounds = frameData.bounds = this._getRootBounds(window);
+      }
     } else {
       bounds = this._getRootBounds(window);
     }
 
     let topBounds = this._getRootBounds(window.top, false);
     let rects = [];
     // A range may consist of multiple rectangles, we can also do these kind of
     // precise cut-outs. range.getBoundingClientRect() returns the fully
     // encompassing rectangle, which is too much for our purpose here.
-    let {rectList, textList} = range.getClientRectsAndTexts();
+    let { rectList, textList } = range.getClientRectsAndTexts();
     for (let rect of rectList) {
       rect = Rect.fromRect(rect);
       rect.x += bounds.x;
       rect.y += bounds.y;
       // If the rect is not even visible from the top document, we can ignore it.
-      if (rect.intersects(topBounds))
+      if (rect.intersects(topBounds)) {
         rects.push(rect);
+      }
     }
-    return {rectList: rects, textList};
+    return { rectList: rects, textList };
   },
 
   /**
    * Read and store the rectangles that encompass the entire region of a range
    * for use by the drawing function of the highlighter and store them in the
    * cache.
    *
    * @param  {Range}   range            Range to fetch the rectangles from
@@ -875,80 +989,94 @@ FinderHighlighter.prototype = {
     let rectsAndTexts = this._getRangeRectsAndTexts(range, dict);
 
     // Only fetch the rect at this point, if not passed in as argument.
     dict = dict || this.getForWindow(window.top);
     let oldRectsAndTexts = dict.modalHighlightRectsMap.get(range);
     dict.modalHighlightRectsMap.set(range, rectsAndTexts);
     // Check here if we suddenly went down to zero rects from more than zero before,
     // which indicates that we should re-iterate the document.
-    if (oldRectsAndTexts && oldRectsAndTexts.rectList.length && !rectsAndTexts.rectList.length)
+    if (
+      oldRectsAndTexts &&
+      oldRectsAndTexts.rectList.length &&
+      !rectsAndTexts.rectList.length
+    ) {
       dict.detectedGeometryChange = true;
-    if (checkIfDynamic && this._isInDynamicContainer(range))
+    }
+    if (checkIfDynamic && this._isInDynamicContainer(range)) {
       dict.dynamicRangesSet.add(range);
+    }
     return rectsAndTexts;
   },
 
   /**
    * Re-read the rectangles of the ranges that we keep track of separately,
    * because they're enclosed by a position: fixed container DOM node or (i)frame.
    *
    * @param {Object} dict Dictionary of properties belonging to the currently
    *                      active window
    */
   _updateDynamicRangesRects(dict) {
     // Reset the frame bounds cache.
-    for (let frameData of dict.frames.values())
+    for (let frameData of dict.frames.values()) {
       frameData.bounds = null;
-    for (let range of dict.dynamicRangesSet)
+    }
+    for (let range of dict.dynamicRangesSet) {
       this._updateRangeRects(range, false, dict);
+    }
   },
 
   /**
    * Update the content, position and style of the yellow current found range
    * outline that floats atop the mask with the dimmed background.
    * Rebuild it, if necessary, This will deactivate the animation between
    * occurrences.
    *
    * @param {Object} dict Dictionary of properties belonging to the currently
    *                      active window
    */
   _updateRangeOutline(dict) {
     let range = dict.currentFoundRange;
-    if (!range)
+    if (!range) {
       return;
+    }
 
     let fontStyle = this._getRangeFontStyle(range);
     // Text color in the outline is determined by kModalStyles.
     delete fontStyle.color;
 
     let rectsAndTexts = this._updateRangeRects(range, true, dict);
     let outlineAnonNode = dict.modalHighlightOutline;
     let rectCount = rectsAndTexts.rectList.length;
     let previousRectCount = dict.previousRangeRectsAndTexts.rectList.length;
     // (re-)Building the outline is conditional and happens when one of the
     // following conditions is met:
     // 1. No outline nodes were built before, or
     // 2. When the amount of rectangles to draw is different from before, or
     // 3. When there's more than one rectangle to draw, because it's impossible
     //    to animate that consistently with AnonymousContent nodes.
-    let rebuildOutline = (!outlineAnonNode || rectCount !== previousRectCount ||
-      rectCount != 1);
+    let rebuildOutline =
+      !outlineAnonNode || rectCount !== previousRectCount || rectCount != 1;
     dict.previousRangeRectsAndTexts = rectsAndTexts;
 
     let window = range.startContainer.ownerGlobal.top;
     let document = window.document;
     // First see if we need to and can remove the previous outline nodes.
-    if (rebuildOutline)
+    if (rebuildOutline) {
       this._removeRangeOutline(window);
+    }
 
     // Abort when there's no text to highlight OR when it's the exact same range
     // as the previous call and isn't inside a dynamic container.
-    if (!rectsAndTexts.textList.length ||
-        (!rebuildOutline && dict.previousUpdatedRange == range && !dict.dynamicRangesSet.has(range))) {
+    if (
+      !rectsAndTexts.textList.length ||
+      (!rebuildOutline &&
+        dict.previousUpdatedRange == range &&
+        !dict.dynamicRangesSet.has(range))
+    ) {
       return;
     }
 
     let outlineBox;
     if (rebuildOutline) {
       // Create the main (yellow) highlight outline box.
       outlineBox = document.createElementNS(kNSHTML, "div");
       outlineBox.setAttribute("id", kModalOutlineId);
@@ -963,112 +1091,149 @@ FinderHighlighter.prototype = {
       // rects that we drew before or will draw after this one.
       // We're taking the width of the border into account, which is
       // `kOutlineBoxBorderSize` pixels.
       // When left and/ or right sides will overlap with the current, previous
       // or next rect, make sure to make the necessary adjustments to the style.
       // These adjustments will override the styles as defined in `kModalStyles.outlineNode`.
       let intersectingSides = new Set();
       let previous = rectsAndTexts.rectList[i - 1];
-      if (previous &&
-          rect.left - previous.right <= 2 * kOutlineBoxBorderSize) {
+      if (previous && rect.left - previous.right <= 2 * kOutlineBoxBorderSize) {
         intersectingSides.add("left");
       }
       let next = rectsAndTexts.rectList[i + 1];
-      if (next &&
-          next.left - rect.right <= 2 * kOutlineBoxBorderSize) {
+      if (next && next.left - rect.right <= 2 * kOutlineBoxBorderSize) {
         intersectingSides.add("right");
       }
-      let borderStyles = [...intersectingSides].map(side => [ "border-" + side, 0 ]);
+      let borderStyles = [...intersectingSides].map(side => [
+        "border-" + side,
+        0,
+      ]);
       if (intersectingSides.size) {
-        borderStyles.push([ "margin",  `-${kOutlineBoxBorderSize}px 0 0 ${
-          intersectingSides.has("left") ? 0 : -kOutlineBoxBorderSize}px !important`]);
-        borderStyles.push([ "border-radius",
-          (intersectingSides.has("left") ? 0 : kOutlineBoxBorderRadius) + "px " +
-          (intersectingSides.has("right") ? 0 : kOutlineBoxBorderRadius) + "px " +
-          (intersectingSides.has("right") ? 0 : kOutlineBoxBorderRadius) + "px " +
-          (intersectingSides.has("left") ? 0 : kOutlineBoxBorderRadius) + "px" ]);
+        borderStyles.push([
+          "margin",
+          `-${kOutlineBoxBorderSize}px 0 0 ${
+            intersectingSides.has("left") ? 0 : -kOutlineBoxBorderSize
+          }px !important`,
+        ]);
+        borderStyles.push([
+          "border-radius",
+          (intersectingSides.has("left") ? 0 : kOutlineBoxBorderRadius) +
+            "px " +
+            (intersectingSides.has("right") ? 0 : kOutlineBoxBorderRadius) +
+            "px " +
+            (intersectingSides.has("right") ? 0 : kOutlineBoxBorderRadius) +
+            "px " +
+            (intersectingSides.has("left") ? 0 : kOutlineBoxBorderRadius) +
+            "px",
+        ]);
       }
 
-      let outlineStyle = this._getStyleString(kModalStyles.outlineNode, [
-        ["top", rect.top + "px"],
-        ["left", rect.left + "px"],
-        ["height", rect.height + "px"],
-        ["width", rect.width + "px"],
-      ], borderStyles, kDebug ? kModalStyles.outlineNodeDebug : []);
+      let outlineStyle = this._getStyleString(
+        kModalStyles.outlineNode,
+        [
+          ["top", rect.top + "px"],
+          ["left", rect.left + "px"],
+          ["height", rect.height + "px"],
+          ["width", rect.width + "px"],
+        ],
+        borderStyles,
+        kDebug ? kModalStyles.outlineNodeDebug : []
+      );
       fontStyle.lineHeight = rect.height + "px";
-      let textStyle = this._getStyleString(kModalStyles.outlineText) + "; " +
+      let textStyle =
+        this._getStyleString(kModalStyles.outlineText) +
+        "; " +
         this._getHTMLFontStyle(fontStyle);
 
       if (rebuildOutline) {
-        let textBoxParent = outlineBox.appendChild(document.createElementNS(kNSHTML, "div"));
+        let textBoxParent = outlineBox.appendChild(
+          document.createElementNS(kNSHTML, "div")
+        );
         textBoxParent.setAttribute("id", kModalOutlineId + i);
         textBoxParent.setAttribute("style", outlineStyle);
 
         let textBox = document.createElementNS(kNSHTML, "span");
         textBox.setAttribute("id", kModalOutlineTextId + i);
         textBox.setAttribute("style", textStyle);
         textBox.textContent = text;
         textBoxParent.appendChild(textBox);
       } else {
         // Set the appropriate properties on the existing nodes, which will also
         // activate the transitions.
-        outlineAnonNode.setAttributeForElement(kModalOutlineId + i, "style", outlineStyle);
-        outlineAnonNode.setAttributeForElement(kModalOutlineTextId + i, "style", textStyle);
+        outlineAnonNode.setAttributeForElement(
+          kModalOutlineId + i,
+          "style",
+          outlineStyle
+        );
+        outlineAnonNode.setAttributeForElement(
+          kModalOutlineTextId + i,
+          "style",
+          textStyle
+        );
         outlineAnonNode.setTextContentForElement(kModalOutlineTextId + i, text);
       }
 
       ++i;
     }
 
     if (rebuildOutline) {
-      dict.modalHighlightOutline = kDebug ?
-        mockAnonymousContentNode((document.body ||
-          document.documentElement).appendChild(outlineBox)) :
-        document.insertAnonymousContent(outlineBox);
+      dict.modalHighlightOutline = kDebug
+        ? mockAnonymousContentNode(
+            (document.body || document.documentElement).appendChild(outlineBox)
+          )
+        : document.insertAnonymousContent(outlineBox);
     }
 
     if (dict.animateOutline && !this._isPageTooBig(dict)) {
       let animation;
       dict.animations = new Set();
       for (let i = rectsAndTexts.rectList.length - 1; i >= 0; --i) {
-        animation = dict.modalHighlightOutline.setAnimationForElement(kModalOutlineId + i,
-          Cu.cloneInto(kModalOutlineAnim.keyframes, window), kModalOutlineAnim.duration);
-        animation.onfinish = function() { dict.animations.delete(this); };
+        animation = dict.modalHighlightOutline.setAnimationForElement(
+          kModalOutlineId + i,
+          Cu.cloneInto(kModalOutlineAnim.keyframes, window),
+          kModalOutlineAnim.duration
+        );
+        animation.onfinish = function() {
+          dict.animations.delete(this);
+        };
         dict.animations.add(animation);
       }
     }
     dict.animateOutline = false;
     dict.ignoreNextContentChange = true;
 
     dict.previousUpdatedRange = range;
   },
 
   /**
    * Finish any currently playing animations on the found range outline node.
    *
    * @param {Object} dict Dictionary of properties belonging to the currently
    *                      active window
    */
   _finishOutlineAnimations(dict) {
-    if (!dict.animations)
+    if (!dict.animations) {
       return;
-    for (let animation of dict.animations)
+    }
+    for (let animation of dict.animations) {
       animation.finish();
+    }
   },
 
   /**
    * Safely remove the outline AnoymousContent node from the CanvasFrame.
    *
    * @param {nsIDOMWindow} window
    */
   _removeRangeOutline(window) {
     let dict = this.getForWindow(window);
-    if (!dict.modalHighlightOutline)
+    if (!dict.modalHighlightOutline) {
       return;
+    }
 
     if (kDebug) {
       dict.modalHighlightOutline.remove();
     } else {
       try {
         window.document.removeAnonymousContent(dict.modalHighlightOutline);
       } catch (ex) {}
     }
@@ -1139,58 +1304,75 @@ FinderHighlighter.prototype = {
     window = window.top;
     let dict = this.getForWindow(window);
 
     const kMaskId = kModalIdPrefix + "-findbar-modalHighlight-outlineMask";
     if (!dict.modalHighlightAllMask) {
       let document = window.document;
       let maskNode = document.createElementNS(kNSHTML, "div");
       maskNode.setAttribute("id", kMaskId);
-      dict.modalHighlightAllMask = kDebug ?
-        mockAnonymousContentNode((document.body || document.documentElement).appendChild(maskNode)) :
-        document.insertAnonymousContent(maskNode);
+      dict.modalHighlightAllMask = kDebug
+        ? mockAnonymousContentNode(
+            (document.body || document.documentElement).appendChild(maskNode)
+          )
+        : document.insertAnonymousContent(maskNode);
     }
 
     // Make sure the dimmed mask node takes the full width and height that's available.
-    let {width, height} = dict.lastWindowDimensions = this._getWindowDimensions(window);
-    if (typeof dict.brightText != "boolean" || dict.updateAllRanges)
+    let {
+      width,
+      height,
+    } = (dict.lastWindowDimensions = this._getWindowDimensions(window));
+    if (typeof dict.brightText != "boolean" || dict.updateAllRanges) {
       this._detectBrightText(dict);
-    let maskStyle = this._getStyleString(kModalStyles.maskNode,
-      [ ["width", width + "px"], ["height", height + "px"] ],
+    }
+    let maskStyle = this._getStyleString(
+      kModalStyles.maskNode,
+      [["width", width + "px"], ["height", height + "px"]],
       dict.brightText ? kModalStyles.maskNodeBrightText : [],
       paintContent ? kModalStyles.maskNodeTransition : [],
-      kDebug ? kModalStyles.maskNodeDebug : []);
-    dict.modalHighlightAllMask.setAttributeForElement(kMaskId, "style", maskStyle);
+      kDebug ? kModalStyles.maskNodeDebug : []
+    );
+    dict.modalHighlightAllMask.setAttributeForElement(
+      kMaskId,
+      "style",
+      maskStyle
+    );
 
     this._updateRangeOutline(dict);
 
     let allRects = [];
     // When the user's busy scrolling the document, don't bother cutting out rectangles,
     // because they're not going to keep up with scrolling speed anyway.
     if (!dict.busyScrolling && (paintContent || dict.modalHighlightAllMask)) {
       // No need to update dynamic ranges separately when we already about to
       // update all of them anyway.
-      if (!dict.updateAllRanges)
+      if (!dict.updateAllRanges) {
         this._updateDynamicRangesRects(dict);
+      }
 
       let DOMRect = window.DOMRect;
       for (let [range, rectsAndTexts] of dict.modalHighlightRectsMap) {
-        if (!this.finder._fastFind.isRangeVisible(range, false))
+        if (!this.finder._fastFind.isRangeVisible(range, false)) {
           continue;
+        }
 
-        if (dict.updateAllRanges)
+        if (dict.updateAllRanges) {
           rectsAndTexts = this._updateRangeRects(range);
+        }
 
         // If a geometry change was detected, we bail out right away here, because
         // the current set of ranges has been invalidated.
-        if (dict.detectedGeometryChange)
+        if (dict.detectedGeometryChange) {
           return;
+        }
 
-        for (let rect of rectsAndTexts.rectList)
+        for (let rect of rectsAndTexts.rectList) {
           allRects.push(new DOMRect(rect.x, rect.y, rect.width, rect.height));
+        }
       }
       dict.updateAllRanges = false;
     }
 
     // We may also want to cut out zero rects, which effectively clears out the mask.
     dict.modalHighlightAllMask.setCutoutRectsForElement(kMaskId, allRects);
 
     // The reflow observer may ignore the reflow we cause ourselves here.
@@ -1200,18 +1382,19 @@ FinderHighlighter.prototype = {
   /**
    * Safely remove the mask AnoymousContent node from the CanvasFrame.
    *
    * @param {nsIDOMWindow} window
    */
   _removeHighlightAllMask(window) {
     window = window.top;
     let dict = this.getForWindow(window);
-    if (!dict.modalHighlightAllMask)
+    if (!dict.modalHighlightAllMask) {
       return;
+    }
 
     // If the current window isn't the one the content was inserted into, this
     // will fail, but that's fine.
     if (kDebug) {
       dict.modalHighlightAllMask.remove();
     } else {
       try {
         window.document.removeAnonymousContent(dict.modalHighlightAllMask);
@@ -1225,17 +1408,17 @@ FinderHighlighter.prototype = {
    * for certain operations. This allows us to degrade gracefully when we expect
    * the performance to be negatively impacted due to drawing-intensive operations.
    *
    * @param  {Object} dict Dictionary of properties belonging to the currently
    *                       active window
    * @return {Boolean}
    */
   _isPageTooBig(dict) {
-    let {height, width} = dict.lastWindowDimensions;
+    let { height, width } = dict.lastWindowDimensions;
     return height >= kPageIsTooBigPx || width >= kPageIsTooBigPx;
   },
 
   /**
    * Doing a full repaint each time a range is delivered by the highlight iterator
    * is way too costly, thus we pipe the frequency down to every
    * `kModalHighlightRepaintLoFreqMs` milliseconds. If there are dynamic ranges
    * found (see `_isInDynamicContainer()` for the definition), the frequency
@@ -1248,34 +1431,40 @@ FinderHighlighter.prototype = {
    *                             meantime. This happens when the DOM is updated
    *                             whilst the page is loaded.
    *   {Boolean} scrollOnly      TRUE when the page has scrolled in the meantime,
    *                             which means that the dynamically positioned
    *                             elements need to be repainted.
    *   {Boolean} updateAllRanges Whether to recalculate the rects of all ranges
    *                             that were found up until now.
    */
-  _scheduleRepaintOfMask(window, { contentChanged = false, scrollOnly = false, updateAllRanges = false } = {}) {
-    if (!this._modal)
+  _scheduleRepaintOfMask(
+    window,
+    { contentChanged = false, scrollOnly = false, updateAllRanges = false } = {}
+  ) {
+    if (!this._modal) {
       return;
+    }
 
     window = window.top;
     let dict = this.getForWindow(window);
     // Bail out early if the repaint scheduler is paused or when we're supposed
     // to ignore the next paint (i.e. content change).
-    if ((dict.repaintSchedulerState == kRepaintSchedulerPaused) ||
-        (contentChanged && dict.ignoreNextContentChange)) {
+    if (
+      dict.repaintSchedulerState == kRepaintSchedulerPaused ||
+      (contentChanged && dict.ignoreNextContentChange)
+    ) {
       dict.ignoreNextContentChange = false;
       return;
     }
 
     let hasDynamicRanges = !!dict.dynamicRangesSet.size;
     let pageIsTooBig = this._isPageTooBig(dict);
-    let repaintDynamicRanges = ((scrollOnly || contentChanged) && hasDynamicRanges
-      && !pageIsTooBig);
+    let repaintDynamicRanges =
+      (scrollOnly || contentChanged) && hasDynamicRanges && !pageIsTooBig;
 
     // Determine scroll behavior and keep that state around.
     let startedScrolling = !dict.busyScrolling && scrollOnly;
     // When the user started scrolling the document, hide the other highlights.
     if (startedScrolling) {
       dict.busyScrolling = startedScrolling;
       this._repaintHighlightAllMask(window);
     }
@@ -1290,127 +1479,163 @@ FinderHighlighter.prototype = {
       if (dict.modalRepaintScheduler) {
         window.clearTimeout(dict.modalRepaintScheduler);
         dict.modalRepaintScheduler = null;
       }
     }
 
     // When we request to repaint unconditionally, we mean to call
     // `_repaintHighlightAllMask()` right after the timeout.
-    if (!dict.unconditionalRepaintRequested)
-      dict.unconditionalRepaintRequested = !contentChanged || repaintDynamicRanges;
+    if (!dict.unconditionalRepaintRequested) {
+      dict.unconditionalRepaintRequested =
+        !contentChanged || repaintDynamicRanges;
+    }
     // Some events, like a resize, call for recalculation of all the rects of all ranges.
-    if (!dict.updateAllRanges)
+    if (!dict.updateAllRanges) {
       dict.updateAllRanges = updateAllRanges;
+    }
 
-    if (dict.modalRepaintScheduler)
+    if (dict.modalRepaintScheduler) {
       return;
+    }
 
-    let timeoutMs = hasDynamicRanges && !dict.busyScrolling ?
-      kModalHighlightRepaintHiFreqMs : kModalHighlightRepaintLoFreqMs;
+    let timeoutMs =
+      hasDynamicRanges && !dict.busyScrolling
+        ? kModalHighlightRepaintHiFreqMs
+        : kModalHighlightRepaintLoFreqMs;
     dict.modalRepaintScheduler = window.setTimeout(() => {
       dict.modalRepaintScheduler = null;
       dict.repaintSchedulerState = kRepaintSchedulerStopped;
       dict.busyScrolling = false;
 
       let pageContentChanged = dict.detectedGeometryChange;
       if (!pageContentChanged && !pageIsTooBig) {
-        let { width: previousWidth, height: previousHeight } = dict.lastWindowDimensions;
-        let { width, height } = dict.lastWindowDimensions = this._getWindowDimensions(window);
-        pageContentChanged = dict.detectedGeometryChange ||
-                             (Math.abs(previousWidth - width) > kContentChangeThresholdPx ||
-                              Math.abs(previousHeight - height) > kContentChangeThresholdPx);
+        let {
+          width: previousWidth,
+          height: previousHeight,
+        } = dict.lastWindowDimensions;
+        let {
+          width,
+          height,
+        } = (dict.lastWindowDimensions = this._getWindowDimensions(window));
+        pageContentChanged =
+          dict.detectedGeometryChange ||
+          (Math.abs(previousWidth - width) > kContentChangeThresholdPx ||
+            Math.abs(previousHeight - height) > kContentChangeThresholdPx);
       }
       dict.detectedGeometryChange = false;
       // When the page has changed significantly enough in size, we'll restart
       // the iterator with the same parameters as before to find us new ranges.
-      if (pageContentChanged && !pageIsTooBig)
+      if (pageContentChanged && !pageIsTooBig) {
         this.iterator.restart(this.finder);
+      }
 
-      if (dict.unconditionalRepaintRequested ||
-          (dict.modalHighlightRectsMap.size && pageContentChanged)) {
+      if (
+        dict.unconditionalRepaintRequested ||
+        (dict.modalHighlightRectsMap.size && pageContentChanged)
+      ) {
         dict.unconditionalRepaintRequested = false;
         this._repaintHighlightAllMask(window);
       }
     }, timeoutMs);
     dict.repaintSchedulerState = kRepaintSchedulerRunning;
   },
 
   /**
    * Add event listeners to the content which will cause the modal highlight
    * AnonymousContent to be re-painted or hidden.
    *
    * @param {nsIDOMWindow} window
    */
   _addModalHighlightListeners(window) {
     window = window.top;
     let dict = this.getForWindow(window);
-    if (dict.highlightListeners)
+    if (dict.highlightListeners) {
       return;
+    }
 
     window = window.top;
     dict.highlightListeners = [
       this._scheduleRepaintOfMask.bind(this, window, { contentChanged: true }),
       this._scheduleRepaintOfMask.bind(this, window, { updateAllRanges: true }),
       this._scheduleRepaintOfMask.bind(this, window, { scrollOnly: true }),
       this.hide.bind(this, window, null),
-      () => dict.busySelecting = true,
+      () => (dict.busySelecting = true),
       () => {
         if (window.document.hidden) {
           dict.repaintSchedulerState = kRepaintSchedulerPaused;
         } else if (dict.repaintSchedulerState == kRepaintSchedulerPaused) {
           dict.repaintSchedulerState = kRepaintSchedulerRunning;
           this._scheduleRepaintOfMask(window);
         }
       },
     ];
     let target = this.iterator._getDocShell(window).chromeEventHandler;
     target.addEventListener("MozAfterPaint", dict.highlightListeners[0]);
     target.addEventListener("resize", dict.highlightListeners[1]);
-    target.addEventListener("scroll", dict.highlightListeners[2], { capture: true, passive: true });
+    target.addEventListener("scroll", dict.highlightListeners[2], {
+      capture: true,
+      passive: true,
+    });
     target.addEventListener("click", dict.highlightListeners[3]);
     target.addEventListener("selectstart", dict.highlightListeners[4]);
-    window.document.addEventListener("visibilitychange", dict.highlightListeners[5]);
+    window.document.addEventListener(
+      "visibilitychange",
+      dict.highlightListeners[5]
+    );
   },
 
   /**
    * Remove event listeners from content.
    *
    * @param {nsIDOMWindow} window
    */
   _removeModalHighlightListeners(window) {
     window = window.top;
     let dict = this.getForWindow(window);
-    if (!dict.highlightListeners)
+    if (!dict.highlightListeners) {
       return;
+    }
 
     let target = this.iterator._getDocShell(window).chromeEventHandler;
     target.removeEventListener("MozAfterPaint", dict.highlightListeners[0]);
     target.removeEventListener("resize", dict.highlightListeners[1]);
-    target.removeEventListener("scroll", dict.highlightListeners[2], { capture: true, passive: true });
+    target.removeEventListener("scroll", dict.highlightListeners[2], {
+      capture: true,
+      passive: true,
+    });
     target.removeEventListener("click", dict.highlightListeners[3]);
     target.removeEventListener("selectstart", dict.highlightListeners[4]);
-    window.document.removeEventListener("visibilitychange", dict.highlightListeners[5]);
+    window.document.removeEventListener(
+      "visibilitychange",
+      dict.highlightListeners[5]
+    );
 
     dict.highlightListeners = null;
   },
 
   /**
    * For a given node returns its editable parent or null if there is none.
    * It's enough to check if node is a text node and its parent's parent is
    * an input or textarea.
    *
    * @param node the node we want to check
    * @returns the first node in the parent chain that is editable,
    *          null if there is no such node
    */
   _getEditableNode(node) {
-    if (node.nodeType === node.TEXT_NODE && node.parentNode && node.parentNode.parentNode &&
-        (ChromeUtils.getClassName(node.parentNode.parentNode) === "HTMLInputElement" ||
-         ChromeUtils.getClassName(node.parentNode.parentNode) === "HTMLTextAreaElement")) {
+    if (
+      node.nodeType === node.TEXT_NODE &&
+      node.parentNode &&
+      node.parentNode.parentNode &&
+      (ChromeUtils.getClassName(node.parentNode.parentNode) ===
+        "HTMLInputElement" ||
+        ChromeUtils.getClassName(node.parentNode.parentNode) ===
+          "HTMLTextAreaElement")
+    ) {
       return node.parentNode.parentNode;
     }
     return null;
   },
 
   /**
    * Add ourselves as an nsIEditActionListener and nsIDocumentStateListener for
    * a given editor
@@ -1437,18 +1662,17 @@ FinderHighlighter.prototype = {
    * Helper method to unhook listeners, remove cached editors
    * and keep the relevant arrays in sync
    *
    * @param idx the index into the array of editors/state listeners
    *        we wish to remove
    */
   _unhookListenersAtIndex(idx) {
     this._editors[idx].removeEditActionListener(this);
-    this._editors[idx]
-        .removeDocumentStateListener(this._stateListeners[idx]);
+    this._editors[idx].removeDocumentStateListener(this._stateListeners[idx]);
     this._editors.splice(idx, 1);
     this._stateListeners.splice(idx, 1);
     if (!this._editors.length) {
       delete this._editors;
       delete this._stateListeners;
     }
   },
 
@@ -1483,35 +1707,53 @@ FinderHighlighter.prototype = {
    * Helper method used to check whether a selection intersects with
    * some highlighting
    *
    * @param selectionRange the range from the selection to check
    * @param findRange the highlighted range to check against
    * @returns true if they intersect, false otherwise
    */
   _checkOverlap(selectionRange, findRange) {
-    if (!selectionRange || !findRange)
+    if (!selectionRange || !findRange) {
       return false;
+    }
     // The ranges overlap if one of the following is true:
     // 1) At least one of the endpoints of the deleted selection
     //    is in the find selection
     // 2) At least one of the endpoints of the find selection
     //    is in the deleted selection
-    if (findRange.isPointInRange(selectionRange.startContainer,
-                                 selectionRange.startOffset))
+    if (
+      findRange.isPointInRange(
+        selectionRange.startContainer,
+        selectionRange.startOffset
+      )
+    ) {
       return true;
-    if (findRange.isPointInRange(selectionRange.endContainer,
-                                 selectionRange.endOffset))
+    }
+    if (
+      findRange.isPointInRange(
+        selectionRange.endContainer,
+        selectionRange.endOffset
+      )
+    ) {
       return true;
-    if (selectionRange.isPointInRange(findRange.startContainer,
-                                      findRange.startOffset))
+    }
+    if (
+      selectionRange.isPointInRange(
+        findRange.startContainer,
+        findRange.startOffset
+      )
+    ) {
       return true;
-    if (selectionRange.isPointInRange(findRange.endContainer,
-                                      findRange.endOffset))
+    }
+    if (
+      selectionRange.isPointInRange(findRange.endContainer, findRange.endOffset)
+    ) {
       return true;
+    }
 
     return false;
   },
 
   /**
    * Helper method to determine if an edit occurred within a highlight
    *
    * @param selection the selection we wish to check
@@ -1543,65 +1785,70 @@ FinderHighlighter.prototype = {
     return null;
   },
 
   // Start of nsIEditActionListener implementations
 
   WillDeleteText(textNode, offset, length) {
     let editor = this._getEditableNode(textNode).editor;
     let controller = editor.selectionController;
-    let fSelection = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
+    let fSelection = controller.getSelection(
+      Ci.nsISelectionController.SELECTION_FIND
+    );
     let range = this._findRange(fSelection, textNode, offset);
 
     if (range) {
       // Don't remove the highlighting if the deleted text is at the
       // end of the range
-      if (textNode != range.endContainer ||
-          offset != range.endOffset) {
+      if (textNode != range.endContainer || offset != range.endOffset) {
         // Text within the highlight is being removed - the text can
         // no longer be a match, so remove the highlighting
         fSelection.removeRange(range);
         if (fSelection.rangeCount == 0) {
           this._removeEditorListeners(editor);
         }
       }
     }
   },
 
   DidInsertText(textNode, offset, aString) {
     let editor = this._getEditableNode(textNode).editor;
     let controller = editor.selectionController;
-    let fSelection = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
+    let fSelection = controller.getSelection(
+      Ci.nsISelectionController.SELECTION_FIND
+    );
     let range = this._findRange(fSelection, textNode, offset);
 
     if (range) {
       // If the text was inserted before the highlight
       // adjust the highlight's bounds accordingly
-      if (textNode == range.startContainer &&
-          offset == range.startOffset) {
-        range.setStart(range.startContainer,
-                       range.startOffset + aString.length);
-      } else if (textNode != range.endContainer ||
-                 offset != range.endOffset) {
+      if (textNode == range.startContainer && offset == range.startOffset) {
+        range.setStart(
+          range.startContainer,
+          range.startOffset + aString.length
+        );
+      } else if (textNode != range.endContainer || offset != range.endOffset) {
         // The edit occurred within the highlight - any addition of text
         // will result in the text no longer being a match,
         // so remove the highlighting
         fSelection.removeRange(range);
         if (fSelection.rangeCount == 0) {
           this._removeEditorListeners(editor);
         }
       }
     }
   },
 
   WillDeleteSelection(selection) {
-    let editor = this._getEditableNode(selection.getRangeAt(0)
-                                                 .startContainer).editor;
+    let editor = this._getEditableNode(selection.getRangeAt(0).startContainer)
+      .editor;
     let controller = editor.selectionController;
-    let fSelection = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
+    let fSelection = controller.getSelection(
+      Ci.nsISelectionController.SELECTION_FIND
+    );
 
     let shouldDelete = {};
     let numberOfDeletedSelections = 0;
     let numberOfMatches = fSelection.rangeCount;
 
     // We need to test if any ranges in the deleted selection (selection)
     // are in any of the ranges of the find selection
     // Usually both selections will only contain one range, however
@@ -1627,18 +1874,19 @@ FinderHighlighter.prototype = {
 
     // OK, so now we know what matches (if any) are in the selection
     // that is being deleted. Time to remove them.
     if (!numberOfDeletedSelections) {
       return;
     }
 
     for (let i = numberOfMatches - 1; i >= 0; i--) {
-      if (shouldDelete[i])
+      if (shouldDelete[i]) {
         fSelection.removeRange(fSelection.getRangeAt(i));
+      }
     }
 
     // Remove listeners if no more highlights left
     if (!fSelection.rangeCount) {
       this._removeEditorListeners(editor);
     }
   },
 
--- a/toolkit/modules/FinderIterator.jsm
+++ b/toolkit/modules/FinderIterator.jsm
@@ -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";
 
 var EXPORTED_SYMBOLS = ["FinderIterator"];
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {clearTimeout, setTimeout} = ChromeUtils.import("resource://gre/modules/Timer.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { clearTimeout, setTimeout } = ChromeUtils.import(
+  "resource://gre/modules/Timer.jsm"
+);
 
 ChromeUtils.defineModuleGetter(this, "NLP", "resource://gre/modules/NLP.jsm");
-ChromeUtils.defineModuleGetter(this, "Rect", "resource://gre/modules/Geometry.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Rect",
+  "resource://gre/modules/Geometry.jsm"
+);
 
 const kDebug = false;
 const kIterationSizeMax = 100;
 const kTimeoutPref = "findbar.iteratorTimeout";
 
 /**
  * FinderIterator singleton. See the documentation for the `start()` method to
  * learn more.
@@ -28,21 +34,24 @@ var FinderIterator = {
   _previousRanges: [],
   _spawnId: 0,
   _timeout: Services.prefs.getIntPref(kTimeoutPref),
   _timer: null,
   ranges: [],
   running: false,
 
   // Expose `kIterationSizeMax` to the outside world for unit tests to use.
-  get kIterationSizeMax() { return kIterationSizeMax; },
+  get kIterationSizeMax() {
+    return kIterationSizeMax;
+  },
 
   get params() {
-    if (!this._currentParams && !this._previousParams)
+    if (!this._currentParams && !this._previousParams) {
       return null;
+    }
     return Object.assign({}, this._currentParams || this._previousParams);
   },
 
   /**
    * Start iterating the active Finder docShell, using the options below. When
    * it already started at the request of another consumer, we first yield the
    * results we already collected before continuing onward to yield fresh results.
    * We make sure to pause every `kIterationSizeMax` iterations to make sure we
@@ -76,67 +85,99 @@ var FinderIterator = {
    *                                           - onIteratorRestart({Object} iterParams);
    *                                           - onIteratorStart({Object} iterParams);
    * @param {Boolean} [options.useCache]        Whether to allow results already
    *                                            present in the cache or demand fresh.
    *                                            Optional, defaults to `false`.
    * @param {String}  options.word              Word to search for
    * @return {Promise}
    */
-  start({ allowDistance, caseSensitive, entireWord, finder, limit, linksOnly, listener, useCache, word }) {
+  start({
+    allowDistance,
+    caseSensitive,
+    entireWord,
+    finder,
+    limit,
+    linksOnly,
+    listener,
+    useCache,
+    word,
+  }) {
     // Take care of default values for non-required options.
-    if (typeof allowDistance != "number")
+    if (typeof allowDistance != "number") {
       allowDistance = 0;
-    if (typeof limit != "number")
+    }
+    if (typeof limit != "number") {
       limit = -1;
-    if (typeof linksOnly != "boolean")
+    }
+    if (typeof linksOnly != "boolean") {
       linksOnly = false;
-    if (typeof useCache != "boolean")
+    }
+    if (typeof useCache != "boolean") {
       useCache = false;
+    }
 
     // Validate the options.
-    if (typeof caseSensitive != "boolean")
+    if (typeof caseSensitive != "boolean") {
       throw new Error("Missing required option 'caseSensitive'");
-    if (typeof entireWord != "boolean")
+    }
+    if (typeof entireWord != "boolean") {
       throw new Error("Missing required option 'entireWord'");
-    if (!finder)
+    }
+    if (!finder) {
       throw new Error("Missing required option 'finder'");
-    if (!word)
+    }
+    if (!word) {
       throw new Error("Missing required option 'word'");
-    if (typeof listener != "object" || !listener.onIteratorRangeFound)
+    }
+    if (typeof listener != "object" || !listener.onIteratorRangeFound) {
       throw new TypeError("Missing valid, required option 'listener'");
+    }
 
     // If the listener was added before, make sure the promise is resolved before
     // we replace it with another.
     if (this._listeners.has(listener)) {
       let { onEnd } = this._listeners.get(listener);
-      if (onEnd)
+      if (onEnd) {
         onEnd();
+      }
     }
 
     let window = finder._getWindow();
     let resolver;
-    let promise = new Promise(resolve => resolver = resolve);
-    let iterParams = { caseSensitive, entireWord, linksOnly, useCache, window, word };
+    let promise = new Promise(resolve => (resolver = resolve));
+    let iterParams = {
+      caseSensitive,
+      entireWord,
+      linksOnly,
+      useCache,
+      window,
+      word,
+    };
 
     this._listeners.set(listener, { limit, onEnd: resolver });
 
     // If we're not running anymore and we're requesting the previous result, use it.
     if (!this.running && this._previousResultAvailable(iterParams)) {
       this._yieldPreviousResult(listener, window);
       return promise;
     }
 
     if (this.running) {
       // Double-check if we're not running the iterator with a different set of
       // parameters, otherwise report an error with the most common reason.
-      if (!this._areParamsEqual(this._currentParams, iterParams, allowDistance)) {
+      if (
+        !this._areParamsEqual(this._currentParams, iterParams, allowDistance)
+      ) {
         if (kDebug) {
-          Cu.reportError(`We're currently iterating over '${this._currentParams.word}', not '${word}'\n` +
-            new Error().stack);
+          Cu.reportError(
+            `We're currently iterating over '${
+              this._currentParams.word
+            }', not '${word}'\n` + new Error().stack
+          );
         }
         this._listeners.delete(listener);
         resolver();
         return promise;
       }
 
       // if we're still running, yield the set we have built up this far.
       this._yieldIntermediateResult(listener, window);
@@ -155,18 +196,19 @@ var FinderIterator = {
   /**
    * Stop the currently running iterator as soon as possible and optionally cache
    * the result for later.
    *
    * @param {Boolean} [cachePrevious] Whether to save the result for later.
    *                                  Optional.
    */
   stop(cachePrevious = false) {
-    if (!this.running)
+    if (!this.running) {
       return;
+    }
 
     if (this._timer) {
       clearTimeout(this._timer);
       this._timer = null;
     }
     if (this._runningFindResolver) {
       this._runningFindResolver();
       this._runningFindResolver = null;
@@ -180,31 +222,33 @@ var FinderIterator = {
       this._previousParams = null;
     }
 
     this._catchingUp.clear();
     this._currentParams = null;
     this.ranges = [];
     this.running = false;
 
-    for (let [, { onEnd }] of this._listeners)
+    for (let [, { onEnd }] of this._listeners) {
       onEnd();
+    }
   },
 
   /**
    * Stops the iteration that currently running, if it is, and start a new one
    * with the exact same params as before.
    *
    * @param {Finder} finder Currently active Finder instance
    */
   restart(finder) {
     // Capture current iterator params before we stop the show.
     let iterParams = this.params;
-    if (!iterParams)
+    if (!iterParams) {
       return;
+    }
     this.stop();
 
     // Restart manually.
     this.running = true;
     this._currentParams = iterParams;
 
     this._findAllRanges(finder, ++this._spawnId);
     this._notifyListeners("restart", iterParams);
@@ -228,18 +272,19 @@ var FinderIterator = {
 
     this._catchingUp.clear();
     this._currentParams = this._previousParams = null;
     this._previousRanges = [];
     this.ranges = [];
     this.running = false;
 
     this._notifyListeners("reset");
-    for (let [, { onEnd }] of this._listeners)
+    for (let [, { onEnd }] of this._listeners) {
       onEnd();
+    }
     this._listeners.clear();
   },
 
   /**
    * Check if the currently running iterator parameters are the same as the ones
    * passed through the arguments. When `true`, we can keep it running as-is and
    * the consumer should stop the iterator when `false`.
    *
@@ -247,51 +292,56 @@ var FinderIterator = {
    *                                         mode
    * @param {Boolean}  options.entireWord    Whether to search in entire-word mode
    * @param  {Boolean} options.linksOnly     Whether to search for the word to be
    *                                         present in links only
    * @param  {String}  options.word          The word being searched for
    * @return {Boolean}
    */
   continueRunning({ caseSensitive, entireWord, linksOnly, word }) {
-    return (this.running &&
+    return (
+      this.running &&
       this._currentParams.caseSensitive === caseSensitive &&
       this._currentParams.entireWord === entireWord &&
       this._currentParams.linksOnly === linksOnly &&
-      this._currentParams.word == word);
+      this._currentParams.word == word
+    );
   },
 
   /**
    * The default mode of operation of the iterator is to not accept duplicate
    * listeners, resolve the promise of the older listeners and replace it with
    * the new listener.
    * Consumers may opt-out of this behavior by using this check and not call
    * start().
    *
    * @param  {Object} paramSet Property bag with the same signature as you would
    *                           pass into `start()`
    * @return {Boolean}
    */
   isAlreadyRunning(paramSet) {
-    return (this.running &&
+    return (
+      this.running &&
       this._areParamsEqual(this._currentParams, paramSet) &&
-      this._listeners.has(paramSet.listener));
+      this._listeners.has(paramSet.listener)
+    );
   },
 
   /**
    * Safely notify all registered listeners that an event has occurred.
    *
    * @param {String}   callback    Name of the callback to invoke
    * @param {mixed}    [params]    Optional argument that will be passed to the
    *                               callback
    * @param {Iterable} [listeners] Set of listeners to notify. Optional, defaults
    *                               to `this._listeners.keys()`.
    */
   _notifyListeners(callback, params, listeners = this._listeners.keys()) {
-    callback = "onIterator" + callback.charAt(0).toUpperCase() + callback.substr(1);
+    callback =
+      "onIterator" + callback.charAt(0).toUpperCase() + callback.substr(1);
     for (let listener of listeners) {
       try {
         listener[callback](params);
       } catch (ex) {
         Cu.reportError("FinderIterator Error: " + ex);
       }
     }
   },
@@ -305,39 +355,55 @@ var FinderIterator = {
    * @param  {Boolean} options.entireWord    Whether to search in entire-word mode
    * @param  {Boolean} options.linksOnly     Whether to search for the word to be
    *                                         present in links only
    * @param  {Boolean} options.useCache      Whether the consumer wants to use the
    *                                         cached previous result at all
    * @param  {String}  options.word          The word being searched for
    * @return {Boolean}
    */
-  _previousResultAvailable({ caseSensitive, entireWord, linksOnly, useCache, word }) {
-    return !!(useCache &&
-      this._areParamsEqual(this._previousParams, { caseSensitive, entireWord, linksOnly, word }) &&
-      this._previousRanges.length);
+  _previousResultAvailable({
+    caseSensitive,
+    entireWord,
+    linksOnly,
+    useCache,
+    word,
+  }) {
+    return !!(
+      useCache &&
+      this._areParamsEqual(this._previousParams, {
+        caseSensitive,
+        entireWord,
+        linksOnly,
+        word,
+      }) &&
+      this._previousRanges.length
+    );
   },
 
   /**
    * Internal; compare if two sets of iterator parameters are equivalent.
    *
    * @param  {Object} paramSet1       First set of params (left hand side)
    * @param  {Object} paramSet2       Second set of params (right hand side)
    * @param  {Number} [allowDistance] Allowed edit distance between the two words.
    *                                  Optional, defaults to '0', which means 'no
    *                                  distance'.
    * @return {Boolean}
    */
   _areParamsEqual(paramSet1, paramSet2, allowDistance = 0) {
-    return (!!paramSet1 && !!paramSet2 &&
+    return (
+      !!paramSet1 &&
+      !!paramSet2 &&
       paramSet1.caseSensitive === paramSet2.caseSensitive &&
       paramSet1.entireWord === paramSet2.entireWord &&
       paramSet1.linksOnly === paramSet2.linksOnly &&
       paramSet1.window === paramSet2.window &&
-      NLP.levenshtein(paramSet1.word, paramSet2.word) <= allowDistance);
+      NLP.levenshtein(paramSet1.word, paramSet2.word) <= allowDistance
+    );
   },
 
   /**
    * Internal; iterate over a predefined set of ranges that have been collected
    * before.
    * Also here, we make sure to pause every `kIterationSizeMax` iterations to
    * make sure we don't block the host process too long. In the case of a break
    * like this, we yield `undefined`, instead of a range.
@@ -357,18 +423,19 @@ var FinderIterator = {
     let iterCount = 0;
     let { limit, onEnd } = this._listeners.get(listener);
     let ranges = rangeSource.slice(0, limit > -1 ? limit : undefined);
     for (let range of ranges) {
       try {
         range.startContainer;
       } catch (ex) {
         // Don't yield dead objects, so use the escape hatch.
-        if (ex.message.includes("dead object"))
+        if (ex.message.includes("dead object")) {
           return;
+        }
       }
 
       // Pass a flag that is `true` when we're returning the result from a
       // cached previous iteration.
       listener.onIteratorRangeFound(range, !this.running);
       await range;
 
       if (withPause && ++iterCount >= kIterationSizeMax) {
@@ -404,18 +471,19 @@ var FinderIterator = {
    * @yield {Range}
    */
   async _yieldPreviousResult(listener, window) {
     this._notifyListeners("start", this.params, [listener]);
     this._catchingUp.add(listener);
     await this._yieldResult(listener, this._previousRanges, window);
     this._catchingUp.delete(listener);
     let { onEnd } = this._listeners.get(listener);
-    if (onEnd)
+    if (onEnd) {
       onEnd();
+    }
   },
 
   /**
    * Internal; iterate over the set of already found ranges. Meanwhile it'll
    * mark the listener as 'catching up', meaning it will not receive fresh
    * results from the running iterator.
    *
    * @param {Object}       listener Listener object
@@ -436,64 +504,71 @@ var FinderIterator = {
    * @param {Finder}       finder  Currently active Finder instance
    * @param {Number}       spawnId Since `stop()` is synchronous and this method
    *                               is not, this identifier is used to learn if
    *                               it's supposed to still continue after a pause.
    * @yield {Range}
    */
   async _findAllRanges(finder, spawnId) {
     if (this._timeout) {
-      if (this._timer)
+      if (this._timer) {
         clearTimeout(this._timer);
-      if (this._runningFindResolver)
+      }
+      if (this._runningFindResolver) {
         this._runningFindResolver();
+      }
 
       let timeout = this._timeout;
       let searchTerm = this._currentParams.word;
       // Wait a little longer when the first or second character is typed into
       // the findbar.
-      if (searchTerm.length == 1)
+      if (searchTerm.length == 1) {
         timeout *= 4;
-      else if (searchTerm.length == 2)
+      } else if (searchTerm.length == 2) {
         timeout *= 2;
+      }
       await new Promise(resolve => {
         this._runningFindResolver = resolve;
         this._timer = setTimeout(resolve, timeout);
       });
       this._timer = this._runningFindResolver = null;
       // During the timeout, we could have gotten the signal to stop iterating.
       // Make sure we do here.
-      if (!this.running || spawnId !== this._spawnId)
+      if (!this.running || spawnId !== this._spawnId) {
         return;
+      }
     }
 
     this._notifyListeners("start", this.params);
 
     let { linksOnly, window } = this._currentParams;
     // First we collect all frames we need to search through, whilst making sure
     // that the parent window gets dibs.
     let frames = [window].concat(this._collectFrames(window, finder));
     let iterCount = 0;
     for (let frame of frames) {
       for (let range of this._iterateDocument(this._currentParams, frame)) {
         // Between iterations, for example after a sleep of one cycle, we could
         // have gotten the signal to stop iterating. Make sure we do here.
-        if (!this.running || spawnId !== this._spawnId)
+        if (!this.running || spawnId !== this._spawnId) {
           return;
+        }
 
         // Deal with links-only mode here.
-        if (linksOnly && !this._rangeStartsInLink(range))
+        if (linksOnly && !this._rangeStartsInLink(range)) {
           continue;
+        }
 
         this.ranges.push(range);
 
         // Call each listener with the range we just found.
         for (let [listener, { limit, onEnd }] of this._listeners) {
-          if (this._catchingUp.has(listener))
+          if (this._catchingUp.has(listener)) {
             continue;
+          }
 
           listener.onIteratorRangeFound(range);
 
           if (limit !== -1 && --limit === 0) {
             // We've reached our limit; no need to do more work for this listener.
             this._listeners.delete(listener);
             onEnd();
             continue;
@@ -525,37 +600,38 @@ var FinderIterator = {
    * @param {Boolean}      options.caseSensitive Whether to search in case
    *                                             sensitive mode
    * @param {Boolean}      options.entireWord    Whether to search in entire-word
    *                                             mode
    * @param {String}       options.word          The word to search for
    * @param {nsIDOMWindow} window                The window to search in
    * @yield {Range}
    */
-  * _iterateDocument({ caseSensitive, entireWord, word }, window) {
+  *_iterateDocument({ caseSensitive, entireWord, word }, window) {
     let doc = window.document;
     let body = doc.body || doc.documentElement;
 
-    if (!body)
+    if (!body) {
       return;
+    }
 
     let searchRange = doc.createRange();
     searchRange.selectNodeContents(body);
 
     let startPt = searchRange.cloneRange();
     startPt.collapse(true);
 
     let endPt = searchRange.cloneRange();
     endPt.collapse(false);
 
     let retRange = null;
 
     let nsIFind = Cc["@mozilla.org/embedcomp/rangefind;1"]
-                    .createInstance()
-                    .QueryInterface(Ci.nsIFind);
+      .createInstance()
+      .QueryInterface(Ci.nsIFind);
     nsIFind.caseSensitive = caseSensitive;
     nsIFind.entireWord = entireWord;
 
     while ((retRange = nsIFind.Find(word, searchRange, startPt, endPt))) {
       yield retRange;
       startPt = retRange.cloneRange();
       startPt.collapse(false);
     }
@@ -566,29 +642,34 @@ var FinderIterator = {
    * visible (i)frames inside a window.
    *
    * @param  {nsIDOMWindow} window The window to extract the (i)frames from
    * @param  {Finder}       finder The Finder instance
    * @return {Array}        Stack of frames to iterate over
    */
   _collectFrames(window, finder) {
     let frames = [];
-    if (!("frames" in window) || !window.frames.length)
+    if (!("frames" in window) || !window.frames.length) {
       return frames;
+    }
 
     // Casting `window.frames` to an Iterator doesn't work, so we're stuck with
     // a plain, old for-loop.
     let dwu = window.windowUtils;
     for (let i = 0, l = window.frames.length; i < l; ++i) {
       let frame = window.frames[i];
       // Don't count matches in hidden frames; get the frame element rect and
       // check if it's empty. We shan't flush!
       let frameEl = frame && frame.frameElement;
-      if (!frameEl || Rect.fromRect(dwu.getBoundsWithoutFlushing(frameEl)).isEmpty())
+      if (
+        !frameEl ||
+        Rect.fromRect(dwu.getBoundsWithoutFlushing(frameEl)).isEmpty()
+      ) {
         continue;
+      }
       // All conditions pass, so push the current frame and its children on the
       // stack.
       frames.push(frame, ...this._collectFrames(frame, finder));
     }
 
     return frames;
   },
 
@@ -599,48 +680,53 @@ var FinderIterator = {
    * @param  {Range} windowOrRange Window object to query. May also be a
    *                               Range, from which the owner window will
    *                               be queried.
    * @return {nsIDocShell}
    */
   _getDocShell(windowOrRange) {
     let window = windowOrRange;
     // Ranges may also be passed in, so fetch its window.
-    if (ChromeUtils.getClassName(windowOrRange) === "Range")
+    if (ChromeUtils.getClassName(windowOrRange) === "Range") {
       window = windowOrRange.startContainer.ownerGlobal;
+    }
     return window.docShell;
   },
 
   /**
    * Internal; determines whether a range is inside a link.
    *
    * @param  {Range} range the range to check
    * @return {Boolean}     True if the range starts in a link
    */
   _rangeStartsInLink(range) {
     let isInsideLink = false;
     let node = range.startContainer;
 
     if (node.nodeType == node.ELEMENT_NODE) {
       if (node.hasChildNodes) {
         let childNode = node.item(range.startOffset);
-        if (childNode)
+        if (childNode) {
           node = childNode;
+        }
       }
     }
 
     const XLink_NS = "http://www.w3.org/1999/xlink";
-    const HTMLAnchorElement = (node.ownerDocument || node).defaultView.HTMLAnchorElement;
+    const HTMLAnchorElement = (node.ownerDocument || node).defaultView
+      .HTMLAnchorElement;
     do {
       if (node instanceof HTMLAnchorElement) {
         isInsideLink = node.hasAttribute("href");
         break;
-      } else if (typeof node.hasAttributeNS == "function" &&
-                 node.hasAttributeNS(XLink_NS, "href")) {
-        isInsideLink = (node.getAttributeNS(XLink_NS, "type") == "simple");
+      } else if (
+        typeof node.hasAttributeNS == "function" &&
+        node.hasAttributeNS(XLink_NS, "href")
+      ) {
+        isInsideLink = node.getAttributeNS(XLink_NS, "type") == "simple";
         break;
       }
 
       node = node.parentNode;
     } while (node);
 
     return isInsideLink;
   },
--- a/toolkit/modules/FinderParent.jsm
+++ b/toolkit/modules/FinderParent.jsm
@@ -1,47 +1,62 @@
 // -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
 // vim: set ts=2 sw=2 sts=2 et 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/.
 
 var EXPORTED_SYMBOLS = ["FinderParent"];
 
-ChromeUtils.defineModuleGetter(this, "GetClipboardSearchString",
-                               "resource://gre/modules/Finder.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "GetClipboardSearchString",
+  "resource://gre/modules/Finder.jsm"
+);
 
-ChromeUtils.defineModuleGetter(this, "Rect",
-                               "resource://gre/modules/Geometry.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Rect",
+  "resource://gre/modules/Geometry.jsm"
+);
 
 function FinderParent(browser) {
   this._listeners = new Set();
   this._searchString = null;
 
   this.swapBrowser(browser);
 }
 
 FinderParent.prototype = {
   destroy() {},
 
   swapBrowser(aBrowser) {
     if (this._messageManager) {
       this._messageManager.removeMessageListener("Finder:Result", this);
       this._messageManager.removeMessageListener("Finder:MatchesResult", this);
-      this._messageManager.removeMessageListener("Finder:CurrentSelectionResult", this);
-      this._messageManager.removeMessageListener("Finder:HighlightFinished", this);
+      this._messageManager.removeMessageListener(
+        "Finder:CurrentSelectionResult",
+        this
+      );
+      this._messageManager.removeMessageListener(
+        "Finder:HighlightFinished",
+        this
+      );
     } else {
       aBrowser.messageManager.sendAsyncMessage("Finder:Initialize");
     }
 
     this._browser = aBrowser;
     this._messageManager = this._browser.messageManager;
     this._messageManager.addMessageListener("Finder:Result", this);
     this._messageManager.addMessageListener("Finder:MatchesResult", this);
-    this._messageManager.addMessageListener("Finder:CurrentSelectionResult", this);
+    this._messageManager.addMessageListener(
+      "Finder:CurrentSelectionResult",
+      this
+    );
     this._messageManager.addMessageListener("Finder:HighlightFinished", this);
 
     // Ideally listeners would have removed themselves but that doesn't happen
     // right now
     this._listeners.clear();
   },
 
   addResultListener(aListener) {
@@ -59,108 +74,121 @@ FinderParent.prototype = {
     switch (aMessage.name) {
       case "Finder:Result":
         this._searchString = aMessage.data.searchString;
         // The rect stops being a Geometry.jsm:Rect over IPC.
         if (aMessage.data.rect) {
           aMessage.data.rect = Rect.fromRect(aMessage.data.rect);
         }
         callback = "onFindResult";
-        params = [ aMessage.data ];
+        params = [aMessage.data];
         break;
       case "Finder:MatchesResult":
         callback = "onMatchesCountResult";
-        params = [ aMessage.data ];
+        params = [aMessage.data];
         break;
       case "Finder:CurrentSelectionResult":
         callback = "onCurrentSelection";
-        params = [ aMessage.data.selection, aMessage.data.initial ];
+        params = [aMessage.data.selection, aMessage.data.initial];
         break;
       case "Finder:HighlightFinished":
         callback = "onHighlightFinished";
-        params = [ aMessage.data ];
+        params = [aMessage.data];
         break;
     }
 
     for (let l of this._listeners) {
       // Don't let one callback throwing stop us calling the rest
       try {
         l[callback].apply(l, params);
       } catch (e) {
         if (!l[callback]) {
-          Cu.reportError(`Missing ${callback} callback on RemoteFinderListener`);
+          Cu.reportError(
+            `Missing ${callback} callback on RemoteFinderListener`
+          );
         } else {
           Cu.reportError(e);
         }
       }
     }
   },
 
   get searchString() {
     return this._searchString;
   },
 
   get clipboardSearchString() {
     return GetClipboardSearchString(this._browser.loadContext);
   },
 
   setSearchStringToSelection() {
-    this._browser.messageManager.sendAsyncMessage("Finder:SetSearchStringToSelection", {});
+    this._browser.messageManager.sendAsyncMessage(
+      "Finder:SetSearchStringToSelection",
+      {}
+    );
   },
 
   set caseSensitive(aSensitive) {
-    this._browser.messageManager.sendAsyncMessage("Finder:CaseSensitive",
-                                                  { caseSensitive: aSensitive });
+    this._browser.messageManager.sendAsyncMessage("Finder:CaseSensitive", {
+      caseSensitive: aSensitive,
+    });
   },
 
   set entireWord(aEntireWord) {
-    this._browser.messageManager.sendAsyncMessage("Finder:EntireWord",
-                                                  { entireWord: aEntireWord });
+    this._browser.messageManager.sendAsyncMessage("Finder:EntireWord", {
+      entireWord: aEntireWord,
+    });
   },
 
   getInitialSelection() {
-    this._browser.messageManager.sendAsyncMessage("Finder:GetInitialSelection", {});
+    this._browser.messageManager.sendAsyncMessage(
+      "Finder:GetInitialSelection",
+      {}
+    );
   },
 
   fastFind(aSearchString, aLinksOnly, aDrawOutline) {
-    this._browser.messageManager.sendAsyncMessage("Finder:FastFind",
-                                                  { searchString: aSearchString,
-                                                    linksOnly: aLinksOnly,
-                                                    drawOutline: aDrawOutline });
+    this._browser.messageManager.sendAsyncMessage("Finder:FastFind", {
+      searchString: aSearchString,
+      linksOnly: aLinksOnly,
+      drawOutline: aDrawOutline,
+    });
   },
 
   findAgain(aFindBackwards, aLinksOnly, aDrawOutline) {
-    this._browser.messageManager.sendAsyncMessage("Finder:FindAgain",
-                                                  { findBackwards: aFindBackwards,
-                                                    linksOnly: aLinksOnly,
-                                                    drawOutline: aDrawOutline });
+    this._browser.messageManager.sendAsyncMessage("Finder:FindAgain", {
+      findBackwards: aFindBackwards,
+      linksOnly: aLinksOnly,
+      drawOutline: aDrawOutline,
+    });
   },
 
   highlight(aHighlight, aWord, aLinksOnly) {
-    this._browser.messageManager.sendAsyncMessage("Finder:Highlight",
-                                                  { highlight: aHighlight,
-                                                    linksOnly: aLinksOnly,
-                                                    word: aWord });
+    this._browser.messageManager.sendAsyncMessage("Finder:Highlight", {
+      highlight: aHighlight,
+      linksOnly: aLinksOnly,
+      word: aWord,
+    });
   },
 
   enableSelection() {
     this._browser.messageManager.sendAsyncMessage("Finder:EnableSelection");
   },
 
   removeSelection() {
     this._browser.messageManager.sendAsyncMessage("Finder:RemoveSelection");
   },
 
   focusContent() {
     // Allow Finder listeners to cancel focusing the content.
     for (let l of this._listeners) {
       try {
-        if ("shouldFocusContent" in l &&
-            !l.shouldFocusContent())
+        if ("shouldFocusContent" in l && !l.shouldFocusContent()) {
           return;
+        }
       } catch (ex) {
         Cu.reportError(ex);
       }
     }
 
     this._browser.focus();
     this._browser.messageManager.sendAsyncMessage("Finder:FocusContent");
   },
@@ -169,34 +197,39 @@ FinderParent.prototype = {
     this._browser.messageManager.sendAsyncMessage("Finder:FindbarClose");
   },
 
   onFindbarOpen() {
     this._browser.messageManager.sendAsyncMessage("Finder:FindbarOpen");
   },
 
   onModalHighlightChange(aUseModalHighlight) {
-    this._browser.messageManager.sendAsyncMessage("Finder:ModalHighlightChange", {
-      useModalHighlight: aUseModalHighlight,
-    });
+    this._browser.messageManager.sendAsyncMessage(
+      "Finder:ModalHighlightChange",
+      {
+        useModalHighlight: aUseModalHighlight,
+      }
+    );
   },
 
   onHighlightAllChange(aHighlightAll) {
     this._browser.messageManager.sendAsyncMessage("Finder:HighlightAllChange", {
       highlightAll: aHighlightAll,
     });
   },
 
   keyPress(aEvent) {
-    this._browser.messageManager.sendAsyncMessage("Finder:KeyPress",
-                                                  { keyCode: aEvent.keyCode,
-                                                    ctrlKey: aEvent.ctrlKey,
-                                                    metaKey: aEvent.metaKey,
-                                                    altKey: aEvent.altKey,
-                                                    shiftKey: aEvent.shiftKey });
+    this._browser.messageManager.sendAsyncMessage("Finder:KeyPress", {
+      keyCode: aEvent.keyCode,
+      ctrlKey: aEvent.ctrlKey,
+      metaKey: aEvent.metaKey,
+      altKey: aEvent.altKey,
+      shiftKey: aEvent.shiftKey,
+    });
   },
 
   requestMatchesCount(aSearchString, aLinksOnly) {
-    this._browser.messageManager.sendAsyncMessage("Finder:MatchesCount",
-                                                  { searchString: aSearchString,
-                                                    linksOnly: aLinksOnly });
+    this._browser.messageManager.sendAsyncMessage("Finder:MatchesCount", {
+      searchString: aSearchString,
+      linksOnly: aLinksOnly,
+    });
   },
 };
--- a/toolkit/modules/FormLikeFactory.jsm
+++ b/toolkit/modules/FormLikeFactory.jsm
@@ -1,29 +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";
 
 var EXPORTED_SYMBOLS = ["FormLikeFactory"];
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 
 /**
  * A factory to generate FormLike objects that represent a set of related fields
  * which aren't necessarily marked up with a <form> element. FormLike's emulate
  * the properties of an HTMLFormElement which are relevant to form tasks.
  */
 let FormLikeFactory = {
-  _propsFromForm: [
-    "action",
-    "autocomplete",
-    "ownerDocument",
-  ],
+  _propsFromForm: ["action", "autocomplete", "ownerDocument"],
 
   /**
    * Create a FormLike object from a <form>.
    *
    * @param {HTMLFormElement} aForm
    * @return {FormLike}
    * @throws Error if aForm isn't an HTMLFormElement
    */
@@ -58,19 +56,21 @@ let FormLikeFactory = {
    * Note that two FormLikes created from the same field won't return the same FormLike object.
    * Use the `rootElement` property on the FormLike as a key instead.
    *
    * @param {HTMLInputElement|HTMLSelectElement} aField - an <input> or <select> field in a document
    * @return {FormLike}
    * @throws Error if aField isn't a password or username field in a document
    */
   createFromField(aField) {
-    if ((ChromeUtils.getClassName(aField) !== "HTMLInputElement" &&
-         ChromeUtils.getClassName(aField) !== "HTMLSelectElement") ||
-        !aField.ownerDocument) {
+    if (
+      (ChromeUtils.getClassName(aField) !== "HTMLInputElement" &&
+        ChromeUtils.getClassName(aField) !== "HTMLSelectElement") ||
+      !aField.ownerDocument
+    ) {
       throw new Error("createFromField requires a field in a document");
     }
 
     let rootElement = this.findRootForField(aField);
     if (ChromeUtils.getClassName(rootElement) === "HTMLFormElement") {
       return this.createFromForm(rootElement);
     }
 
--- a/toolkit/modules/GMPExtractorWorker.js
+++ b/toolkit/modules/GMPExtractorWorker.js
@@ -21,46 +21,55 @@ onmessage = async function(msg) {
     for (let line of lines) {
       if (!line.startsWith(FILE_ENTRY)) {
         // Not a file entry, skip.
         continue;
       }
       let lineSplits = line.split(" ");
       let fileName = lineSplits[1];
       // We don't need these types of files.
-      if (fileName == "verified_contents.json" ||
-          fileName == "icon-128x128.png") {
+      if (
+        fileName == "verified_contents.json" ||
+        fileName == "icon-128x128.png"
+      ) {
         continue;
       }
       let filePath = jarPath + fileName;
       let filePathResponse = await fetch(filePath);
       let fileContents = await filePathResponse.blob();
       let fileData = await new Promise(resolve => {
-        reader.onloadend = function() { resolve(reader.result); };
+        reader.onloadend = function() {
+          resolve(reader.result);
+        };
         reader.readAsArrayBuffer(fileContents);
       });
       let profileDirPath = OS.Constants.Path.profileDir;
-      let installToDirPath = OS.Path.join(profileDirPath,
-                                          msg.data.relativeInstallPath);
-      await OS.File.makeDir(installToDirPath, {ignoreExisting: true,
-                                               unixMode: 0o755,
-                                               from: profileDirPath});
+      let installToDirPath = OS.Path.join(
+        profileDirPath,
+        msg.data.relativeInstallPath
+      );
+      await OS.File.makeDir(installToDirPath, {
+        ignoreExisting: true,
+        unixMode: 0o755,
+        from: profileDirPath,
+      });
       // Do not extract into directories. Extract all files to the same
       // directory.
       let destPath = OS.Path.join(installToDirPath, fileName);
-      await OS.File.writeAtomic(destPath, new Uint8Array(fileData),
-                                {tmpPath: destPath + ".tmp"});
+      await OS.File.writeAtomic(destPath, new Uint8Array(fileData), {
+        tmpPath: destPath + ".tmp",
+      });
       // Ensure files are writable and executable. Otherwise, we may be
       // unable to execute or uninstall them.
-      await OS.File.setPermissions(destPath, {unixMode: 0o700});
+      await OS.File.setPermissions(destPath, { unixMode: 0o700 });
       extractedPaths.push(destPath);
     }
     postMessage({
-      "result": "success",
+      result: "success",
       extractedPaths,
     });
   } catch (e) {
     postMessage({
-      "result": "fail",
-      "exception": e.message,
+      result: "fail",
+      exception: e.message,
     });
   }
 };
--- a/toolkit/modules/GMPInstallManager.jsm
+++ b/toolkit/modules/GMPInstallManager.jsm
@@ -2,44 +2,59 @@
  * 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";
 
 // 1 day default
 const DEFAULT_SECONDS_BETWEEN_CHECKS = 60 * 60 * 24;
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {PromiseUtils} = ChromeUtils.import("resource://gre/modules/PromiseUtils.jsm");
-const {Log} = ChromeUtils.import("resource://gre/modules/Log.jsm");
-const {OS} = ChromeUtils.import("resource://gre/modules/osfile.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { PromiseUtils } = ChromeUtils.import(
+  "resource://gre/modules/PromiseUtils.jsm"
+);
+const { Log } = ChromeUtils.import("resource://gre/modules/Log.jsm");
+const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
 // These symbols are, unfortunately, accessed via the module global from
 // tests, and therefore cannot be lexical definitions.
-var {GMPPrefs, GMPUtils, GMP_PLUGIN_IDS} = ChromeUtils.import("resource://gre/modules/GMPUtils.jsm");
-const {ProductAddonChecker} = ChromeUtils.import("resource://gre/modules/addons/ProductAddonChecker.jsm");
+var { GMPPrefs, GMPUtils, GMP_PLUGIN_IDS } = ChromeUtils.import(
+  "resource://gre/modules/GMPUtils.jsm"
+);
+const { ProductAddonChecker } = ChromeUtils.import(
+  "resource://gre/modules/addons/ProductAddonChecker.jsm"
+);
 
-var EXPORTED_SYMBOLS = ["GMPInstallManager", "GMPExtractor", "GMPDownloader",
-                        "GMPAddon"];
+var EXPORTED_SYMBOLS = [
+  "GMPInstallManager",
+  "GMPExtractor",
+  "GMPDownloader",
+  "GMPAddon",
+];
 
-ChromeUtils.defineModuleGetter(this, "CertUtils",
-                               "resource://gre/modules/CertUtils.jsm");
-ChromeUtils.defineModuleGetter(this, "UpdateUtils",
-                               "resource://gre/modules/UpdateUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "CertUtils",
+  "resource://gre/modules/CertUtils.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "UpdateUtils",
+  "resource://gre/modules/UpdateUtils.jsm"
+);
 
 function getScopedLogger(prefix) {
   // `PARENT_LOGGER_ID.` being passed here effectively links this logger
   // to the parentLogger.
   return Log.repository.getLoggerWithMessagePrefix("Toolkit.GMP", prefix + " ");
 }
 
 /**
  * Provides an easy API for downloading and installing GMP Addons
  */
-function GMPInstallManager() {
-}
+function GMPInstallManager() {}
 /**
  * Temp file name used for downloading
  */
 GMPInstallManager.prototype = {
   /**
    * Obtains a URL with replacement of vars
    */
   async _getURL() {
@@ -69,65 +84,74 @@ GMPInstallManager.prototype = {
    *         The promise is rejected with an object with properties:
    *           target: The XHR request object
    *           status: The HTTP status code
    *           type: Sometimes specifies type of rejection
    */
   async checkForAddons() {
     let log = getScopedLogger("GMPInstallManager.checkForAddons");
     if (this._deferred) {
-        log.error("checkForAddons already called");
-        return Promise.reject({type: "alreadycalled"});
+      log.error("checkForAddons already called");
+      return Promise.reject({ type: "alreadycalled" });
     }
     this._deferred = PromiseUtils.defer();
 
     let allowNonBuiltIn = true;
     let certs = null;
     if (!Services.prefs.prefHasUserValue(GMPPrefs.KEY_URL_OVERRIDE)) {
-      allowNonBuiltIn = !GMPPrefs.getString(GMPPrefs.KEY_CERT_REQUIREBUILTIN, true);
+      allowNonBuiltIn = !GMPPrefs.getString(
+        GMPPrefs.KEY_CERT_REQUIREBUILTIN,
+        true
+      );
       if (GMPPrefs.getBool(GMPPrefs.KEY_CERT_CHECKATTRS, true)) {
         certs = CertUtils.readCertPrefs(GMPPrefs.KEY_CERTS_BRANCH);
       }
     }
 
     let url = await this._getURL();
 
-    let addonPromise = ProductAddonChecker
-        .getProductAddonList(url, allowNonBuiltIn, certs);
+    let addonPromise = ProductAddonChecker.getProductAddonList(
+      url,
+      allowNonBuiltIn,
+      certs
+    );
 
-    addonPromise.then(res => {
-      if (!res || !res.gmpAddons) {
-        this._deferred.resolve({gmpAddons: []});
-      } else {
-        res.gmpAddons = res.gmpAddons.map(a => new GMPAddon(a));
-        this._deferred.resolve(res);
+    addonPromise.then(
+      res => {
+        if (!res || !res.gmpAddons) {
+          this._deferred.resolve({ gmpAddons: [] });
+        } else {
+          res.gmpAddons = res.gmpAddons.map(a => new GMPAddon(a));
+          this._deferred.resolve(res);
+        }
+        delete this._deferred;
+      },
+      ex => {
+        this._deferred.reject(ex);
+        delete this._deferred;
       }
-      delete this._deferred;
-    }, (ex) => {
-      this._deferred.reject(ex);
-      delete this._deferred;
-    });
+    );
     return this._deferred.promise;
   },
   /**
    * Installs the specified addon and calls a callback when done.
    * @param gmpAddon The GMPAddon object to install
    * @return a promise which will be resolved or rejected
    *         The promise will resolve with an array of paths that were extracted
    *         The promise will reject with an error object:
    *           target: The XHR request object
    *           status: The HTTP status code
    *           type: A string to represent the type of error
    *                 downloaderr, verifyerr or previouserrorencountered
    */
   installAddon(gmpAddon) {
     if (this._deferred) {
-        let log = getScopedLogger("GMPInstallManager.installAddon");
-        log.error("previous error encountered");
-        return Promise.reject({type: "previouserrorencountered"});
+      let log = getScopedLogger("GMPInstallManager.installAddon");
+      log.error("previous error encountered");
+      return Promise.reject({ type: "previouserrorencountered" });
     }
     this.gmpDownloader = new GMPDownloader(gmpAddon);
     return this.gmpDownloader.start();
   },
   _getTimeSinceLastCheck() {
     let now = Math.round(Date.now() / 1000);
     // Default to 0 here because `now - 0` will be returned later if that case
     // is hit. We want a large value so a check will occur.
@@ -141,18 +165,20 @@ GMPInstallManager.prototype = {
   },
   get _isEMEEnabled() {
     return GMPPrefs.getBool(GMPPrefs.KEY_EME_ENABLED, true);
   },
   _isAddonEnabled(aAddon) {
     return GMPPrefs.getBool(GMPPrefs.KEY_PLUGIN_ENABLED, true, aAddon);
   },
   _isAddonUpdateEnabled(aAddon) {
-    return this._isAddonEnabled(aAddon) &&
-           GMPPrefs.getBool(GMPPrefs.KEY_PLUGIN_AUTOUPDATE, true, aAddon);
+    return (
+      this._isAddonEnabled(aAddon) &&
+      GMPPrefs.getBool(GMPPrefs.KEY_PLUGIN_AUTOUPDATE, true, aAddon)
+    );
   },
   _updateLastCheck() {
     let now = Math.round(Date.now() / 1000);
     GMPPrefs.setInt(GMPPrefs.KEY_UPDATE_LAST_CHECK, now);
   },
   _versionchangeOccurred() {
     let savedBuildID = GMPPrefs.getString(GMPPrefs.KEY_BUILDID, "");
     let buildID = Services.appinfo.platformBuildID || "";
@@ -168,34 +194,41 @@ GMPInstallManager.prototype = {
    * This will only install/update the OpenH264 and EME plugins
    * @return a promise which will be resolved if all addons could be installed
    *         successfully, rejected otherwise.
    */
   async simpleCheckAndInstall() {
     let log = getScopedLogger("GMPInstallManager.simpleCheckAndInstall");
 
     if (this._versionchangeOccurred()) {
-      log.info("A version change occurred. Ignoring " +
-               "media.gmp-manager.lastCheck to check immediately for " +
-               "new or updated GMPs.");
+      log.info(
+        "A version change occurred. Ignoring " +
+          "media.gmp-manager.lastCheck to check immediately for " +
+          "new or updated GMPs."
+      );
     } else {
-      let secondsBetweenChecks =
-        GMPPrefs.getInt(GMPPrefs.KEY_SECONDS_BETWEEN_CHECKS,
-                        DEFAULT_SECONDS_BETWEEN_CHECKS);
+      let secondsBetweenChecks = GMPPrefs.getInt(
+        GMPPrefs.KEY_SECONDS_BETWEEN_CHECKS,
+        DEFAULT_SECONDS_BETWEEN_CHECKS
+      );
       let secondsSinceLast = this._getTimeSinceLastCheck();
-      log.info("Last check was: " + secondsSinceLast +
-               " seconds ago, minimum seconds: " + secondsBetweenChecks);
+      log.info(
+        "Last check was: " +
+          secondsSinceLast +
+          " seconds ago, minimum seconds: " +
+          secondsBetweenChecks
+      );
       if (secondsBetweenChecks > secondsSinceLast) {
         log.info("Will not check for updates.");
-        return {status: "too-frequent-no-check"};
+        return { status: "too-frequent-no-check" };
       }
     }
 
     try {
-      let {usedFallback, gmpAddons} = await this.checkForAddons();
+      let { usedFallback, gmpAddons } = await this.checkForAddons();
       this._updateLastCheck();
       log.info("Found " + gmpAddons.length + " addons advertised.");
       let addonsToInstall = gmpAddons.filter(function(gmpAddon) {
         log.info("Found addon: " + gmpAddon.toString());
 
         if (!gmpAddon.isValid) {
           log.info("Addon |" + gmpAddon.id + "| is invalid.");
           return false;
@@ -209,87 +242,95 @@ GMPInstallManager.prototype = {
         if (gmpAddon.isInstalled) {
           log.info("Addon |" + gmpAddon.id + "| already installed.");
           return false;
         }
 
         // Do not install from fallback if already installed as it
         // may be a downgrade
         if (usedFallback && gmpAddon.isUpdate) {
-         log.info("Addon |" + gmpAddon.id + "| not installing updates based " +
-                  "on fallback.");
-         return false;
+          log.info(
+            "Addon |" +
+              gmpAddon.id +
+              "| not installing updates based " +
+              "on fallback."
+          );
+          return false;
         }
 
         let addonUpdateEnabled = false;
         if (GMP_PLUGIN_IDS.includes(gmpAddon.id)) {
           if (!this._isAddonEnabled(gmpAddon.id)) {
-            log.info("GMP |" + gmpAddon.id + "| has been disabled; skipping check.");
+            log.info(
+              "GMP |" + gmpAddon.id + "| has been disabled; skipping check."
+            );
           } else if (!this._isAddonUpdateEnabled(gmpAddon.id)) {
-            log.info("Auto-update is off for " + gmpAddon.id +
-                     ", skipping check.");
+            log.info(
+              "Auto-update is off for " + gmpAddon.id + ", skipping check."
+            );
           } else {
             addonUpdateEnabled = true;
           }
         } else {
           // Currently, we only support installs of OpenH264 and EME plugins.
-          log.info("Auto-update is off for unknown plugin '" + gmpAddon.id +
-                   "', skipping check.");
+          log.info(
+            "Auto-update is off for unknown plugin '" +
+              gmpAddon.id +
+              "', skipping check."
+          );
         }
 
         return addonUpdateEnabled;
       }, this);
 
       if (!addonsToInstall.length) {
         log.info("No new addons to install, returning");
-        return {status: "nothing-new-to-install"};
+        return { status: "nothing-new-to-install" };
       }
 
       let installResults = [];
       let failureEncountered = false;
       for (let addon of addonsToInstall) {
         try {
           await this.installAddon(addon);
           installResults.push({
-            id:     addon.id,
+            id: addon.id,
             result: "succeeded",
           });
         } catch (e) {
           failureEncountered = true;
           installResults.push({
-            id:     addon.id,
+            id: addon.id,
             result: "failed",
           });
         }
       }
       if (failureEncountered) {
         // eslint-disable-next-line no-throw-literal
-        throw {status:  "failed",
-               results: installResults};
+        throw { status: "failed", results: installResults };
       }
-      return {status:  "succeeded",
-              results: installResults};
+      return { status: "succeeded", results: installResults };
     } catch (e) {
       log.error("Could not check for addons", e);
       throw e;
     }
   },
 
   /**
    * Makes sure everything is cleaned up
    */
   uninit() {
     let log = getScopedLogger("GMPInstallManager.uninit");
     if (this._request) {
       log.info("Aborting request");
       this._request.abort();
     }
     if (this._deferred) {
-        log.info("Rejecting deferred");
-        this._deferred.reject({type: "uninitialized"});
+      log.info("Rejecting deferred");
+      this._deferred.reject({ type: "uninitialized" });
     }
     log.info("Done cleanup");
   },
 
   /**
    * If set to true, specifies to leave the temporary downloaded zip file.
    * This is useful for tests.
    */
@@ -311,91 +352,108 @@ function GMPAddon(addon) {
   log.info("Created new addon: " + this.toString());
 }
 
 GMPAddon.prototype = {
   /**
    * Returns a string representation of the addon
    */
   toString() {
-    return this.id + " (" +
-           "isValid: " + this.isValid +
-           ", isInstalled: " + this.isInstalled +
-           ", hashFunction: " + this.hashFunction +
-           ", hashValue: " + this.hashValue +
-           (this.size !== undefined ? ", size: " + this.size : "" ) +
-           ")";
+    return (
+      this.id +
+      " (" +
+      "isValid: " +
+      this.isValid +
+      ", isInstalled: " +
+      this.isInstalled +
+      ", hashFunction: " +
+      this.hashFunction +
+      ", hashValue: " +
+      this.hashValue +
+      (this.size !== undefined ? ", size: " + this.size : "") +
+      ")"
+    );
   },
   /**
    * If all the fields aren't specified don't consider this addon valid
    * @return true if the addon is parsed and valid
    */
   get isValid() {
-    return this.id && this.URL && this.version &&
-      this.hashFunction && !!this.hashValue;
+    return (
+      this.id &&
+      this.URL &&
+      this.version &&
+      this.hashFunction &&
+      !!this.hashValue
+    );
   },
   get isInstalled() {
-    return this.version &&
-      GMPPrefs.getString(GMPPrefs.KEY_PLUGIN_VERSION, "", this.id) === this.version;
+    return (
+      this.version &&
+      GMPPrefs.getString(GMPPrefs.KEY_PLUGIN_VERSION, "", this.id) ===
+        this.version
+    );
   },
   get isEME() {
     return this.id == "gmp-widevinecdm" || this.id.indexOf("gmp-eme-") == 0;
   },
   /**
    * @return true if the addon has been previously installed and this is
    * a new version, if this is a fresh install return false
    */
   get isUpdate() {
-    return this.version &&
-      GMPPrefs.getBool(GMPPrefs.KEY_PLUGIN_VERSION, false, this.id);
+    return (
+      this.version &&
+      GMPPrefs.getBool(GMPPrefs.KEY_PLUGIN_VERSION, false, this.id)
+    );
   },
 };
 /**
  * Constructs a GMPExtractor object which is used to extract a GMP zip
  * into the specified location. (Which typically leties per platform)
  * @param zipPath The path on disk of the zip file to extract
  */
 function GMPExtractor(zipPath, relativeInstallPath) {
-    this.zipPath = zipPath;
-    this.relativeInstallPath = relativeInstallPath;
+  this.zipPath = zipPath;
+  this.relativeInstallPath = relativeInstallPath;
 }
 GMPExtractor.prototype = {
   /**
    * Installs the this.zipPath contents into the directory used to store GMP
    * addons for the current platform.
    *
    * @return a promise which will be resolved or rejected
    *         See GMPInstallManager.installAddon for resolve/rejected info
    */
   install() {
     this._deferred = PromiseUtils.defer();
     let deferredPromise = this._deferred;
-    let {zipPath, relativeInstallPath} = this;
-    let worker =
-      new ChromeWorker("resource://gre/modules/GMPExtractorWorker.js");
+    let { zipPath, relativeInstallPath } = this;
+    let worker = new ChromeWorker(
+      "resource://gre/modules/GMPExtractorWorker.js"
+    );
     worker.onmessage = function(msg) {
       let log = getScopedLogger("GMPExtractor");
       worker.terminate();
       if (msg.data.result != "success") {
         log.error("Failed to extract zip file: " + zipPath);
         return deferredPromise.reject({
           target: this,
           status: msg.data.exception,
           type: "exception",
         });
       }
       log.info("Successfully extracted zip file: " + zipPath);
       return deferredPromise.resolve(msg.data.extractedPaths);
     };
-    worker.postMessage({zipPath, relativeInstallPath});
+    worker.postMessage({ zipPath, relativeInstallPath });
     return this._deferred.promise;
   },
 };
 
-
 /**
  * Constructs an object which downloads and initiates an install of
  * the specified GMPAddon object.
  * @param gmpAddon The addon to install.
  */
 function GMPDownloader(gmpAddon) {
   this._gmpAddon = gmpAddon;
 }
@@ -413,33 +471,35 @@ GMPDownloader.prototype = {
     if (!gmpAddon.isValid) {
       log.info("gmpAddon is not valid, will not continue");
       return Promise.reject({
         target: this,
         type: "downloaderr",
       });
     }
 
-    return ProductAddonChecker.downloadAddon(gmpAddon).then((zipPath) => {
-      let relativePath = OS.Path.join(gmpAddon.id,
-                                      gmpAddon.version);
+    return ProductAddonChecker.downloadAddon(gmpAddon).then(zipPath => {
+      let relativePath = OS.Path.join(gmpAddon.id, gmpAddon.version);
       log.info("install to directory path: " + relativePath);
       let gmpInstaller = new GMPExtractor(zipPath, relativePath);
       let installPromise = gmpInstaller.install();
       return installPromise.then(extractedPaths => {
         // Success, set the prefs
         let now = Math.round(Date.now() / 1000);
         GMPPrefs.setInt(GMPPrefs.KEY_PLUGIN_LAST_UPDATE, now, gmpAddon.id);
         // Remember our ABI, so that if the profile is migrated to another
         // platform or from 32 -> 64 bit, we notice and don't try to load the
         // unexecutable plugin library.
         let abi = GMPUtils._expectedABI(gmpAddon);
         log.info("Setting ABI to '" + abi + "' for " + gmpAddon.id);
         GMPPrefs.setString(GMPPrefs.KEY_PLUGIN_ABI, abi, gmpAddon.id);
         // Setting the version pref signals installation completion to consumers,
         // if you need to set other prefs etc. do it before this.
-        GMPPrefs.setString(GMPPrefs.KEY_PLUGIN_VERSION, gmpAddon.version,
-                           gmpAddon.id);
+        GMPPrefs.setString(
+          GMPPrefs.KEY_PLUGIN_VERSION,
+          gmpAddon.version,
+          gmpAddon.id
+        );
         return extractedPaths;
       });
     });
   },
 };
--- a/toolkit/modules/GMPUtils.jsm
+++ b/toolkit/modules/GMPUtils.jsm
@@ -1,45 +1,50 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-var EXPORTED_SYMBOLS = [ "GMP_PLUGIN_IDS",
-                         "GMPPrefs",
-                         "GMPUtils",
-                         "OPEN_H264_ID",
-                         "WIDEVINE_ID" ];
+var EXPORTED_SYMBOLS = [
+  "GMP_PLUGIN_IDS",
+  "GMPPrefs",
+  "GMPUtils",
+  "OPEN_H264_ID",
+  "WIDEVINE_ID",
+];
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
-const {UpdateUtils} = ChromeUtils.import("resource://gre/modules/UpdateUtils.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { AppConstants } = ChromeUtils.import(
+  "resource://gre/modules/AppConstants.jsm"
+);
+const { UpdateUtils } = ChromeUtils.import(
+  "resource://gre/modules/UpdateUtils.jsm"
+);
 
 // GMP IDs
-const OPEN_H264_ID  = "gmp-gmpopenh264";
-const WIDEVINE_ID   = "gmp-widevinecdm";
-const GMP_PLUGIN_IDS = [ OPEN_H264_ID, WIDEVINE_ID ];
+const OPEN_H264_ID = "gmp-gmpopenh264";
+const WIDEVINE_ID = "gmp-widevinecdm";
+const GMP_PLUGIN_IDS = [OPEN_H264_ID, WIDEVINE_ID];
 
 var GMPUtils = {
   /**
    * Checks whether or not a given plugin is hidden. Hidden plugins are neither
    * downloaded nor displayed in the addons manager.
    * @param   aPlugin
    *          The plugin to check.
    */
   isPluginHidden(aPlugin) {
     if (this._is32bitModeMacOS()) {
       // GMPs are hidden on MacOS when running in 32 bit mode.
       // See bug 1291537.
       return true;
     }
 
-    if (!this._isPluginSupported(aPlugin) ||
-        !this._isPluginVisible(aPlugin)) {
+    if (!this._isPluginSupported(aPlugin) || !this._isPluginVisible(aPlugin)) {
       return true;
     }
 
     if (!aPlugin.isEME) {
       return false;
     }
 
     if (!GMPPrefs.getBool(GMPPrefs.KEY_EME_ENABLED, true)) {
@@ -56,19 +61,21 @@ var GMPUtils = {
    */
   _isPluginSupported(aPlugin) {
     if (this._isPluginForceSupported(aPlugin)) {
       return true;
     }
     if (aPlugin.id == WIDEVINE_ID) {
       // The Widevine plugin is available for Windows versions Vista and later,
       // Mac OSX, and Linux.
-      return AppConstants.platform == "win" ||
-             AppConstants.platform == "macosx" ||
-             AppConstants.platform == "linux";
+      return (
+        AppConstants.platform == "win" ||
+        AppConstants.platform == "macosx" ||
+        AppConstants.platform == "linux"
+      );
     }
 
     return true;
   },
 
   _is32bitModeMacOS() {
     if (AppConstants.platform != "macosx") {
       return false;
@@ -90,17 +97,21 @@ var GMPUtils = {
   /**
    * Checks whether or not a given plugin is forced-supported. This is used
    * in automated tests to override the checks that prevent GMPs running on an
    * unsupported platform.
    * @param   aPlugin
    *          The plugin to check.
    */
   _isPluginForceSupported(aPlugin) {
-    return GMPPrefs.getBool(GMPPrefs.KEY_PLUGIN_FORCE_SUPPORTED, false, aPlugin.id);
+    return GMPPrefs.getBool(
+      GMPPrefs.KEY_PLUGIN_FORCE_SUPPORTED,
+      false,
+      aPlugin.id
+    );
   },
 
   _isWindowsOnARM64() {
     return AppConstants.platform == "win" && UpdateUtils.ABI.match(/aarch64/);
   },
 
   _expectedABI(aPlugin) {
     let defaultABI = UpdateUtils.ABI;
@@ -112,75 +123,86 @@ var GMPUtils = {
     return defaultABI;
   },
 };
 
 /**
  * Manages preferences for GMP addons
  */
 var GMPPrefs = {
-  KEY_EME_ENABLED:              "media.eme.enabled",
-  KEY_PLUGIN_ENABLED:           "media.{0}.enabled",
-  KEY_PLUGIN_LAST_UPDATE:       "media.{0}.lastUpdate",
-  KEY_PLUGIN_VERSION:           "media.{0}.version",
-  KEY_PLUGIN_AUTOUPDATE:        "media.{0}.autoupdate",
-  KEY_PLUGIN_VISIBLE:           "media.{0}.visible",
-  KEY_PLUGIN_ABI:               "media.{0}.abi",
-  KEY_PLUGIN_FORCE_SUPPORTED:   "media.{0}.forceSupported",
-  KEY_URL:                      "media.gmp-manager.url",
-  KEY_URL_OVERRIDE:             "media.gmp-manager.url.override",
-  KEY_CERT_CHECKATTRS:          "media.gmp-manager.cert.checkAttributes",
-  KEY_CERT_REQUIREBUILTIN:      "media.gmp-manager.cert.requireBuiltIn",
-  KEY_UPDATE_LAST_CHECK:        "media.gmp-manager.lastCheck",
-  KEY_SECONDS_BETWEEN_CHECKS:   "media.gmp-manager.secondsBetweenChecks",
-  KEY_UPDATE_ENABLED:           "media.gmp-manager.updateEnabled",
-  KEY_APP_DISTRIBUTION:         "distribution.id",
+  KEY_EME_ENABLED: "media.eme.enabled",
+  KEY_PLUGIN_ENABLED: "media.{0}.enabled",
+  KEY_PLUGIN_LAST_UPDATE: "media.{0}.lastUpdate",
+  KEY_PLUGIN_VERSION: "media.{0}.version",
+  KEY_PLUGIN_AUTOUPDATE: "media.{0}.autoupdate",
+  KEY_PLUGIN_VISIBLE: "media.{0}.visible",
+  KEY_PLUGIN_ABI: "media.{0}.abi",
+  KEY_PLUGIN_FORCE_SUPPORTED: "media.{0}.forceSupported",
+  KEY_URL: "media.gmp-manager.url",
+  KEY_URL_OVERRIDE: "media.gmp-manager.url.override",
+  KEY_CERT_CHECKATTRS: "media.gmp-manager.cert.checkAttributes",
+  KEY_CERT_REQUIREBUILTIN: "media.gmp-manager.cert.requireBuiltIn",
+  KEY_UPDATE_LAST_CHECK: "media.gmp-manager.lastCheck",
+  KEY_SECONDS_BETWEEN_CHECKS: "media.gmp-manager.secondsBetweenChecks",
+  KEY_UPDATE_ENABLED: "media.gmp-manager.updateEnabled",
+  KEY_APP_DISTRIBUTION: "distribution.id",
   KEY_APP_DISTRIBUTION_VERSION: "distribution.version",
-  KEY_BUILDID:                  "media.gmp-manager.buildID",
-  KEY_CERTS_BRANCH:             "media.gmp-manager.certs.",
-  KEY_PROVIDER_ENABLED:         "media.gmp-provider.enabled",
-  KEY_LOG_BASE:                 "media.gmp.log.",
-  KEY_LOGGING_LEVEL:            "media.gmp.log.level",
-  KEY_LOGGING_DUMP:             "media.gmp.log.dump",
+  KEY_BUILDID: "media.gmp-manager.buildID",
+  KEY_CERTS_BRANCH: "media.gmp-manager.certs.",
+  KEY_PROVIDER_ENABLED: "media.gmp-provider.enabled",
+  KEY_LOG_BASE: "media.gmp.log.",
+  KEY_LOGGING_LEVEL: "media.gmp.log.level",
+  KEY_LOGGING_DUMP: "media.gmp.log.dump",
 
   /**
    * Obtains the specified string preference in relation to the specified plugin.
    * @param aKey The preference key value to use.
    * @param aDefaultValue The default value if no preference exists.
    * @param aPlugin The plugin to scope the preference to.
    * @return The obtained preference value, or the defaultValue if none exists.
    */
   getString(aKey, aDefaultValue, aPlugin) {
-    if (aKey === this.KEY_APP_DISTRIBUTION ||
-        aKey === this.KEY_APP_DISTRIBUTION_VERSION) {
+    if (
+      aKey === this.KEY_APP_DISTRIBUTION ||
+      aKey === this.KEY_APP_DISTRIBUTION_VERSION
+    ) {
       return Services.prefs.getDefaultBranch(null).getCharPref(aKey, "default");
     }
-    return Services.prefs.getStringPref(this.getPrefKey(aKey, aPlugin), aDefaultValue);
+    return Services.prefs.getStringPref(
+      this.getPrefKey(aKey, aPlugin),
+      aDefaultValue
+    );
   },
 
   /**
    * Obtains the specified int preference in relation to the specified plugin.
    * @param aKey The preference key value to use.
    * @param aDefaultValue The default value if no preference exists.
    * @param aPlugin The plugin to scope the preference to.
    * @return The obtained preference value, or the defaultValue if none exists.
    */
   getInt(aKey, aDefaultValue, aPlugin) {
-    return Services.prefs.getIntPref(this.getPrefKey(aKey, aPlugin), aDefaultValue);
+    return Services.prefs.getIntPref(
+      this.getPrefKey(aKey, aPlugin),
+      aDefaultValue
+    );
   },
 
   /**
    * Obtains the specified bool preference in relation to the specified plugin.
    * @param aKey The preference key value to use.
    * @param aDefaultValue The default value if no preference exists.
    * @param aPlugin The plugin to scope the preference to.
    * @return The obtained preference value, or the defaultValue if none exists.
    */
   getBool(aKey, aDefaultValue, aPlugin) {
-    return Services.prefs.getBoolPref(this.getPrefKey(aKey, aPlugin), aDefaultValue);
+    return Services.prefs.getBoolPref(
+      this.getPrefKey(aKey, aPlugin),
+      aDefaultValue
+    );
   },
 
   /**
    * Sets the specified string preference in relation to the specified plugin.
    * @param aKey The preference key value to use.
    * @param aVal The value to set.
    * @param aPlugin The plugin to scope the preference to.
    */
--- a/toolkit/modules/Geometry.jsm
+++ b/toolkit/modules/Geometry.jsm
@@ -59,27 +59,28 @@ Point.prototype = {
   isZero() {
     return this.x == 0 && this.y == 0;
   },
 };
 
 (function() {
   function takePointOrArgs(f) {
     return function(arg1, arg2) {
-      if (arg2 === undefined)
+      if (arg2 === undefined) {
         return f.call(this, arg1.x, arg1.y);
+      }
       return f.call(this, arg1, arg2);
     };
   }
 
-  for (let f of ["add", "subtract", "equals", "set"])
+  for (let f of ["add", "subtract", "equals", "set"]) {
     Point.prototype[f] = takePointOrArgs(Point.prototype[f]);
+  }
 })();
 
-
 /**
  * Rect is a simple data structure for representation of a rectangle supporting
  * many basic geometric operations.
  *
  * NOTE: Since its operations are closed, rectangles may be empty and will report
  * non-positive widths and heights in that case.
  */
 
@@ -90,32 +91,44 @@ function Rect(x, y, w, h) {
   this.bottom = y + h;
 }
 
 Rect.fromRect = function fromRect(r) {
   return new Rect(r.left, r.top, r.right - r.left, r.bottom - r.top);
 };
 
 Rect.prototype = {
-  get x() { return this.left; },
-  get y() { return this.top; },
-  get width() { return this.right - this.left; },
-  get height() { return this.bottom - this.top; },
+  get x() {
+    return this.left;
+  },
+  get y() {
+    return this.top;
+  },
+  get width() {
+    return this.right - this.left;
+  },
+  get height() {
+    return this.bottom - this.top;
+  },
   set x(v) {
     let diff = this.left - v;
     this.left = v;
     this.right -= diff;
   },
   set y(v) {
     let diff = this.top - v;
     this.top = v;
     this.bottom -= diff;
   },
-  set width(v) { this.right = this.left + v; },
-  set height(v) { this.bottom = this.top + v; },
+  set width(v) {
+    this.right = this.left + v;
+  },
+  set height(v) {
+    this.bottom = this.top + v;
+  },
 
   isEmpty: function isEmpty() {
     return this.left >= this.right || this.top >= this.bottom;
   },
 
   setRect(x, y, w, h) {
     this.left = x;
     this.top = y;
@@ -130,33 +143,43 @@ Rect.prototype = {
     this.left = l;
     this.bottom = b;
     this.right = r;
 
     return this;
   },
 
   equals: function equals(other) {
-    return other != null &&
-            (this.isEmpty() && other.isEmpty() ||
-            this.top == other.top &&
-            this.left == other.left &&
-            this.bottom == other.bottom &&
-            this.right == other.right);
+    return (
+      other != null &&
+      ((this.isEmpty() && other.isEmpty()) ||
+        (this.top == other.top &&
+          this.left == other.left &&
+          this.bottom == other.bottom &&
+          this.right == other.right))
+    );
   },
 
   clone: function clone() {
-    return new Rect(this.left, this.top, this.right - this.left, this.bottom - this.top);
+    return new Rect(
+      this.left,
+      this.top,
+      this.right - this.left,
+      this.bottom - this.top
+    );
   },
 
   center: function center() {
-    if (this.isEmpty())
+    if (this.isEmpty()) {
       throw new Error("Empty rectangles do not have centers");
-    return new Point(this.left + (this.right - this.left) / 2,
-                          this.top + (this.bottom - this.top) / 2);
+    }
+    return new Point(
+      this.left + (this.right - this.left) / 2,
+      this.top + (this.bottom - this.top) / 2
+    );
   },
 
   copyFrom(other) {
     this.top = other.top;
     this.left = other.left;
     this.bottom = other.bottom;
     this.right = other.right;
 
@@ -168,66 +191