Bug 1561435 - Format browser/actors/, a=automatic-formatting
authorVictor Porof <vporof@mozilla.com>
Fri, 05 Jul 2019 09:46:28 +0200
changeset 481365 fb99af508d47ca0bfecbe0e6be3fc3f998576d63
parent 481364 e78cfc62325608065dbb0819d2ceecf38fb0e233
child 481366 aa12d9e8a4f1cad6b8057ef69fa4b3273c3c3fab
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 browser/actors/, a=automatic-formatting # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D36040
.eslintrc.js
.prettierignore
browser/actors/AboutReaderChild.jsm
browser/actors/BlockedSiteChild.jsm
browser/actors/BrowserTabChild.jsm
browser/actors/ClickHandlerChild.jsm
browser/actors/ContentSearchChild.jsm
browser/actors/ContextMenuChild.jsm
browser/actors/ContextMenuParent.jsm
browser/actors/ContextMenuSpecialProcessChild.jsm
browser/actors/DOMFullscreenChild.jsm
browser/actors/FormValidationChild.jsm
browser/actors/LightweightThemeChild.jsm
browser/actors/LinkHandlerChild.jsm
browser/actors/NetErrorChild.jsm
browser/actors/OfflineAppsChild.jsm
browser/actors/PageInfoChild.jsm
browser/actors/PageStyleChild.jsm
browser/actors/PluginChild.jsm
browser/actors/RFPHelperChild.jsm
browser/actors/SearchTelemetryChild.jsm
browser/actors/SubframeCrashChild.jsm
browser/actors/SubframeCrashParent.jsm
browser/actors/URIFixupChild.jsm
browser/actors/WebRTCChild.jsm
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -39,17 +39,16 @@ module.exports = {
   "extends": [
     "plugin:mozilla/recommended"
   ],
   "plugins": [
     "mozilla"
   ],
   "overrides": [{
       "files": [
-        "browser/**",
         "build/**",
         "caps/**",
         "chrome/**",
         "config/**",
         "devtools/**",
         "docshell/**",
         "dom/**",
         "editor/**",
--- a/.prettierignore
+++ b/.prettierignore
@@ -35,17 +35,16 @@ security/manager/ssl/security-prefs.js
 services/common/services-common.js
 services/sync/services-sync.js
 services/sync/tests/unit/prefs_test_prefs_store.js
 testing/marionette/prefs/marionette.js
 toolkit/components/telemetry/datareporting-prefs.js
 toolkit/components/telemetry/healthreport-prefs.js
 
 # Ignore all top-level directories for now.
-browser/**
 build/**
 caps/**
 chrome/**
 config/**
 docshell/**
 dom/**
 editor/**
 extensions/**
--- a/browser/actors/AboutReaderChild.jsm
+++ b/browser/actors/AboutReaderChild.jsm
@@ -1,38 +1,51 @@
 /* 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/. */
 "use strict";
 
 var EXPORTED_SYMBOLS = ["AboutReaderChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
 
-ChromeUtils.defineModuleGetter(this, "AboutReader",
-                               "resource://gre/modules/AboutReader.jsm");
-ChromeUtils.defineModuleGetter(this, "ReaderMode",
-                               "resource://gre/modules/ReaderMode.jsm");
-ChromeUtils.defineModuleGetter(this, "Readerable",
-                               "resource://gre/modules/Readerable.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "AboutReader",
+  "resource://gre/modules/AboutReader.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "ReaderMode",
+  "resource://gre/modules/ReaderMode.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "Readerable",
+  "resource://gre/modules/Readerable.jsm"
+);
 
 class AboutReaderChild extends ActorChild {
   constructor(dispatcher) {
     super(dispatcher);
 
     this._articlePromise = null;
     this._isLeavingReaderableReaderMode = false;
   }
 
   receiveMessage(message) {
     switch (message.name) {
       case "Reader:ToggleReaderMode":
         if (!this.isAboutReader) {
-          this._articlePromise = ReaderMode.parseDocument(this.content.document).catch(Cu.reportError);
+          this._articlePromise = ReaderMode.parseDocument(
+            this.content.document
+          ).catch(Cu.reportError);
           ReaderMode.enterReaderMode(this.mm.docShell, this.content);
         } else {
           this._isLeavingReaderableReaderMode = this.isReaderableAboutReader;
           ReaderMode.leaveReaderMode(this.mm.docShell, this.content);
         }
         break;
 
       case "Reader:PushState":
@@ -44,18 +57,20 @@ class AboutReaderChild extends ActorChil
   get isAboutReader() {
     if (!this.content) {
       return false;
     }
     return this.content.document.documentURI.startsWith("about:reader");
   }
 
   get isReaderableAboutReader() {
-    return this.isAboutReader &&
-      !this.content.document.documentElement.dataset.isError;
+    return (
+      this.isAboutReader &&
+      !this.content.document.documentElement.dataset.isError
+    );
   }
 
   handleEvent(aEvent) {
     if (aEvent.originalTarget.defaultView != this.content) {
       return;
     }
 
     switch (aEvent.type) {
@@ -72,17 +87,19 @@ class AboutReaderChild extends ActorChil
         }
         break;
 
       case "pagehide":
         this.cancelPotentialPendingReadabilityCheck();
         // this._isLeavingReaderableReaderMode is used here to keep the Reader Mode icon
         // visible in the location bar when transitioning from reader-mode page
         // back to the readable source page.
-        this.mm.sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: this._isLeavingReaderableReaderMode });
+        this.mm.sendAsyncMessage("Reader:UpdateReaderButton", {
+          isArticle: this._isLeavingReaderableReaderMode,
+        });
         if (this._isLeavingReaderableReaderMode) {
           this._isLeavingReaderableReaderMode = false;
         }
         break;
 
       case "pageshow":
         // If a page is loaded from the bfcache, we won't get a "DOMContentLoaded"
         // event, so we need to rely on "pageshow" in this case.
@@ -98,39 +115,49 @@ class AboutReaderChild extends ActorChil
 
   /**
    * NB: this function will update the state of the reader button asynchronously
    * after the next mozAfterPaint call (assuming reader mode is enabled and
    * this is a suitable document). Calling it on things which won't be
    * painted is not going to work.
    */
   updateReaderButton(forceNonArticle) {
-    if (!Readerable.isEnabledForParseOnLoad || this.isAboutReader ||
-        !this.content || !(this.content.document instanceof this.content.HTMLDocument) ||
-        this.content.document.mozSyntheticDocument) {
+    if (
+      !Readerable.isEnabledForParseOnLoad ||
+      this.isAboutReader ||
+      !this.content ||
+      !(this.content.document instanceof this.content.HTMLDocument) ||
+      this.content.document.mozSyntheticDocument
+    ) {
       return;
     }
 
     this.scheduleReadabilityCheckPostPaint(forceNonArticle);
   }
 
   cancelPotentialPendingReadabilityCheck() {
     if (this._pendingReadabilityCheck) {
-      this.mm.removeEventListener("MozAfterPaint", this._pendingReadabilityCheck);
+      this.mm.removeEventListener(
+        "MozAfterPaint",
+        this._pendingReadabilityCheck
+      );
       delete this._pendingReadabilityCheck;
     }
   }
 
   scheduleReadabilityCheckPostPaint(forceNonArticle) {
     if (this._pendingReadabilityCheck) {
       // We need to stop this check before we re-add one because we don't know
       // if forceNonArticle was true or false last time.
       this.cancelPotentialPendingReadabilityCheck();
     }
-    this._pendingReadabilityCheck = this.onPaintWhenWaitedFor.bind(this, forceNonArticle);
+    this._pendingReadabilityCheck = this.onPaintWhenWaitedFor.bind(
+      this,
+      forceNonArticle
+    );
     this.mm.addEventListener("MozAfterPaint", this._pendingReadabilityCheck);
   }
 
   onPaintWhenWaitedFor(forceNonArticle, event) {
     // In non-e10s, we'll get called for paints other than ours, and so it's
     // possible that this page hasn't been laid out yet, in which case we
     // should wait until we get an event that does relate to our layout. We
     // determine whether any of our this.content got painted by checking if there
@@ -138,14 +165,18 @@ class AboutReaderChild extends ActorChil
     if (!event.clientRects.length) {
       return;
     }
 
     this.cancelPotentialPendingReadabilityCheck();
     // Only send updates when there are articles; there's no point updating with
     // |false| all the time.
     if (Readerable.isProbablyReaderable(this.content.document)) {
-      this.mm.sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: true });
+      this.mm.sendAsyncMessage("Reader:UpdateReaderButton", {
+        isArticle: true,
+      });
     } else if (forceNonArticle) {
-      this.mm.sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: false });
+      this.mm.sendAsyncMessage("Reader:UpdateReaderButton", {
+        isArticle: false,
+      });
     }
   }
 }
--- a/browser/actors/BlockedSiteChild.jsm
+++ b/browser/actors/BlockedSiteChild.jsm
@@ -1,46 +1,64 @@
 /* -*- 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 = ["BlockedSiteChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
-ChromeUtils.defineModuleGetter(this, "E10SUtils",
-  "resource://gre/modules/E10SUtils.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "E10SUtils",
+  "resource://gre/modules/E10SUtils.jsm"
+);
 
-ChromeUtils.defineModuleGetter(this, "SafeBrowsing",
-                               "resource://gre/modules/SafeBrowsing.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "SafeBrowsing",
+  "resource://gre/modules/SafeBrowsing.jsm"
+);
 
 function getSiteBlockedErrorDetails(docShell) {
   let blockedInfo = {};
   if (docShell.failedChannel) {
-    let classifiedChannel = docShell.failedChannel.
-                            QueryInterface(Ci.nsIClassifiedChannel);
+    let classifiedChannel = docShell.failedChannel.QueryInterface(
+      Ci.nsIClassifiedChannel
+    );
     if (classifiedChannel) {
-      let httpChannel = docShell.failedChannel.QueryInterface(Ci.nsIHttpChannel);
+      let httpChannel = docShell.failedChannel.QueryInterface(
+        Ci.nsIHttpChannel
+      );
 
       let reportUri = httpChannel.URI;
 
       // Remove the query to avoid leaking sensitive data
       if (reportUri instanceof Ci.nsIURL) {
-        reportUri = reportUri.mutate()
-                             .setQuery("")
-                             .finalize();
+        reportUri = reportUri
+          .mutate()
+          .setQuery("")
+          .finalize();
       }
 
-      let triggeringPrincipal = docShell.failedChannel.loadInfo ? E10SUtils.serializePrincipal(docShell.failedChannel.loadInfo.triggeringPrincipal) : null;
-      blockedInfo = { list: classifiedChannel.matchedList,
-                      triggeringPrincipal,
-                      provider: classifiedChannel.matchedProvider,
-                      uri: reportUri.asciiSpec };
+      let triggeringPrincipal = docShell.failedChannel.loadInfo
+        ? E10SUtils.serializePrincipal(
+            docShell.failedChannel.loadInfo.triggeringPrincipal
+          )
+        : null;
+      blockedInfo = {
+        list: classifiedChannel.matchedList,
+        triggeringPrincipal,
+        provider: classifiedChannel.matchedProvider,
+        uri: reportUri.asciiSpec,
+      };
     }
   }
   return blockedInfo;
 }
 
 class BlockedSiteChild extends ActorChild {
   receiveMessage(msg) {
     if (msg.name == "DeceptiveBlockedDetails") {
@@ -63,77 +81,114 @@ class BlockedSiteChild extends ActorChil
     let content = aEvent.target.ownerGlobal;
 
     let blockedInfo = getSiteBlockedErrorDetails(global.docShell);
     let provider = blockedInfo.provider || "";
 
     let doc = content.document;
 
     /**
-    * Set error description link in error details.
-    * For example, the "reported as a deceptive site" link for
-    * blocked phishing pages.
-    */
+     * Set error description link in error details.
+     * For example, the "reported as a deceptive site" link for
+     * blocked phishing pages.
+     */
     let desc = Services.prefs.getCharPref(
-      "browser.safebrowsing.provider." + provider + ".reportURL", "");
+      "browser.safebrowsing.provider." + provider + ".reportURL",
+      ""
+    );
     if (desc) {
-      doc.getElementById("error_desc_link").setAttribute("href", desc + encodeURIComponent(aEvent.detail.url));
+      doc
+        .getElementById("error_desc_link")
+        .setAttribute("href", desc + encodeURIComponent(aEvent.detail.url));
     }
 
     // Set other links in error details.
     switch (aEvent.detail.err) {
       case "malware":
-        doc.getElementById("report_detection").setAttribute("href",
-          (SafeBrowsing.getReportURL("MalwareMistake", blockedInfo) ||
-           "https://www.stopbadware.org/firefox"));
-        doc.getElementById("learn_more_link").setAttribute("href",
-          "https://www.stopbadware.org/firefox");
+        doc
+          .getElementById("report_detection")
+          .setAttribute(
+            "href",
+            SafeBrowsing.getReportURL("MalwareMistake", blockedInfo) ||
+              "https://www.stopbadware.org/firefox"
+          );
+        doc
+          .getElementById("learn_more_link")
+          .setAttribute("href", "https://www.stopbadware.org/firefox");
         break;
       case "unwanted":
-        doc.getElementById("learn_more_link").setAttribute("href",
-          "https://www.google.com/about/unwanted-software-policy.html");
+        doc
+          .getElementById("learn_more_link")
+          .setAttribute(
+            "href",
+            "https://www.google.com/about/unwanted-software-policy.html"
+          );
         break;
       case "phishing":
-        doc.getElementById("report_detection").setAttribute("href",
-          (SafeBrowsing.getReportURL("PhishMistake", blockedInfo) ||
-           "https://safebrowsing.google.com/safebrowsing/report_error/?tpl=mozilla"));
-        doc.getElementById("learn_more_link").setAttribute("href",
-          "https://www.antiphishing.org//");
+        doc
+          .getElementById("report_detection")
+          .setAttribute(
+            "href",
+            SafeBrowsing.getReportURL("PhishMistake", blockedInfo) ||
+              "https://safebrowsing.google.com/safebrowsing/report_error/?tpl=mozilla"
+          );
+        doc
+          .getElementById("learn_more_link")
+          .setAttribute("href", "https://www.antiphishing.org//");
         break;
     }
 
     // Set the firefox support url.
-    doc.getElementById("firefox_support").setAttribute("href",
-      Services.urlFormatter.formatURLPref("app.support.baseURL") + "phishing-malware");
+    doc
+      .getElementById("firefox_support")
+      .setAttribute(
+        "href",
+        Services.urlFormatter.formatURLPref("app.support.baseURL") +
+          "phishing-malware"
+      );
 
     // Show safe browsing details on load if the pref is set to true.
-    let showDetails = Services.prefs.getBoolPref("browser.xul.error_pages.show_safe_browsing_details_on_load");
+    let showDetails = Services.prefs.getBoolPref(
+      "browser.xul.error_pages.show_safe_browsing_details_on_load"
+    );
     if (showDetails) {
-      let details = content.document.getElementById("errorDescriptionContainer");
+      let details = content.document.getElementById(
+        "errorDescriptionContainer"
+      );
       details.removeAttribute("hidden");
     }
 
     // Set safe browsing advisory link.
     let advisoryUrl = Services.prefs.getCharPref(
-      "browser.safebrowsing.provider." + provider + ".advisoryURL", "");
+      "browser.safebrowsing.provider." + provider + ".advisoryURL",
+      ""
+    );
     let advisoryDesc = content.document.getElementById("advisoryDescText");
     if (!advisoryUrl) {
       advisoryDesc.remove();
       return;
     }
 
     let advisoryLinkText = Services.prefs.getCharPref(
-      "browser.safebrowsing.provider." + provider + ".advisoryName", "");
+      "browser.safebrowsing.provider." + provider + ".advisoryName",
+      ""
+    );
     if (!advisoryLinkText) {
       advisoryDesc.remove();
       return;
     }
 
-    content.document.l10n.setAttributes(advisoryDesc, "safeb-palm-advisory-desc", {"advisoryname": advisoryLinkText});
-    content.document.getElementById("advisory_provider").setAttribute("href", advisoryUrl);
+    content.document.l10n.setAttributes(
+      advisoryDesc,
+      "safeb-palm-advisory-desc",
+      { advisoryname: advisoryLinkText }
+    );
+    content.document
+      .getElementById("advisory_provider")
+      .setAttribute("href", advisoryUrl);
   }
 
   onClick(event) {
     let ownerDoc = event.target.ownerDocument;
     if (!ownerDoc) {
       return;
     }
 
@@ -145,13 +200,13 @@ class BlockedSiteChild extends ActorChil
     } else if (/e=harmfulBlocked/.test(ownerDoc.documentURI)) {
       reason = "harmful";
     }
 
     this.mm.sendAsyncMessage("Browser:SiteBlockedError", {
       location: ownerDoc.location.href,
       reason,
       elementId: event.target.getAttribute("id"),
-      isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView),
+      isTopFrame: ownerDoc.defaultView.parent === ownerDoc.defaultView,
       blockedInfo: getSiteBlockedErrorDetails(ownerDoc.defaultView.docShell),
     });
   }
 }
--- a/browser/actors/BrowserTabChild.jsm
+++ b/browser/actors/BrowserTabChild.jsm
@@ -1,105 +1,108 @@
 /* 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/. */
 "use strict";
 
 var EXPORTED_SYMBOLS = ["BrowserTabChild"];
 
-ChromeUtils.defineModuleGetter(this, "E10SUtils",
-                               "resource://gre/modules/E10SUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "E10SUtils",
+  "resource://gre/modules/E10SUtils.jsm"
+);
 
 class BrowserTabChild extends JSWindowActorChild {
   constructor() {
     super();
     this.handledWindowCreated = false;
     this.handledFirstPaint = false;
   }
 
   handleEvent(event) {
     switch (event.type) {
-    case "DOMWindowCreated": {
-      if (this.handledWindowCreated) {
-        return;
-      }
-      this.handledWindowCreated = true;
+      case "DOMWindowCreated": {
+        if (this.handledWindowCreated) {
+          return;
+        }
+        this.handledWindowCreated = true;
 
-      let context = this.manager.browsingContext;
-      let loadContext = context.docShell.QueryInterface(Ci.nsILoadContext);
-      let userContextId = loadContext.originAttributes.userContextId;
+        let context = this.manager.browsingContext;
+        let loadContext = context.docShell.QueryInterface(Ci.nsILoadContext);
+        let userContextId = loadContext.originAttributes.userContextId;
 
-      this.sendAsyncMessage("Browser:WindowCreated", { userContextId });
-      break;
-    }
+        this.sendAsyncMessage("Browser:WindowCreated", { userContextId });
+        break;
+      }
 
-    case "MozAfterPaint":
-      if (this.handledFirstPaint) {
-        return;
-      }
-      this.handledFirstPaint = true;
-      this.sendAsyncMessage("Browser:FirstPaint", {});
-      break;
+      case "MozAfterPaint":
+        if (this.handledFirstPaint) {
+          return;
+        }
+        this.handledFirstPaint = true;
+        this.sendAsyncMessage("Browser:FirstPaint", {});
+        break;
 
-    case "MozDOMPointerLock:Entered":
-      this.sendAsyncMessage("PointerLock:Entered", {
-        originNoSuffix: event.target.nodePrincipal.originNoSuffix,
-      });
-      break;
+      case "MozDOMPointerLock:Entered":
+        this.sendAsyncMessage("PointerLock:Entered", {
+          originNoSuffix: event.target.nodePrincipal.originNoSuffix,
+        });
+        break;
 
-    case "MozDOMPointerLock:Exited":
-      this.sendAsyncMessage("PointerLock:Exited");
-      break;
+      case "MozDOMPointerLock:Exited":
+        this.sendAsyncMessage("PointerLock:Exited");
+        break;
     }
   }
 
   receiveMessage(message) {
     let context = this.manager.browsingContext;
     let docShell = context.docShell;
 
     switch (message.name) {
       case "Browser:AppTab":
         if (docShell) {
           docShell.isAppTab = message.data.isAppTab;
         }
         break;
 
       case "Browser:HasSiblings":
         try {
-          let browserChild = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
-                             .getInterface(Ci.nsIBrowserChild);
+          let browserChild = docShell
+            .QueryInterface(Ci.nsIInterfaceRequestor)
+            .getInterface(Ci.nsIBrowserChild);
           let hasSiblings = message.data;
           browserChild.hasSiblings = hasSiblings;
-        } catch (e) {
-        }
+        } catch (e) {}
         break;
 
       // XXX(nika): Should we try to call this in the parent process instead?
       case "Browser:Reload":
         /* First, we'll try to use the session history object to reload so
          * that framesets are handled properly. If we're in a special
          * window (such as view-source) that has no session history, fall
          * back on using the web navigation's reload method.
          */
         let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
         try {
           if (webNav.sessionHistory) {
             webNav = webNav.sessionHistory;
           }
-        } catch (e) {
-        }
+        } catch (e) {}
 
         let reloadFlags = message.data.flags;
         try {
-          E10SUtils.wrapHandlingUserInput(this.document.defaultView,
-                                          message.data.handlingUserInput,
-                                          () => webNav.reload(reloadFlags));
-        } catch (e) {
-        }
+          E10SUtils.wrapHandlingUserInput(
+            this.document.defaultView,
+            message.data.handlingUserInput,
+            () => webNav.reload(reloadFlags)
+          );
+        } catch (e) {}
         break;
 
       case "MixedContent:ReenableProtection":
         docShell.mixedContentChannel = null;
         break;
 
       case "UpdateCharacterSet":
         docShell.charset = message.data.value;
--- a/browser/actors/ClickHandlerChild.jsm
+++ b/browser/actors/ClickHandlerChild.jsm
@@ -1,41 +1,61 @@
 /* -*- 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 = ["ClickHandlerChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-ChromeUtils.defineModuleGetter(this, "BrowserUtils",
-                               "resource://gre/modules/BrowserUtils.jsm");
-ChromeUtils.defineModuleGetter(this, "PrivateBrowsingUtils",
-                               "resource://gre/modules/PrivateBrowsingUtils.jsm");
-ChromeUtils.defineModuleGetter(this, "WebNavigationFrames",
-                               "resource://gre/modules/WebNavigationFrames.jsm");
-ChromeUtils.defineModuleGetter(this, "E10SUtils",
-                               "resource://gre/modules/E10SUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "BrowserUtils",
+  "resource://gre/modules/BrowserUtils.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "PrivateBrowsingUtils",
+  "resource://gre/modules/PrivateBrowsingUtils.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "WebNavigationFrames",
+  "resource://gre/modules/WebNavigationFrames.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "E10SUtils",
+  "resource://gre/modules/E10SUtils.jsm"
+);
 
 class ClickHandlerChild extends ActorChild {
   handleEvent(event) {
-    if (!event.isTrusted || event.defaultPrevented || event.button == 2 ||
-        (event.type == "click" && event.button == 1)) {
+    if (
+      !event.isTrusted ||
+      event.defaultPrevented ||
+      event.button == 2 ||
+      (event.type == "click" && event.button == 1)
+    ) {
       return;
     }
     // Don't do anything on editable things, we shouldn't open links in
     // contenteditables, and editor needs to possibly handle middlemouse paste
     let composedTarget = event.composedTarget;
-    if (composedTarget.isContentEditable ||
-        (composedTarget.ownerDocument &&
-         composedTarget.ownerDocument.designMode == "on") ||
-        ChromeUtils.getClassName(composedTarget) == "HTMLInputElement" ||
-        ChromeUtils.getClassName(composedTarget) == "HTMLTextAreaElement") {
+    if (
+      composedTarget.isContentEditable ||
+      (composedTarget.ownerDocument &&
+        composedTarget.ownerDocument.designMode == "on") ||
+      ChromeUtils.getClassName(composedTarget) == "HTMLInputElement" ||
+      ChromeUtils.getClassName(composedTarget) == "HTMLTextAreaElement"
+    ) {
       return;
     }
 
     let originalTarget = event.originalTarget;
     let ownerDoc = originalTarget.ownerDocument;
     if (!ownerDoc) {
       return;
     }
@@ -49,59 +69,76 @@ class ClickHandlerChild extends ActorChi
 
     let [href, node, principal] = this._hrefAndLinkNodeForClickEvent(event);
 
     let csp = ownerDoc.csp;
     if (csp) {
       csp = E10SUtils.serializeCSP(csp);
     }
 
-    let referrerInfo = Cc["@mozilla.org/referrer-info;1"].createInstance(Ci.nsIReferrerInfo);
+    let referrerInfo = Cc["@mozilla.org/referrer-info;1"].createInstance(
+      Ci.nsIReferrerInfo
+    );
     if (node) {
       referrerInfo.initWithNode(node);
     } else {
       referrerInfo.initWithDocument(ownerDoc);
     }
     referrerInfo = E10SUtils.serializeReferrerInfo(referrerInfo);
-    let frameOuterWindowID = WebNavigationFrames.getFrameId(ownerDoc.defaultView);
+    let frameOuterWindowID = WebNavigationFrames.getFrameId(
+      ownerDoc.defaultView
+    );
 
-    let json = { button: event.button, shiftKey: event.shiftKey,
-                 ctrlKey: event.ctrlKey, metaKey: event.metaKey,
-                 altKey: event.altKey, href: null, title: null,
-                 frameOuterWindowID,
-                 triggeringPrincipal: principal,
-                 csp,
-                 referrerInfo,
-                 originAttributes: principal ? principal.originAttributes : {},
-                 isContentWindowPrivate: PrivateBrowsingUtils.isContentWindowPrivate(ownerDoc.defaultView)};
+    let json = {
+      button: event.button,
+      shiftKey: event.shiftKey,
+      ctrlKey: event.ctrlKey,
+      metaKey: event.metaKey,
+      altKey: event.altKey,
+      href: null,
+      title: null,
+      frameOuterWindowID,
+      triggeringPrincipal: principal,
+      csp,
+      referrerInfo,
+      originAttributes: principal ? principal.originAttributes : {},
+      isContentWindowPrivate: PrivateBrowsingUtils.isContentWindowPrivate(
+        ownerDoc.defaultView
+      ),
+    };
 
     if (href) {
       try {
         BrowserUtils.urlSecurityCheck(href, principal);
       } catch (e) {
         return;
       }
 
       json.href = href;
       if (node) {
         json.title = node.getAttribute("title");
       }
 
-
       // Check if the link needs to be opened with mixed content allowed.
       // Only when the owner doc has |mixedContentChannel| and the same origin
       // should we allow mixed content.
       json.allowMixedContent = false;
       let docshell = ownerDoc.defaultView.docShell;
       if (this.mm.docShell.mixedContentChannel) {
         const sm = Services.scriptSecurityManager;
         try {
           let targetURI = Services.io.newURI(href);
-          let isPrivateWin = ownerDoc.nodePrincipal.originAttributes.privateBrowsingId > 0;
-          sm.checkSameOriginURI(docshell.mixedContentChannel.URI, targetURI, false, isPrivateWin);
+          let isPrivateWin =
+            ownerDoc.nodePrincipal.originAttributes.privateBrowsingId > 0;
+          sm.checkSameOriginURI(
+            docshell.mixedContentChannel.URI,
+            targetURI,
+            false,
+            isPrivateWin
+          );
           json.allowMixedContent = true;
         } catch (e) {}
       }
       json.originPrincipal = ownerDoc.nodePrincipal;
       json.originStoragePrincipal = ownerDoc.effectiveStoragePrincipal;
       json.triggeringPrincipal = ownerDoc.nodePrincipal;
 
       // If a link element is clicked with middle button, user wants to open
@@ -131,48 +168,57 @@ class ClickHandlerChild extends ActorChi
    *        The click event.
    * @return [href, linkNode, linkPrincipal].
    *
    * @note linkNode will be null if the click wasn't on an anchor
    *       element. This includes SVG links, because callers expect |node|
    *       to behave like an <a> element, which SVG links (XLink) don't.
    */
   _hrefAndLinkNodeForClickEvent(event) {
-    let {content} = this.mm;
+    let { content } = this.mm;
     function isHTMLLink(aNode) {
       // Be consistent with what nsContextMenu.js does.
-      return ((aNode instanceof content.HTMLAnchorElement && aNode.href) ||
-              (aNode instanceof content.HTMLAreaElement && aNode.href) ||
-              aNode instanceof content.HTMLLinkElement);
+      return (
+        (aNode instanceof content.HTMLAnchorElement && aNode.href) ||
+        (aNode instanceof content.HTMLAreaElement && aNode.href) ||
+        aNode instanceof content.HTMLLinkElement
+      );
     }
 
     let node = event.composedTarget;
     while (node && !isHTMLLink(node)) {
       node = node.flattenedTreeParentNode;
     }
 
-    if (node)
+    if (node) {
       return [node.href, node, node.ownerDocument.nodePrincipal];
+    }
 
     // If there is no linkNode, try simple XLink.
     let href, baseURI;
     node = event.composedTarget;
     while (node && !href) {
-      if (node.nodeType == content.Node.ELEMENT_NODE &&
-          (node.localName == "a" ||
-           node.namespaceURI == "http://www.w3.org/1998/Math/MathML")) {
-        href = node.getAttribute("href") ||
-               node.getAttributeNS("http://www.w3.org/1999/xlink", "href");
+      if (
+        node.nodeType == content.Node.ELEMENT_NODE &&
+        (node.localName == "a" ||
+          node.namespaceURI == "http://www.w3.org/1998/Math/MathML")
+      ) {
+        href =
+          node.getAttribute("href") ||
+          node.getAttributeNS("http://www.w3.org/1999/xlink", "href");
         if (href) {
           baseURI = node.ownerDocument.baseURIObject;
           break;
         }
       }
       node = node.flattenedTreeParentNode;
     }
 
     // In case of XLink, we don't return the node we got href from since
     // callers expect <a>-like elements.
     // Note: makeURI() will throw if aUri is not a valid URI.
-    return [href ? Services.io.newURI(href, null, baseURI).spec : null, null,
-            node && node.ownerDocument.nodePrincipal];
+    return [
+      href ? Services.io.newURI(href, null, baseURI).spec : null,
+      null,
+      node && node.ownerDocument.nodePrincipal,
+    ];
   }
 }
--- a/browser/actors/ContentSearchChild.jsm
+++ b/browser/actors/ContentSearchChild.jsm
@@ -1,17 +1,19 @@
 /* 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/. */
 "use strict";
 
 var EXPORTED_SYMBOLS = ["ContentSearchChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
 
 class ContentSearchChild extends ActorChild {
   handleEvent(event) {
     this._sendMsg(event.detail.type, event.detail.data);
   }
 
   receiveMessage(msg) {
     this._fireEvent(msg.data.type, msg.data.data);
@@ -20,18 +22,22 @@ class ContentSearchChild extends ActorCh
   _sendMsg(type, data = null) {
     this.mm.sendAsyncMessage("ContentSearch", {
       type,
       data,
     });
   }
 
   _fireEvent(type, data = null) {
-    let event = Cu.cloneInto({
-      detail: {
-        type,
-        data,
+    let event = Cu.cloneInto(
+      {
+        detail: {
+          type,
+          data,
+        },
       },
-    }, this.content);
-    this.content.dispatchEvent(new this.content.CustomEvent("ContentSearchService",
-                                                            event));
+      this.content
+    );
+    this.content.dispatchEvent(
+      new this.content.CustomEvent("ContentSearchService", event)
+    );
   }
 }
--- a/browser/actors/ContextMenuChild.jsm
+++ b/browser/actors/ContextMenuChild.jsm
@@ -3,30 +3,33 @@
 /* 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 = ["ContextMenuChild"];
 
-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.defineLazyGlobalGetters(this, ["URL"]);
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   E10SUtils: "resource://gre/modules/E10SUtils.jsm",
   BrowserUtils: "resource://gre/modules/BrowserUtils.jsm",
   findAllCssSelectors: "resource://gre/modules/css-selector.js",
   SpellCheckHelper: "resource://gre/modules/InlineSpellChecker.jsm",
   LoginManagerContent: "resource://gre/modules/LoginManagerContent.jsm",
   WebNavigationFrames: "resource://gre/modules/WebNavigationFrames.jsm",
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
-  InlineSpellCheckerContent: "resource://gre/modules/InlineSpellCheckerContent.jsm",
+  InlineSpellCheckerContent:
+    "resource://gre/modules/InlineSpellCheckerContent.jsm",
   ContentDOMReference: "resource://gre/modules/ContentDOMReference.jsm",
 });
 
 XPCOMUtils.defineLazyGetter(this, "PageMenuChild", () => {
   let tmp = {};
   ChromeUtils.import("resource://gre/modules/PageMenu.jsm", tmp);
   return new tmp.PageMenuChild();
 });
@@ -41,18 +44,21 @@ class ContextMenuChild extends JSWindowA
     this.target = null;
     this.context = null;
     this.lastMenuTarget = null;
   }
 
   static getTarget(browsingContext, message, key) {
     let actor = contextMenus.get(browsingContext);
     if (!actor) {
-      throw new Error("Can't find ContextMenu actor for browsing context with " +
-                      "ID: " + browsingContext.id);
+      throw new Error(
+        "Can't find ContextMenu actor for browsing context with " +
+          "ID: " +
+          browsingContext.id
+      );
     }
     return actor.getTarget(message, key);
   }
 
   static getLastTarget(browsingContext) {
     let contextMenu = contextMenus.get(browsingContext);
     return contextMenu && contextMenu.lastMenuTarget;
   }
@@ -86,18 +92,22 @@ class ContextMenuChild extends JSWindowA
       case "ContextMenu:Hiding": {
         this.context = null;
         this.target = null;
         break;
       }
 
       case "ContextMenu:MediaCommand": {
         E10SUtils.wrapHandlingUserInput(
-          this.contentWindow, message.data.handlingUserInput, () => {
-            let media = ContentDOMReference.resolve(message.data.targetIdentifier);
+          this.contentWindow,
+          message.data.handlingUserInput,
+          () => {
+            let media = ContentDOMReference.resolve(
+              message.data.targetIdentifier
+            );
 
             switch (message.data.command) {
               case "play":
                 media.play();
                 break;
               case "pause":
                 media.pause();
                 break;
@@ -120,20 +130,28 @@ class ContextMenuChild extends JSWindowA
                 media.setAttribute("controls", "true");
                 break;
               case "fullscreen":
                 if (this.document.fullscreenEnabled) {
                   media.requestFullscreen();
                 }
                 break;
               case "pictureinpicture":
-                Services.telemetry.keyedScalarAdd("pictureinpicture.opened_method", "contextmenu", 1);
-                let event = new this.contentWindow.CustomEvent("MozTogglePictureInPicture", {
-                  bubbles: true,
-                }, this.contentWindow);
+                Services.telemetry.keyedScalarAdd(
+                  "pictureinpicture.opened_method",
+                  "contextmenu",
+                  1
+                );
+                let event = new this.contentWindow.CustomEvent(
+                  "MozTogglePictureInPicture",
+                  {
+                    bubbles: true,
+                  },
+                  this.contentWindow
+                );
                 media.dispatchEvent(event);
                 break;
             }
           }
         );
         break;
       }
 
@@ -148,55 +166,63 @@ class ContextMenuChild extends JSWindowA
 
         if (image instanceof Ci.nsIImageLoadingContent) {
           image.forceReload();
         }
         break;
       }
 
       case "ContextMenu:SearchFieldBookmarkData": {
-        let node =  ContentDOMReference.resolve(message.data.targetIdentifier);
+        let node = ContentDOMReference.resolve(message.data.targetIdentifier);
         let charset = node.ownerDocument.characterSet;
         let formBaseURI = Services.io.newURI(node.form.baseURI, charset);
-        let formURI = Services.io.newURI(node.form.getAttribute("action"),
-                                         charset, formBaseURI);
+        let formURI = Services.io.newURI(
+          node.form.getAttribute("action"),
+          charset,
+          formBaseURI
+        );
         let spec = formURI.spec;
-        let isURLEncoded =  (node.form.method.toUpperCase() == "POST" &&
-                             (node.form.enctype == "application/x-www-form-urlencoded" ||
-                              node.form.enctype == ""));
+        let isURLEncoded =
+          node.form.method.toUpperCase() == "POST" &&
+          (node.form.enctype == "application/x-www-form-urlencoded" ||
+            node.form.enctype == "");
         let title = node.ownerDocument.title;
 
         function escapeNameValuePair([aName, aValue]) {
           if (isURLEncoded) {
             return escape(aName + "=" + aValue);
           }
 
           return escape(aName) + "=" + escape(aValue);
         }
         let formData = new this.contentWindow.FormData(node.form);
         formData.delete(node.name);
         formData = Array.from(formData).map(escapeNameValuePair);
-        formData.push(escape(node.name) + (isURLEncoded ? escape("=%s") : "=%s"));
+        formData.push(
+          escape(node.name) + (isURLEncoded ? escape("=%s") : "=%s")
+        );
 
         let postData;
 
         if (isURLEncoded) {
           postData = formData.join("&");
         } else {
           let separator = spec.includes("?") ? "&" : "?";
           spec += separator + formData.join("&");
         }
 
         return Promise.resolve({ spec, title, postData, charset });
       }
 
       case "ContextMenu:SaveVideoFrameAsImage": {
         let video = ContentDOMReference.resolve(message.data.targetIdentifier);
-        let canvas = this.document.createElementNS("http://www.w3.org/1999/xhtml",
-                                                   "canvas");
+        let canvas = this.document.createElementNS(
+          "http://www.w3.org/1999/xhtml",
+          "canvas"
+        );
         canvas.width = video.videoWidth;
         canvas.height = video.videoHeight;
 
         let ctxDraw = canvas.getContext("2d");
         ctxDraw.drawImage(video, 0, 0);
 
         return Promise.resolve(canvas.toDataURL("image/jpeg", ""));
       }
@@ -205,33 +231,39 @@ class ContextMenuChild extends JSWindowA
         let target = ContentDOMReference.resolve(message.data.targetIdentifier);
 
         // Paranoia: check disableSetDesktopBackground again, in case the
         // image changed since the context menu was initiated.
         let disable = this._disableSetDesktopBackground(target);
 
         if (!disable) {
           try {
-            BrowserUtils.urlSecurityCheck(target.currentURI.spec,
-                                          target.ownerDocument.nodePrincipal);
+            BrowserUtils.urlSecurityCheck(
+              target.currentURI.spec,
+              target.ownerDocument.nodePrincipal
+            );
             let canvas = this.document.createElement("canvas");
             canvas.width = target.naturalWidth;
             canvas.height = target.naturalHeight;
             let ctx = canvas.getContext("2d");
             ctx.drawImage(target, 0, 0);
             let dataURL = canvas.toDataURL();
-            let url = (new URL(target.ownerDocument.location.href)).pathname;
+            let url = new URL(target.ownerDocument.location.href).pathname;
             let imageName = url.substr(url.lastIndexOf("/") + 1);
             return Promise.resolve({ failed: false, dataURL, imageName });
           } catch (e) {
             Cu.reportError(e);
           }
         }
 
-        return Promise.resolve({ failed: true, dataURL: null, imageName: null });
+        return Promise.resolve({
+          failed: true,
+          dataURL: null,
+          imageName: null,
+        });
       }
     }
 
     return undefined;
   }
 
   /**
    * Returns the event target of the context menu, using a locally stored
@@ -242,53 +274,57 @@ class ContextMenuChild extends JSWindowA
    * @return {Object}          Context menu target
    */
   getTarget(aMessage, aKey = "target") {
     return this.target || (aMessage.objects && aMessage.objects[aKey]);
   }
 
   // PRIVATE
   _isXULTextLinkLabel(aNode) {
-    const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-    return aNode.namespaceURI == XUL_NS &&
-           aNode.tagName == "label" &&
-           aNode.classList.contains("text-link") &&
-           aNode.href;
+    const XUL_NS =
+      "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+    return (
+      aNode.namespaceURI == XUL_NS &&
+      aNode.tagName == "label" &&
+      aNode.classList.contains("text-link") &&
+      aNode.href
+    );
   }
 
   // Generate fully qualified URL for clicked-on link.
   _getLinkURL() {
     let href = this.context.link.href;
 
     if (href) {
       // Handle SVG links:
       if (typeof href == "object" && href.animVal) {
         return this._makeURLAbsolute(this.context.link.baseURI, href.animVal);
       }
 
       return href;
     }
 
-    href = this.context.link.getAttribute("href") ||
-           this.context.link.getAttributeNS("http://www.w3.org/1999/xlink", "href");
+    href =
+      this.context.link.getAttribute("href") ||
+      this.context.link.getAttributeNS("http://www.w3.org/1999/xlink", "href");
 
     if (!href || !href.match(/\S/)) {
       // Without this we try to save as the current doc,
       // for example, HTML case also throws if empty
       throw new Error("Empty href");
     }
 
     return this._makeURLAbsolute(this.context.link.baseURI, href);
   }
 
   _getLinkURI() {
     try {
       return Services.io.newURI(this.context.linkURL);
     } catch (ex) {
-     // e.g. empty URL string
+      // e.g. empty URL string
     }
 
     return null;
   }
 
   // Get text of link.
   _getLinkText() {
     let text = this._gatherTextUnder(this.context.link);
@@ -313,37 +349,41 @@ class ContextMenuChild extends JSWindowA
 
     return null;
   }
 
   // Returns true if clicked-on link targets a resource that can be saved.
   _isLinkSaveable(aLink) {
     // We don't do the Right Thing for news/snews yet, so turn them off
     // until we do.
-    return this.context.linkProtocol && !(
-           this.context.linkProtocol == "mailto" ||
-           this.context.linkProtocol == "javascript" ||
-           this.context.linkProtocol == "news" ||
-           this.context.linkProtocol == "snews");
+    return (
+      this.context.linkProtocol &&
+      !(
+        this.context.linkProtocol == "mailto" ||
+        this.context.linkProtocol == "javascript" ||
+        this.context.linkProtocol == "news" ||
+        this.context.linkProtocol == "snews"
+      )
+    );
   }
 
   // Gather all descendent text under given document node.
   _gatherTextUnder(root) {
     let text = "";
     let node = root.firstChild;
     let depth = 1;
     while (node && depth > 0) {
       // See if this node is text.
       if (node.nodeType == node.TEXT_NODE) {
         // Add this text to our collection.
         text += " " + node.data;
       } else if (node instanceof this.contentWindow.HTMLImageElement) {
         // If it has an "alt" attribute, add that.
-        let altText = node.getAttribute( "alt" );
-        if ( altText && altText != "" ) {
+        let altText = node.getAttribute("alt");
+        if (altText && altText != "") {
           text += " " + altText;
         }
       }
       // Find next node to test.
       // First, see if this node has children.
       if (node.hasChildNodes()) {
         // Go to first child.
         node = node.firstChild;
@@ -382,34 +422,37 @@ class ContextMenuChild extends JSWindowA
     return urls[0];
   }
 
   _makeURLAbsolute(aBase, aUrl) {
     return Services.io.newURI(aUrl, null, Services.io.newURI(aBase)).spec;
   }
 
   _isProprietaryDRM() {
-    return this.context.target.isEncrypted && this.context.target.mediaKeys &&
-           this.context.target.mediaKeys.keySystem != "org.w3.clearkey";
+    return (
+      this.context.target.isEncrypted &&
+      this.context.target.mediaKeys &&
+      this.context.target.mediaKeys.keySystem != "org.w3.clearkey"
+    );
   }
 
   _isMediaURLReusable(aURL) {
     if (aURL.startsWith("blob:")) {
       return URL.isValidURL(aURL);
     }
 
     return true;
   }
 
   _isTargetATextBox(node) {
     if (node instanceof this.contentWindow.HTMLInputElement) {
       return node.mozIsTextField(false);
     }
 
-    return (node instanceof this.contentWindow.HTMLTextAreaElement);
+    return node instanceof this.contentWindow.HTMLTextAreaElement;
   }
 
   _isSpellCheckEnabled(aNode) {
     // We can always force-enable spellchecking on textboxes
     if (this._isTargetATextBox(aNode)) {
       return true;
     }
 
@@ -430,17 +473,17 @@ class ContextMenuChild extends JSWindowA
 
   _disableSetDesktopBackground(aTarget) {
     // Disable the Set as Desktop Background menu item if we're still trying
     // to load the image or the load failed.
     if (!(aTarget instanceof Ci.nsIImageLoadingContent)) {
       return true;
     }
 
-    if (("complete" in aTarget) && !aTarget.complete) {
+    if ("complete" in aTarget && !aTarget.complete) {
       return true;
     }
 
     if (aTarget.currentURI.schemeIs("javascript")) {
       return true;
     }
 
     let request = aTarget.getRequest(Ci.nsIImageLoadingContent.CURRENT_REQUEST);
@@ -456,20 +499,25 @@ class ContextMenuChild extends JSWindowA
     contextMenus.set(this.browsingContext, this);
 
     let defaultPrevented = aEvent.defaultPrevented;
 
     if (!Services.prefs.getBoolPref("dom.event.contextmenu.enabled")) {
       let plugin = null;
 
       try {
-        plugin = aEvent.composedTarget.QueryInterface(Ci.nsIObjectLoadingContent);
+        plugin = aEvent.composedTarget.QueryInterface(
+          Ci.nsIObjectLoadingContent
+        );
       } catch (e) {}
 
-      if (plugin && plugin.displayedType == Ci.nsIObjectLoadingContent.TYPE_PLUGIN) {
+      if (
+        plugin &&
+        plugin.displayedType == Ci.nsIObjectLoadingContent.TYPE_PLUGIN
+      ) {
         // Don't open a context menu for plugins.
         return;
       }
 
       defaultPrevented = false;
     }
 
     if (defaultPrevented) {
@@ -479,45 +527,57 @@ class ContextMenuChild extends JSWindowA
     let doc = aEvent.composedTarget.ownerDocument;
     let {
       mozDocumentURIIfNotForErrorPages: docLocation,
       characterSet: charSet,
       baseURI,
     } = doc;
     docLocation = docLocation && docLocation.spec;
     let frameOuterWindowID = WebNavigationFrames.getFrameId(doc.defaultView);
-    let loginFillInfo = LoginManagerContent.getFieldContext(aEvent.composedTarget);
+    let loginFillInfo = LoginManagerContent.getFieldContext(
+      aEvent.composedTarget
+    );
 
     // The same-origin check will be done in nsContextMenu.openLinkInTab.
     let parentAllowsMixedContent = !!this.docShell.mixedContentChannel;
 
     let disableSetDesktopBackground = null;
 
     // Media related cache info parent needs for saving
     let contentType = null;
     let contentDisposition = null;
-    if (aEvent.composedTarget.nodeType == aEvent.composedTarget.ELEMENT_NODE &&
-        aEvent.composedTarget instanceof Ci.nsIImageLoadingContent &&
-        aEvent.composedTarget.currentURI) {
-      disableSetDesktopBackground =
-        this._disableSetDesktopBackground(aEvent.composedTarget);
+    if (
+      aEvent.composedTarget.nodeType == aEvent.composedTarget.ELEMENT_NODE &&
+      aEvent.composedTarget instanceof Ci.nsIImageLoadingContent &&
+      aEvent.composedTarget.currentURI
+    ) {
+      disableSetDesktopBackground = this._disableSetDesktopBackground(
+        aEvent.composedTarget
+      );
 
       try {
-        let imageCache = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools)
-                                                         .getImgCacheForDocument(doc);
+        let imageCache = Cc["@mozilla.org/image/tools;1"]
+          .getService(Ci.imgITools)
+          .getImgCacheForDocument(doc);
         // The image cache's notion of where this image is located is
         // the currentURI of the image loading content.
-        let props = imageCache.findEntryProperties(aEvent.composedTarget.currentURI, doc);
+        let props = imageCache.findEntryProperties(
+          aEvent.composedTarget.currentURI,
+          doc
+        );
 
         try {
           contentType = props.get("type", Ci.nsISupportsCString).data;
         } catch (e) {}
 
         try {
-          contentDisposition = props.get("content-disposition", Ci.nsISupportsCString).data;
+          contentDisposition = props.get(
+            "content-disposition",
+            Ci.nsISupportsCString
+          ).data;
         } catch (e) {}
       } catch (e) {}
     }
 
     let selectionInfo = BrowserUtils.getSelectionDetails(this.contentWindow);
     let loadContext = this.docShell.QueryInterface(Ci.nsILoadContext);
     let userContextId = loadContext.originAttributes.userContextId;
     let popupNodeSelectors = findAllCssSelectors(aEvent.composedTarget);
@@ -526,36 +586,48 @@ class ContextMenuChild extends JSWindowA
     let context = this.context;
     this.target = context.target;
 
     let spellInfo = null;
     let editFlags = null;
     let principal = null;
     let customMenuItems = null;
 
-    let referrerInfo = Cc["@mozilla.org/referrer-info;1"].createInstance(Ci.nsIReferrerInfo);
-    referrerInfo.initWithNode(context.onLink ? context.link : aEvent.composedTarget);
+    let referrerInfo = Cc["@mozilla.org/referrer-info;1"].createInstance(
+      Ci.nsIReferrerInfo
+    );
+    referrerInfo.initWithNode(
+      context.onLink ? context.link : aEvent.composedTarget
+    );
     referrerInfo = E10SUtils.serializeReferrerInfo(referrerInfo);
 
     let target = context.target;
     if (target) {
       this._cleanContext();
     }
 
-    editFlags = SpellCheckHelper.isEditable(aEvent.composedTarget, this.contentWindow);
+    editFlags = SpellCheckHelper.isEditable(
+      aEvent.composedTarget,
+      this.contentWindow
+    );
 
     if (editFlags & SpellCheckHelper.SPELLCHECKABLE) {
-      spellInfo = InlineSpellCheckerContent.initContextMenu(aEvent, editFlags, this);
+      spellInfo = InlineSpellCheckerContent.initContextMenu(
+        aEvent,
+        editFlags,
+        this
+      );
     }
 
     // Set the event target first as the copy image command needs it to
     // determine what was context-clicked on. Then, update the state of the
     // commands on the context menu.
-    this.docShell.contentViewer.QueryInterface(Ci.nsIContentViewerEdit)
-        .setCommandNode(aEvent.composedTarget);
+    this.docShell.contentViewer
+      .QueryInterface(Ci.nsIContentViewerEdit)
+      .setCommandNode(aEvent.composedTarget);
     aEvent.composedTarget.ownerGlobal.updateCommands("contentcontextmenu");
 
     let data = {
       context,
       charSet,
       baseURI,
       referrerInfo,
       editFlags,
@@ -577,24 +649,31 @@ class ContextMenuChild extends JSWindowA
     if (context.inFrame && !context.inSrcdocFrame) {
       data.frameReferrerInfo = doc.referrerInfo;
     }
 
     if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
       data.customMenuItems = PageMenuChild.build(aEvent.composedTarget);
     }
 
-    Services.obs.notifyObservers({wrappedJSObject: data}, "on-prepare-contextmenu");
+    Services.obs.notifyObservers(
+      { wrappedJSObject: data },
+      "on-prepare-contextmenu"
+    );
 
     // For now, JS Window Actors don't serialize Principals automatically, so we
     // have to do it ourselves. See bug 1557852.
     data.principal = E10SUtils.serializePrincipal(doc.nodePrincipal);
     data.context.principal = E10SUtils.serializePrincipal(context.principal);
-    data.storagePrincipal = E10SUtils.serializePrincipal(doc.effectiveStoragePrincipal);
-    data.context.storagePrincipal = E10SUtils.serializePrincipal(context.storagePrincipal);
+    data.storagePrincipal = E10SUtils.serializePrincipal(
+      doc.effectiveStoragePrincipal
+    );
+    data.context.storagePrincipal = E10SUtils.serializePrincipal(
+      context.storagePrincipal
+    );
 
     // In the event that the content is running in the parent process, we don't
     // actually want the contextmenu events to reach the parent - we'll dispatch
     // a new contextmenu event after the async message has reached the parent
     // instead.
     aEvent.stopPropagation();
 
     this.sendAsyncMessage("contextmenu", data);
@@ -615,17 +694,19 @@ class ContextMenuChild extends JSWindowA
       // used for nsContextMenu.initLeaveDOMFullScreenItems and
       // nsContextMenu.initMediaPlayerItems
       fullscreen: context.target.ownerDocument.fullscreen,
 
       // used for nsContextMenu.initMiscItems
       contentType: context.target.ownerDocument.contentType,
 
       // used for nsContextMenu.saveLink
-      isPrivate: PrivateBrowsingUtils.isContentWindowPrivate(context.target.ownerGlobal),
+      isPrivate: PrivateBrowsingUtils.isContentWindowPrivate(
+        context.target.ownerGlobal
+      ),
     };
 
     // used for nsContextMenu.initMediaPlayerItems
     Object.assign(cleanTarget, {
       ended: context.target.ended,
       muted: context.target.muted,
       paused: context.target.paused,
       controls: context.target.controls,
@@ -672,104 +753,116 @@ class ContextMenuChild extends JSWindowA
     let node = aEvent.composedTarget;
 
     // Set the node to containing <video>/<audio>/<embed>/<object> if the node
     // is in the videocontrols/pluginProblem UA Widget.
     if (this.contentWindow.ShadowRoot) {
       let n = node;
       while (n) {
         if (n instanceof this.contentWindow.ShadowRoot) {
-          if (n.host instanceof this.contentWindow.HTMLMediaElement ||
-              n.host instanceof this.contentWindow.HTMLEmbedElement ||
-              n.host instanceof this.contentWindow.HTMLObjectElement) {
+          if (
+            n.host instanceof this.contentWindow.HTMLMediaElement ||
+            n.host instanceof this.contentWindow.HTMLEmbedElement ||
+            n.host instanceof this.contentWindow.HTMLObjectElement
+          ) {
             node = n.host;
             break;
           }
           break;
         }
         n = n.parentNode;
       }
     }
 
-    const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+    const XUL_NS =
+      "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
     context.shouldDisplay = true;
 
-    if (node.nodeType == node.DOCUMENT_NODE ||
-        // Don't display for XUL element unless <label class="text-link">
-        (node.namespaceURI == XUL_NS && !this._isXULTextLinkLabel(node))) {
+    if (
+      node.nodeType == node.DOCUMENT_NODE ||
+      // Don't display for XUL element unless <label class="text-link">
+      (node.namespaceURI == XUL_NS && !this._isXULTextLinkLabel(node))
+    ) {
       context.shouldDisplay = false;
       return;
     }
 
-    const isAboutDevtoolsToolbox =
-          this.document.documentURI.startsWith("about:devtools-toolbox");
+    const isAboutDevtoolsToolbox = this.document.documentURI.startsWith(
+      "about:devtools-toolbox"
+    );
     const editFlags = SpellCheckHelper.isEditable(node, this.contentWindow);
 
-    if (isAboutDevtoolsToolbox && (editFlags & SpellCheckHelper.TEXTINPUT) === 0) {
+    if (
+      isAboutDevtoolsToolbox &&
+      (editFlags & SpellCheckHelper.TEXTINPUT) === 0
+    ) {
       // Don't display for about:devtools-toolbox page unless the source was text input.
       context.shouldDisplay = false;
       return;
     }
 
     // Initialize context to be sent to nsContextMenu
     // Keep this consistent with the similar code in nsContextMenu's setContext
-    context.bgImageURL          = "";
-    context.imageDescURL        = "";
-    context.imageInfo           = null;
-    context.mediaURL            = "";
-    context.webExtBrowserType   = "";
+    context.bgImageURL = "";
+    context.imageDescURL = "";
+    context.imageInfo = null;
+    context.mediaURL = "";
+    context.webExtBrowserType = "";
 
-    context.canSpellCheck       = false;
-    context.hasBGImage          = false;
+    context.canSpellCheck = false;
+    context.hasBGImage = false;
     context.hasMultipleBGImages = false;
-    context.isDesignMode        = false;
-    context.inFrame             = false;
-    context.inSrcdocFrame       = false;
-    context.inSyntheticDoc      = false;
-    context.inTabBrowser        = true;
-    context.inWebExtBrowser     = false;
+    context.isDesignMode = false;
+    context.inFrame = false;
+    context.inSrcdocFrame = false;
+    context.inSyntheticDoc = false;
+    context.inTabBrowser = true;
+    context.inWebExtBrowser = false;
 
-    context.link                = null;
-    context.linkDownload        = "";
-    context.linkProtocol        = "";
-    context.linkTextStr         = "";
-    context.linkURL             = "";
-    context.linkURI             = null;
+    context.link = null;
+    context.linkDownload = "";
+    context.linkProtocol = "";
+    context.linkTextStr = "";
+    context.linkURL = "";
+    context.linkURI = null;
 
-    context.onAudio             = false;
-    context.onCanvas            = false;
-    context.onCompletedImage    = false;
-    context.onCTPPlugin         = false;
-    context.onDRMMedia          = false;
-    context.onPiPVideo          = false;
-    context.onEditable          = false;
-    context.onImage             = false;
-    context.onKeywordField      = false;
-    context.onLink              = false;
-    context.onLoadedImage       = false;
-    context.onMailtoLink        = false;
-    context.onMozExtLink        = false;
-    context.onNumeric           = false;
-    context.onPassword          = false;
-    context.onSaveableLink      = false;
-    context.onSpellcheckable    = false;
-    context.onTextInput         = false;
-    context.onVideo             = false;
+    context.onAudio = false;
+    context.onCanvas = false;
+    context.onCompletedImage = false;
+    context.onCTPPlugin = false;
+    context.onDRMMedia = false;
+    context.onPiPVideo = false;
+    context.onEditable = false;
+    context.onImage = false;
+    context.onKeywordField = false;
+    context.onLink = false;
+    context.onLoadedImage = false;
+    context.onMailtoLink = false;
+    context.onMozExtLink = false;
+    context.onNumeric = false;
+    context.onPassword = false;
+    context.onSaveableLink = false;
+    context.onSpellcheckable = false;
+    context.onTextInput = false;
+    context.onVideo = false;
 
     // Remember the node and its owner document that was clicked
     // This may be modifed before sending to nsContextMenu
     context.target = node;
     context.targetIdentifier = ContentDOMReference.get(node);
 
     context.principal = context.target.ownerDocument.nodePrincipal;
-    context.storagePrincipal = context.target.ownerDocument.effectiveStoragePrincipal;
+    context.storagePrincipal =
+      context.target.ownerDocument.effectiveStoragePrincipal;
     context.csp = E10SUtils.serializeCSP(context.target.ownerDocument.csp);
 
-    context.frameOuterWindowID = WebNavigationFrames.getFrameId(context.target.ownerGlobal);
+    context.frameOuterWindowID = WebNavigationFrames.getFrameId(
+      context.target.ownerGlobal
+    );
 
     // Check if we are in a synthetic document (stand alone image, video, etc.).
     context.inSyntheticDoc = context.target.ownerDocument.mozSyntheticDocument;
 
     context.shouldInitInlineSpellCheckerUINoChildren = false;
     context.shouldInitInlineSpellCheckerUIWithChildren = false;
 
     this._setContextForNodesNoChildren(editFlags);
@@ -799,64 +892,74 @@ class ContextMenuChild extends JSWindowA
    * @param {Integer} editFlags The edit flags for the node. See SpellCheckHelper
    *                            for the details.
    */
   _setContextForNodesNoChildren(editFlags) {
     const context = this.context;
 
     if (context.target.nodeType == context.target.TEXT_NODE) {
       // For text nodes, look at the parent node to determine the spellcheck attribute.
-      context.canSpellCheck = context.target.parentNode &&
-                              this._isSpellCheckEnabled(context.target);
+      context.canSpellCheck =
+        context.target.parentNode && this._isSpellCheckEnabled(context.target);
       return;
     }
 
     // We only deal with TEXT_NODE and ELEMENT_NODE in this function, so return
     // early if we don't have one.
     if (context.target.nodeType != context.target.ELEMENT_NODE) {
       return;
     }
 
     // See if the user clicked on an image. This check mirrors
     // nsDocumentViewer::GetInImage. Make sure to update both if this is
     // changed.
-    if (context.target instanceof Ci.nsIImageLoadingContent &&
-        (context.target.currentRequestFinalURI || context.target.currentURI)) {
+    if (
+      context.target instanceof Ci.nsIImageLoadingContent &&
+      (context.target.currentRequestFinalURI || context.target.currentURI)
+    ) {
       context.onImage = true;
 
       context.imageInfo = {
         currentSrc: context.target.currentSrc,
         width: context.target.width,
         height: context.target.height,
         imageText: context.target.title || context.target.alt,
       };
 
-      const request = context.target.getRequest(Ci.nsIImageLoadingContent.CURRENT_REQUEST);
+      const request = context.target.getRequest(
+        Ci.nsIImageLoadingContent.CURRENT_REQUEST
+      );
 
-      if (request && (request.imageStatus & request.STATUS_SIZE_AVAILABLE)) {
+      if (request && request.imageStatus & request.STATUS_SIZE_AVAILABLE) {
         context.onLoadedImage = true;
       }
 
-      if (request &&
-          (request.imageStatus & request.STATUS_LOAD_COMPLETE) &&
-          !(request.imageStatus & request.STATUS_ERROR)) {
+      if (
+        request &&
+        request.imageStatus & request.STATUS_LOAD_COMPLETE &&
+        !(request.imageStatus & request.STATUS_ERROR)
+      ) {
         context.onCompletedImage = true;
       }
 
       // The actual URL the image was loaded from (after redirects) is the
       // currentRequestFinalURI.  We should use that as the URL for purposes of
       // deciding on the filename, if it is present. It might not be present
       // if images are blocked.
-      context.mediaURL = (context.target.currentRequestFinalURI || context.target.currentURI).spec;
+      context.mediaURL = (
+        context.target.currentRequestFinalURI || context.target.currentURI
+      ).spec;
 
       const descURL = context.target.getAttribute("longdesc");
 
       if (descURL) {
-        context.imageDescURL = this._makeURLAbsolute(context.target.ownerDocument.body.baseURI,
-                                                    descURL);
+        context.imageDescURL = this._makeURLAbsolute(
+          context.target.ownerDocument.body.baseURI,
+          descURL
+        );
       }
     } else if (context.target instanceof this.contentWindow.HTMLCanvasElement) {
       context.onCanvas = true;
     } else if (context.target instanceof this.contentWindow.HTMLVideoElement) {
       const mediaURL = context.target.currentSrc || context.target.src;
 
       if (this._isMediaURLReusable(mediaURL)) {
         context.mediaURL = mediaURL;
@@ -868,70 +971,82 @@ class ContextMenuChild extends JSWindowA
 
       if (context.target.isCloningElementVisually) {
         context.onPiPVideo = true;
       }
 
       // Firefox always creates a HTMLVideoElement when loading an ogg file
       // directly. If the media is actually audio, be smarter and provide a
       // context menu with audio operations.
-      if (context.target.readyState >= context.target.HAVE_METADATA &&
-          (context.target.videoWidth == 0 || context.target.videoHeight == 0)) {
+      if (
+        context.target.readyState >= context.target.HAVE_METADATA &&
+        (context.target.videoWidth == 0 || context.target.videoHeight == 0)
+      ) {
         context.onAudio = true;
       } else {
         context.onVideo = true;
       }
     } else if (context.target instanceof this.contentWindow.HTMLAudioElement) {
       context.onAudio = true;
       const mediaURL = context.target.currentSrc || context.target.src;
 
       if (this._isMediaURLReusable(mediaURL)) {
         context.mediaURL = mediaURL;
       }
 
       if (this._isProprietaryDRM()) {
         context.onDRMMedia = true;
       }
-    } else if (editFlags & (SpellCheckHelper.INPUT | SpellCheckHelper.TEXTAREA)) {
+    } else if (
+      editFlags &
+      (SpellCheckHelper.INPUT | SpellCheckHelper.TEXTAREA)
+    ) {
       context.onTextInput = (editFlags & SpellCheckHelper.TEXTINPUT) !== 0;
       context.onNumeric = (editFlags & SpellCheckHelper.NUMERIC) !== 0;
       context.onEditable = (editFlags & SpellCheckHelper.EDITABLE) !== 0;
       context.onPassword = (editFlags & SpellCheckHelper.PASSWORD) !== 0;
-      context.onSpellcheckable = (editFlags & SpellCheckHelper.SPELLCHECKABLE) !== 0;
+      context.onSpellcheckable =
+        (editFlags & SpellCheckHelper.SPELLCHECKABLE) !== 0;
 
       // This is guaranteed to be an input or textarea because of the condition above,
       // so the no-children flag is always correct. We deal with contenteditable elsewhere.
       if (context.onSpellcheckable) {
         context.shouldInitInlineSpellCheckerUINoChildren = true;
       }
 
-      context.onKeywordField = (editFlags & SpellCheckHelper.KEYWORD);
+      context.onKeywordField = editFlags & SpellCheckHelper.KEYWORD;
     } else if (context.target instanceof this.contentWindow.HTMLHtmlElement) {
       const bodyElt = context.target.ownerDocument.body;
 
       if (bodyElt) {
         let computedURL;
 
         try {
           computedURL = this._getComputedURL(bodyElt, "background-image");
           context.hasMultipleBGImages = false;
         } catch (e) {
           context.hasMultipleBGImages = true;
         }
 
         if (computedURL) {
           context.hasBGImage = true;
-          context.bgImageURL = this._makeURLAbsolute(bodyElt.baseURI,
-                                                    computedURL);
+          context.bgImageURL = this._makeURLAbsolute(
+            bodyElt.baseURI,
+            computedURL
+          );
         }
       }
-    } else if ((context.target instanceof this.contentWindow.HTMLEmbedElement ||
-               context.target instanceof this.contentWindow.HTMLObjectElement) &&
-               context.target.displayedType == this.contentWindow.HTMLObjectElement.TYPE_NULL &&
-               context.target.pluginFallbackType == this.contentWindow.HTMLObjectElement.PLUGIN_CLICK_TO_PLAY) {
+    } else if (
+      (context.target instanceof this.contentWindow.HTMLEmbedElement ||
+        context.target instanceof this.contentWindow.HTMLObjectElement) &&
+      context.target.displayedType ==
+        this.contentWindow.HTMLObjectElement.TYPE_NULL &&
+      context.target.pluginFallbackType ==
+        this.contentWindow.HTMLObjectElement.PLUGIN_CLICK_TO_PLAY
+    ) {
       context.onCTPPlugin = true;
     }
 
     context.canSpellCheck = this._isSpellCheckEnabled(context.target);
   }
 
   /**
    * Sets up the parts of the context menu for when when nodes have children.
@@ -946,97 +1061,98 @@ class ContextMenuChild extends JSWindowA
     // Always pick the innermost link, background image, etc.
     let elem = context.target;
 
     while (elem) {
       if (elem.nodeType == elem.ELEMENT_NODE) {
         // Link?
         const XLINK_NS = "http://www.w3.org/1999/xlink";
 
-        if (!context.onLink &&
-            // Be consistent with what hrefAndLinkNodeForClickEvent
-            // does in browser.js
-            (this._isXULTextLinkLabel(elem) ||
-            (elem instanceof this.contentWindow.HTMLAnchorElement && elem.href) ||
+        if (
+          !context.onLink &&
+          // Be consistent with what hrefAndLinkNodeForClickEvent
+          // does in browser.js
+          (this._isXULTextLinkLabel(elem) ||
+            (elem instanceof this.contentWindow.HTMLAnchorElement &&
+              elem.href) ||
             (elem instanceof this.contentWindow.SVGAElement &&
-            (elem.href || elem.hasAttributeNS(XLINK_NS, "href"))) ||
+              (elem.href || elem.hasAttributeNS(XLINK_NS, "href"))) ||
             (elem instanceof this.contentWindow.HTMLAreaElement && elem.href) ||
             elem instanceof this.contentWindow.HTMLLinkElement ||
-            elem.getAttributeNS(XLINK_NS, "type") == "simple")) {
+            elem.getAttributeNS(XLINK_NS, "type") == "simple")
+        ) {
           // Target is a link or a descendant of a link.
           context.onLink = true;
 
           // Remember corresponding element.
           context.link = elem;
           context.linkURL = this._getLinkURL();
           context.linkURI = this._getLinkURI();
           context.linkTextStr = this._getLinkText();
           context.linkProtocol = this._getLinkProtocol();
-          context.onMailtoLink = (context.linkProtocol == "mailto");
-          context.onMozExtLink = (context.linkProtocol == "moz-extension");
+          context.onMailtoLink = context.linkProtocol == "mailto";
+          context.onMozExtLink = context.linkProtocol == "moz-extension";
           context.onSaveableLink = this._isLinkSaveable(context.link);
 
           try {
             if (elem.download) {
               // Ignore download attribute on cross-origin links
               context.principal.checkMayLoad(context.linkURI, false, true);
               context.linkDownload = elem.download;
             }
           } catch (ex) {}
         }
 
         // Background image?  Don't bother if we've already found a
         // background image further down the hierarchy.  Otherwise,
         // we look for the computed background-image style.
-        if (!context.hasBGImage &&
-            !context.hasMultipleBGImages) {
+        if (!context.hasBGImage && !context.hasMultipleBGImages) {
           let bgImgUrl = null;
 
           try {
             bgImgUrl = this._getComputedURL(elem, "background-image");
             context.hasMultipleBGImages = false;
           } catch (e) {
             context.hasMultipleBGImages = true;
           }
 
           if (bgImgUrl) {
             context.hasBGImage = true;
-            context.bgImageURL = this._makeURLAbsolute(elem.baseURI,
-                                                      bgImgUrl);
+            context.bgImageURL = this._makeURLAbsolute(elem.baseURI, bgImgUrl);
           }
         }
       }
 
       elem = elem.parentNode;
     }
 
     // See if the user clicked in a frame.
     const docDefaultView = context.target.ownerGlobal;
 
     if (docDefaultView != docDefaultView.top) {
       context.inFrame = true;
 
       if (context.target.ownerDocument.isSrcdocDocument) {
-          context.inSrcdocFrame = true;
+        context.inSrcdocFrame = true;
       }
     }
 
     // if the document is editable, show context menu like in text inputs
     if (!context.onEditable) {
       if (editFlags & SpellCheckHelper.CONTENTEDITABLE) {
         // If this.onEditable is false but editFlags is CONTENTEDITABLE, then
         // the document itself must be editable.
-        context.onTextInput       = true;
-        context.onKeywordField    = false;
-        context.onImage           = false;
-        context.onLoadedImage     = false;
-        context.onCompletedImage  = false;
-        context.inFrame           = false;
-        context.inSrcdocFrame     = false;
-        context.hasBGImage        = false;
-        context.isDesignMode      = true;
-        context.onEditable        = true;
-        context.onSpellcheckable  = true;
+        context.onTextInput = true;
+        context.onKeywordField = false;
+        context.onImage = false;
+        context.onLoadedImage = false;
+        context.onCompletedImage = false;
+        context.inFrame = false;
+        context.inSrcdocFrame = false;
+        context.hasBGImage = false;
+        context.isDesignMode = true;
+        context.onEditable = true;
+        context.onSpellcheckable = true;
         context.shouldInitInlineSpellCheckerUIWithChildren = true;
       }
     }
   }
 }
--- a/browser/actors/ContextMenuParent.jsm
+++ b/browser/actors/ContextMenuParent.jsm
@@ -68,33 +68,35 @@ class ContextMenuParent extends JSWindow
       targetIdentifier,
       command,
       data,
       handlingUserInput: windowUtils.isHandlingUserInput,
     });
   }
 
   canvasToBlobURL(targetIdentifier) {
-    return this.sendQuery("ContextMenu:Canvas:ToBlobURL",
-                          { targetIdentifier });
+    return this.sendQuery("ContextMenu:Canvas:ToBlobURL", { targetIdentifier });
   }
 
   saveVideoFrameAsImage(targetIdentifier) {
-    return this.sendQuery("ContextMenu:SaveVideoFrameAsImage",
-                          { targetIdentifier });
+    return this.sendQuery("ContextMenu:SaveVideoFrameAsImage", {
+      targetIdentifier,
+    });
   }
 
   setAsDesktopBackground(targetIdentifier) {
-    return this.sendQuery("ContextMenu:SetAsDesktopBackground",
-                          { targetIdentifier });
+    return this.sendQuery("ContextMenu:SetAsDesktopBackground", {
+      targetIdentifier,
+    });
   }
 
   getSearchFieldBookmarkData(targetIdentifier) {
-    return this.sendQuery("ContextMenu:SearchFieldBookmarkData",
-                          { targetIdentifier });
+    return this.sendQuery("ContextMenu:SearchFieldBookmarkData", {
+      targetIdentifier,
+    });
   }
 
   doCustomCommand(generatedItemId, handlingUserInput) {
     this.sendAsyncMessage("ContextMenu:DoCustomCommand", {
       generatedItemId,
       handlingUserInput,
     });
   }
--- a/browser/actors/ContextMenuSpecialProcessChild.jsm
+++ b/browser/actors/ContextMenuSpecialProcessChild.jsm
@@ -1,25 +1,34 @@
 /* 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/. */
 "use strict";
 
 var EXPORTED_SYMBOLS = ["ContextMenuSpecialProcessChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {E10SUtils} = ChromeUtils.import("resource://gre/modules/E10SUtils.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { E10SUtils } = ChromeUtils.import(
+  "resource://gre/modules/E10SUtils.jsm"
+);
 
 /**
  * This module is a workaround for bug 1555154, where the contextmenu event doesn't
  * cause the JS Window Actor Child to be constructed automatically in the parent
  * process or extension process documents.
  */
 class ContextMenuSpecialProcessChild extends ActorChild {
   handleEvent(event) {
-    if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_DEFAULT ||
-        Services.appinfo.remoteType == E10SUtils.EXTENSION_REMOTE_TYPE) {
-      this.content.getWindowGlobalChild().getActor("ContextMenu").handleEvent(event);
+    if (
+      Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_DEFAULT ||
+      Services.appinfo.remoteType == E10SUtils.EXTENSION_REMOTE_TYPE
+    ) {
+      this.content
+        .getWindowGlobalChild()
+        .getActor("ContextMenu")
+        .handleEvent(event);
     }
   }
 }
--- a/browser/actors/DOMFullscreenChild.jsm
+++ b/browser/actors/DOMFullscreenChild.jsm
@@ -1,26 +1,30 @@
 /* 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/. */
 "use strict";
 
 var EXPORTED_SYMBOLS = ["DOMFullscreenChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
 
 class DOMFullscreenChild extends ActorChild {
   receiveMessage(aMessage) {
     let windowUtils = this.content && this.content.windowUtils;
     switch (aMessage.name) {
       case "DOMFullscreen:Entered": {
         this._lastTransactionId = windowUtils.lastTransactionId;
-        if (!windowUtils.handleFullscreenRequests() &&
-            !this.content.document.fullscreenElement) {
+        if (
+          !windowUtils.handleFullscreenRequests() &&
+          !this.content.document.fullscreenElement
+        ) {
           // If we don't actually have any pending fullscreen request
           // to handle, neither we have been in fullscreen, tell the
           // parent to just exit.
           this.mm.sendAsyncMessage("DOMFullscreen:Exit");
         }
         break;
       }
       case "DOMFullscreen:CleanUp": {
@@ -64,18 +68,20 @@ class DOMFullscreenChild extends ActorCh
         }
         break;
       }
       case "MozAfterPaint": {
         // Only send Painted signal after we actually finish painting
         // the transition for the fullscreen change.
         // Note that this._lastTransactionId is not set when in non-e10s
         // mode, so we need to check that explicitly.
-        if (!this._lastTransactionId ||
-            aEvent.transactionId > this._lastTransactionId) {
+        if (
+          !this._lastTransactionId ||
+          aEvent.transactionId > this._lastTransactionId
+        ) {
           this.mm.removeEventListener("MozAfterPaint", this);
           this.mm.sendAsyncMessage("DOMFullscreen:Painted");
         }
         break;
       }
     }
   }
 }
--- a/browser/actors/FormValidationChild.jsm
+++ b/browser/actors/FormValidationChild.jsm
@@ -5,19 +5,23 @@
 
 /**
  * Handles the validation callback from nsIFormFillController and
  * the display of the help panel on invalid elements.
  */
 
 var EXPORTED_SYMBOLS = ["FormValidationChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
-const {BrowserUtils} = ChromeUtils.import("resource://gre/modules/BrowserUtils.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
+const { BrowserUtils } = ChromeUtils.import(
+  "resource://gre/modules/BrowserUtils.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 class FormValidationChild extends ActorChild {
   constructor(dispatcher) {
     super(dispatcher);
 
     this._validationMessage = "";
     this._element = null;
 
@@ -56,20 +60,24 @@ class FormValidationChild extends ActorC
     // Show a validation message on the first focusable element.
     for (let element of aInvalidElements) {
       // Insure that this is the FormSubmitObserver associated with the
       // element / window this notification is about.
       if (this.content != element.ownerGlobal.top.document.defaultView) {
         return;
       }
 
-      if (!(ChromeUtils.getClassName(element) === "HTMLInputElement" ||
-            ChromeUtils.getClassName(element) === "HTMLTextAreaElement" ||
-            ChromeUtils.getClassName(element) === "HTMLSelectElement" ||
-            ChromeUtils.getClassName(element) === "HTMLButtonElement")) {
+      if (
+        !(
+          ChromeUtils.getClassName(element) === "HTMLInputElement" ||
+          ChromeUtils.getClassName(element) === "HTMLTextAreaElement" ||
+          ChromeUtils.getClassName(element) === "HTMLSelectElement" ||
+          ChromeUtils.getClassName(element) === "HTMLButtonElement"
+        )
+      ) {
         continue;
       }
 
       if (!Services.focus.elementIsFocusable(element, 0)) {
         continue;
       }
 
       // Update validation message before showing notification
@@ -147,24 +155,27 @@ class FormValidationChild extends ActorC
     // Note, this is relative to the browser and needs to be translated
     // in chrome.
     panelData.contentRect = BrowserUtils.getElementBoundingRect(aElement);
 
     // We want to show the popup at the middle of checkbox and radio buttons
     // and where the content begin for the other elements.
     let offset = 0;
 
-    if (aElement.tagName == "INPUT" &&
-        (aElement.type == "radio" || aElement.type == "checkbox")) {
+    if (
+      aElement.tagName == "INPUT" &&
+      (aElement.type == "radio" || aElement.type == "checkbox")
+    ) {
       panelData.position = "bottomcenter topleft";
     } else {
       let win = aElement.ownerGlobal;
       let style = win.getComputedStyle(aElement);
       if (style.direction == "rtl") {
-        offset = parseInt(style.paddingRight) + parseInt(style.borderRightWidth);
+        offset =
+          parseInt(style.paddingRight) + parseInt(style.borderRightWidth);
       } else {
         offset = parseInt(style.paddingLeft) + parseInt(style.borderLeftWidth);
       }
       let zoomFactor = this.content.windowUtils.fullZoom;
       panelData.offset = Math.round(offset * zoomFactor);
       panelData.position = "after_start";
     }
     this.mm.sendAsyncMessage("FormValidation:ShowPopup", panelData);
@@ -174,12 +185,14 @@ class FormValidationChild extends ActorC
     this.mm.sendAsyncMessage("FormValidation:HidePopup", {});
   }
 
   _isRootDocumentEvent(aEvent) {
     if (this.content == null) {
       return true;
     }
     let target = aEvent.originalTarget;
-    return (target == this.content.document ||
-            (target.ownerDocument && target.ownerDocument == this.content.document));
+    return (
+      target == this.content.document ||
+      (target.ownerDocument && target.ownerDocument == this.content.document)
+    );
   }
 }
--- a/browser/actors/LightweightThemeChild.jsm
+++ b/browser/actors/LightweightThemeChild.jsm
@@ -1,18 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var EXPORTED_SYMBOLS = ["LightweightThemeChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 /**
  * LightweightThemeChild forwards theme data to in-content pages.
  * It is both instantiated by the traditional Actor mechanism,
  * and also manually within the sidebar JS global (which has no message manager)
  */
 class LightweightThemeChild extends ActorChild {
   constructor(dispatcher) {
@@ -69,17 +71,21 @@ class LightweightThemeChild extends Acto
   }
 
   /**
    * Forward the theme data to the page.
    * @param {Object} outerWindowID The outerWindowID the parent process window has.
    * @param {Object} content The receiving global
    */
   update(outerWindowID, content) {
-    const event = Cu.cloneInto({
-      detail: {
-        data: Services.cpmm.sharedData.get(`theme/${outerWindowID}`),
+    const event = Cu.cloneInto(
+      {
+        detail: {
+          data: Services.cpmm.sharedData.get(`theme/${outerWindowID}`),
+        },
       },
-    }, content);
-    content.dispatchEvent(new content.CustomEvent("LightweightTheme:Set",
-                                                  event));
+      content
+    );
+    content.dispatchEvent(
+      new content.CustomEvent("LightweightTheme:Set", event)
+    );
   }
 }
--- a/browser/actors/LinkHandlerChild.jsm
+++ b/browser/actors/LinkHandlerChild.jsm
@@ -1,21 +1,26 @@
 /* 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 = ["LinkHandlerChild"];
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
 
-ChromeUtils.defineModuleGetter(this, "FaviconLoader",
-  "resource:///modules/FaviconLoader.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "FaviconLoader",
+  "resource:///modules/FaviconLoader.jsm"
+);
 
 class LinkHandlerChild extends ActorChild {
   constructor(dispatcher) {
     super(dispatcher);
 
     this.seenTabIcon = false;
     this._iconLoader = null;
   }
@@ -23,18 +28,21 @@ class LinkHandlerChild extends ActorChil
   get iconLoader() {
     if (!this._iconLoader) {
       this._iconLoader = new FaviconLoader(this.mm);
     }
     return this._iconLoader;
   }
 
   addRootIcon() {
-    if (!this.seenTabIcon && Services.prefs.getBoolPref("browser.chrome.guess_favicon", true) &&
-        Services.prefs.getBoolPref("browser.chrome.site_icons", true)) {
+    if (
+      !this.seenTabIcon &&
+      Services.prefs.getBoolPref("browser.chrome.guess_favicon", true) &&
+      Services.prefs.getBoolPref("browser.chrome.site_icons", true)
+    ) {
       // Inject the default icon. Use documentURIObject so that we do the right
       // thing with about:-style error pages. See bug 453442
       let pageURI = this.content.document.documentURIObject;
       if (["http", "https"].includes(pageURI.scheme)) {
         this.seenTabIcon = true;
         this.iconLoader.addDefaultIcon(pageURI);
       }
     }
@@ -85,63 +93,72 @@ class LinkHandlerChild extends ActorChil
     // Ignore sub-frames (bugs 305472, 479408).
     if (link.ownerGlobal != this.content) {
       return;
     }
 
     let rel = link.rel && link.rel.toLowerCase();
     // We also check .getAttribute, since an empty href attribute will give us
     // a link.href that is the same as the document.
-    if (!rel || !link.href || !link.getAttribute("href"))
+    if (!rel || !link.href || !link.getAttribute("href")) {
       return;
+    }
 
     // Note: following booleans only work for the current link, not for the
     // whole content
     let iconAdded = false;
     let searchAdded = false;
     let rels = {};
-    for (let relString of rel.split(/\s+/))
+    for (let relString of rel.split(/\s+/)) {
       rels[relString] = true;
+    }
 
     for (let relVal in rels) {
       let isRichIcon = false;
 
       switch (relVal) {
         case "apple-touch-icon":
         case "apple-touch-icon-precomposed":
         case "fluid-icon":
           isRichIcon = true;
         case "icon":
-          if (iconAdded || link.hasAttribute("mask")) { // Masked icons are not supported yet.
+          if (iconAdded || link.hasAttribute("mask")) {
+            // Masked icons are not supported yet.
             break;
           }
 
           if (!Services.prefs.getBoolPref("browser.chrome.site_icons", true)) {
             return;
           }
 
           if (this.iconLoader.addIconFromLink(link, isRichIcon)) {
             iconAdded = true;
             if (!isRichIcon) {
               this.seenTabIcon = true;
             }
           }
           break;
         case "search":
-          if (Services.policies && !Services.policies.isAllowed("installSearchEngine")) {
+          if (
+            Services.policies &&
+            !Services.policies.isAllowed("installSearchEngine")
+          ) {
             break;
           }
 
           if (!searchAdded && event.type == "DOMLinkAdded") {
             let type = link.type && link.type.toLowerCase();
             type = type.replace(/^\s+|\s*(?:;.*)?$/g, "");
 
             let re = /^(?:https?|ftp):/i;
-            if (type == "application/opensearchdescription+xml" && link.title &&
-                re.test(link.href)) {
+            if (
+              type == "application/opensearchdescription+xml" &&
+              link.title &&
+              re.test(link.href)
+            ) {
               let engine = { title: link.title, href: link.href };
               this.mm.sendAsyncMessage("Link:AddSearch", {
                 engine,
                 url: link.ownerDocument.documentURI,
               });
               searchAdded = true;
             }
           }
--- a/browser/actors/NetErrorChild.jsm
+++ b/browser/actors/NetErrorChild.jsm
@@ -1,50 +1,64 @@
 /* -*- 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 = ["NetErrorChild"];
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
 
-ChromeUtils.defineModuleGetter(this, "WebNavigationFrames",
-                               "resource://gre/modules/WebNavigationFrames.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "WebNavigationFrames",
+  "resource://gre/modules/WebNavigationFrames.jsm"
+);
 
 XPCOMUtils.defineLazyGlobalGetters(this, ["URL"]);
 
 XPCOMUtils.defineLazyGetter(this, "gPipNSSBundle", function() {
-  return Services.strings.createBundle("chrome://pipnss/locale/pipnss.properties");
+  return Services.strings.createBundle(
+    "chrome://pipnss/locale/pipnss.properties"
+  );
 });
 XPCOMUtils.defineLazyGetter(this, "gNSSErrorsBundle", function() {
-  return Services.strings.createBundle("chrome://pipnss/locale/nsserrors.properties");
+  return Services.strings.createBundle(
+    "chrome://pipnss/locale/nsserrors.properties"
+  );
 });
 
-const SEC_ERROR_BASE          = Ci.nsINSSErrorsService.NSS_SEC_ERROR_BASE;
-const SEC_ERROR_REUSED_ISSUER_AND_SERIAL           = SEC_ERROR_BASE + 138;
+const SEC_ERROR_BASE = Ci.nsINSSErrorsService.NSS_SEC_ERROR_BASE;
+const SEC_ERROR_REUSED_ISSUER_AND_SERIAL = SEC_ERROR_BASE + 138;
 
 const SSL_ERROR_BASE = Ci.nsINSSErrorsService.NSS_SSL_ERROR_BASE;
-const SSL_ERROR_SSL_DISABLED  = SSL_ERROR_BASE + 20;
-const SSL_ERROR_SSL2_DISABLED  = SSL_ERROR_BASE + 14;
+const SSL_ERROR_SSL_DISABLED = SSL_ERROR_BASE + 20;
+const SSL_ERROR_SSL2_DISABLED = SSL_ERROR_BASE + 14;
 
 const PREF_SSL_IMPACT_ROOTS = ["security.tls.version.", "security.ssl3."];
 
 function getSerializedSecurityInfo(docShell) {
-  let serhelper = Cc["@mozilla.org/network/serialization-helper;1"]
-                    .getService(Ci.nsISerializationHelper);
+  let serhelper = Cc["@mozilla.org/network/serialization-helper;1"].getService(
+    Ci.nsISerializationHelper
+  );
 
-  let securityInfo = docShell.failedChannel && docShell.failedChannel.securityInfo;
+  let securityInfo =
+    docShell.failedChannel && docShell.failedChannel.securityInfo;
   if (!securityInfo) {
     return "";
   }
-  securityInfo.QueryInterface(Ci.nsITransportSecurityInfo)
-              .QueryInterface(Ci.nsISerializable);
+  securityInfo
+    .QueryInterface(Ci.nsITransportSecurityInfo)
+    .QueryInterface(Ci.nsISerializable);
 
   return serhelper.serializeToString(securityInfo);
 }
 
 class NetErrorChild extends ActorChild {
   isAboutNetError(doc) {
     return doc.documentURI.startsWith("about:neterror");
   }
@@ -61,43 +75,43 @@ class NetErrorChild extends ActorChild {
     };
   }
 
   handleEvent(aEvent) {
     // Documents have a null ownerDocument.
     let doc = aEvent.originalTarget.ownerDocument || aEvent.originalTarget;
 
     switch (aEvent.type) {
-    case "AboutNetErrorLoad":
-      this.onPageLoad(doc.defaultView);
-      break;
-    case "AboutNetErrorSetAutomatic":
-      this.onSetAutomatic(aEvent);
-      break;
-    case "AboutNetErrorResetPreferences":
-      this.onResetPreferences(aEvent);
-      break;
-    case "click":
-      if (aEvent.button == 0) {
-        if (this.isAboutCertError(doc)) {
+      case "AboutNetErrorLoad":
+        this.onPageLoad(doc.defaultView);
+        break;
+      case "AboutNetErrorSetAutomatic":
+        this.onSetAutomatic(aEvent);
+        break;
+      case "AboutNetErrorResetPreferences":
+        this.onResetPreferences(aEvent);
+        break;
+      case "click":
+        if (aEvent.button == 0) {
+          if (this.isAboutCertError(doc)) {
+            this.recordClick(aEvent.originalTarget);
+            this.onCertError(aEvent.originalTarget, doc.defaultView);
+          } else {
+            this.onClick(aEvent);
+          }
+        } else if (this.isAboutCertError(doc)) {
           this.recordClick(aEvent.originalTarget);
-          this.onCertError(aEvent.originalTarget, doc.defaultView);
-        } else {
-          this.onClick(aEvent);
         }
-      } else if (this.isAboutCertError(doc)) {
-          this.recordClick(aEvent.originalTarget);
-      }
-      break;
+        break;
     }
   }
 
   changedCertPrefs() {
     let prefSSLImpact = PREF_SSL_IMPACT_ROOTS.reduce((prefs, root) => {
-       return prefs.concat(Services.prefs.getChildList(root));
+      return prefs.concat(Services.prefs.getChildList(root));
     }, []);
     for (let prefName of prefSSLImpact) {
       if (Services.prefs.prefHasUserValue(prefName)) {
         return true;
       }
     }
 
     return false;
@@ -134,59 +148,69 @@ class NetErrorChild extends ActorChild {
       msg2 = "";
     }
 
     if (!msg2) {
       // We couldn't get an error message. Use the error string.
       // Note that this is different from before where we used PR_ErrorToString.
       msg2 = nss_error_id_str;
     }
-    let msg = gPipNSSBundle.formatStringFromName("SSLConnectionErrorPrefix2",
-                                                 [hostString, msg2]);
+    let msg = gPipNSSBundle.formatStringFromName("SSLConnectionErrorPrefix2", [
+      hostString,
+      msg2,
+    ]);
 
     if (nss_error_id_str && msg2 != nss_error_id_str) {
-      msg += gPipNSSBundle.formatStringFromName("certErrorCodePrefix3",
-                                                [nss_error_id_str]) + "\n";
+      msg +=
+        gPipNSSBundle.formatStringFromName("certErrorCodePrefix3", [
+          nss_error_id_str,
+        ]) + "\n";
     }
     return msg;
   }
 
   onPageLoad(win) {
     // Values for telemtery bins: see TLS_ERROR_REPORT_UI in Histograms.json
     const TLS_ERROR_REPORT_TELEMETRY_UI_SHOWN = 0;
 
     if (this.isAboutNetError(win.document)) {
       let docShell = win.docShell;
       if (docShell) {
-        let {securityInfo} = docShell.failedChannel;
+        let { securityInfo } = docShell.failedChannel;
         // We don't have a securityInfo when this is for example a DNS error.
         if (securityInfo) {
           securityInfo.QueryInterface(Ci.nsITransportSecurityInfo);
-          let msg = this._getErrorMessageFromCode(securityInfo,
-                                                  win.document);
+          let msg = this._getErrorMessageFromCode(securityInfo, win.document);
           let id = win.document.getElementById("errorShortDescText");
           id.textContent = msg;
         }
       }
 
       let learnMoreLink = win.document.getElementById("learnMoreLink");
       let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
       learnMoreLink.setAttribute("href", baseURL + "connection-not-secure");
 
-      let automatic = Services.prefs.getBoolPref("security.ssl.errorReporting.automatic");
-      win.dispatchEvent(new win.CustomEvent("AboutNetErrorOptions", {
-        detail: JSON.stringify({
-          enabled: Services.prefs.getBoolPref("security.ssl.errorReporting.enabled"),
-          changedCertPrefs: this.changedCertPrefs(),
-          automatic,
-        }),
-      }));
+      let automatic = Services.prefs.getBoolPref(
+        "security.ssl.errorReporting.automatic"
+      );
+      win.dispatchEvent(
+        new win.CustomEvent("AboutNetErrorOptions", {
+          detail: JSON.stringify({
+            enabled: Services.prefs.getBoolPref(
+              "security.ssl.errorReporting.enabled"
+            ),
+            changedCertPrefs: this.changedCertPrefs(),
+            automatic,
+          }),
+        })
+      );
 
-      this.mm.sendAsyncMessage("Browser:SSLErrorReportTelemetry",
-                              {reportStatus: TLS_ERROR_REPORT_TELEMETRY_UI_SHOWN});
+      this.mm.sendAsyncMessage("Browser:SSLErrorReportTelemetry", {
+        reportStatus: TLS_ERROR_REPORT_TELEMETRY_UI_SHOWN,
+      });
     }
   }
 
   onResetPreferences(evt) {
     this.mm.sendAsyncMessage("Browser:ResetSSLPreferences");
   }
 
   onSetAutomatic(evt) {
@@ -194,32 +218,33 @@ class NetErrorChild extends ActorChild {
       automatic: evt.detail,
     });
 
     // If we're enabling reports, send a report for this failure.
     if (evt.detail) {
       let win = evt.originalTarget.ownerGlobal;
       let docShell = win.docShell;
 
-      let {securityInfo} = docShell.failedChannel;
+      let { securityInfo } = docShell.failedChannel;
       securityInfo.QueryInterface(Ci.nsITransportSecurityInfo);
-      let {host, port} = win.document.mozDocumentURIIfNotForErrorPages;
+      let { host, port } = win.document.mozDocumentURIIfNotForErrorPages;
 
-      let errorReporter = Cc["@mozilla.org/securityreporter;1"]
-                            .getService(Ci.nsISecurityReporter);
+      let errorReporter = Cc["@mozilla.org/securityreporter;1"].getService(
+        Ci.nsISecurityReporter
+      );
       errorReporter.reportTLSError(securityInfo, host, port);
     }
   }
 
   onCertError(target, win) {
     this.mm.sendAsyncMessage("Browser:CertExceptionError", {
       frameId: WebNavigationFrames.getFrameId(win),
       location: win.document.location.href,
       elementId: target.getAttribute("id"),
-      isTopFrame: (win.parent === win),
+      isTopFrame: win.parent === win,
       securityInfoAsString: getSerializedSecurityInfo(win.docShell),
     });
   }
 
   getCSSClass(doc) {
     let searchParams = new URL(doc.documentURI).searchParams;
     return searchParams.get("s");
   }
@@ -229,33 +254,42 @@ class NetErrorChild extends ActorChild {
     if (!telemetryId) {
       return;
     }
     let doc = element.ownerDocument;
     let cssClass = this.getCSSClass(doc);
     // Telemetry values for events are max. 80 bytes.
     let errorCode = doc.body.getAttribute("code").substring(0, 40);
     let panel = doc.getElementById("badCertAdvancedPanel");
-    Services.telemetry.recordEvent("security.ui.certerror", "click", telemetryId, errorCode, {
-      "panel_open": (panel.style.display == "none").toString(),
-      "has_sts": (cssClass == "badStsCert").toString(),
-      "is_frame": (doc.ownerGlobal.parent != doc.ownerGlobal).toString(),
-    });
+    Services.telemetry.recordEvent(
+      "security.ui.certerror",
+      "click",
+      telemetryId,
+      errorCode,
+      {
+        panel_open: (panel.style.display == "none").toString(),
+        has_sts: (cssClass == "badStsCert").toString(),
+        is_frame: (doc.ownerGlobal.parent != doc.ownerGlobal).toString(),
+      }
+    );
   }
 
   onClick(event) {
-    let {documentURI} = event.target.ownerDocument;
+    let { documentURI } = event.target.ownerDocument;
 
     let elmId = event.originalTarget.getAttribute("id");
     if (elmId == "returnButton") {
       this.mm.sendAsyncMessage("Browser:SSLErrorGoBack", {});
       return;
     }
 
-    if (!event.originalTarget.classList.contains("try-again") || !/e=netOffline/.test(documentURI)) {
+    if (
+      !event.originalTarget.classList.contains("try-again") ||
+      !/e=netOffline/.test(documentURI)
+    ) {
       return;
     }
     // browser front end will handle clearing offline mode and refreshing
     // the page *if* we're in offline mode now. Otherwise let the error page
     // handle the click.
     if (Services.io.offline) {
       event.preventDefault();
       this.mm.sendAsyncMessage("Browser:EnableOnlineMode", {});
--- a/browser/actors/OfflineAppsChild.jsm
+++ b/browser/actors/OfflineAppsChild.jsm
@@ -1,18 +1,20 @@
 /* vim: set ts=2 sw=2 sts=2 et tw=80: */
 /* -*- 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 = ["OfflineAppsChild"];
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
 
 class OfflineAppsChild extends ActorChild {
   constructor(dispatcher) {
     super(dispatcher);
 
     this._docId = 0;
     this._docIdMap = new Map();
 
@@ -32,41 +34,50 @@ class OfflineAppsChild extends ActorChil
 
   handleEvent(event) {
     if (event.type == "MozApplicationManifest") {
       this.offlineAppRequested(event.originalTarget.defaultView);
     }
   }
 
   _getManifestURI(aWindow) {
-    if (!aWindow.document.documentElement)
+    if (!aWindow.document.documentElement) {
       return null;
+    }
 
     var attr = aWindow.document.documentElement.getAttribute("manifest");
-    if (!attr)
+    if (!attr) {
       return null;
+    }
 
     try {
-      return Services.io.newURI(attr, aWindow.document.characterSet,
-                                Services.io.newURI(aWindow.location.href));
+      return Services.io.newURI(
+        attr,
+        aWindow.document.characterSet,
+        Services.io.newURI(aWindow.location.href)
+      );
     } catch (e) {
       return null;
     }
   }
 
   offlineAppRequested(aContentWindow) {
     this.registerWindow(aContentWindow);
     if (!Services.prefs.getBoolPref("browser.offline-apps.notify")) {
       return;
     }
 
     let currentURI = aContentWindow.document.documentURIObject;
     // don't bother showing UI if the user has already made a decision
-    if (Services.perms.testExactPermission(currentURI, "offline-app") != Services.perms.UNKNOWN_ACTION)
+    if (
+      Services.perms.testExactPermission(currentURI, "offline-app") !=
+      Services.perms.UNKNOWN_ACTION
+    ) {
       return;
+    }
 
     try {
       if (Services.prefs.getBoolPref("offline-apps.allow_by_default")) {
         // all pages can use offline capabilities, no need to ask the user
         return;
       }
     } catch (e) {
       // this pref isn't set by default, ignore failures
@@ -75,27 +86,34 @@ class OfflineAppsChild extends ActorChil
     this._docIdMap.set(docId, Cu.getWeakReference(aContentWindow.document));
     this.mm.sendAsyncMessage("OfflineApps:RequestPermission", {
       uri: currentURI.spec,
       docId,
     });
   }
 
   _startFetching(aDocument) {
-    if (!aDocument.documentElement)
+    if (!aDocument.documentElement) {
       return;
+    }
 
     let manifestURI = this._getManifestURI(aDocument.defaultView);
-    if (!manifestURI)
+    if (!manifestURI) {
       return;
+    }
 
-    var updateService = Cc["@mozilla.org/offlinecacheupdate-service;1"].
-                        getService(Ci.nsIOfflineCacheUpdateService);
-    updateService.scheduleUpdate(manifestURI, aDocument.documentURIObject,
-                                 aDocument.nodePrincipal, aDocument.defaultView);
+    var updateService = Cc[
+      "@mozilla.org/offlinecacheupdate-service;1"
+    ].getService(Ci.nsIOfflineCacheUpdateService);
+    updateService.scheduleUpdate(
+      manifestURI,
+      aDocument.documentURIObject,
+      aDocument.nodePrincipal,
+      aDocument.defaultView
+    );
   }
 
   receiveMessage(aMessage) {
     if (aMessage.name == "OfflineApps:StartFetching") {
       let doc = this._docIdMap.get(aMessage.data.docId);
       doc = doc && doc.get();
       if (doc) {
         this._startFetching(doc);
@@ -104,17 +122,18 @@ class OfflineAppsChild extends ActorChil
     }
   }
 
   observe(aSubject, aTopic, aState) {
     if (aTopic == "offline-cache-update-completed") {
       let cacheUpdate = aSubject.QueryInterface(Ci.nsIOfflineCacheUpdate);
       let uri = cacheUpdate.manifestURI;
       if (uri && this._docManifestSet.has(uri.spec)) {
-        this.mm.sendAsyncMessage("OfflineApps:CheckUsage", {uri: uri.spec});
+        this.mm.sendAsyncMessage("OfflineApps:CheckUsage", { uri: uri.spec });
       }
     }
   }
 }
 
-OfflineAppsChild.prototype.QueryInterface =
-  ChromeUtils.generateQI([Ci.nsIObserver,
-                          Ci.nsISupportsWeakReference]);
+OfflineAppsChild.prototype.QueryInterface = ChromeUtils.generateQI([
+  Ci.nsIObserver,
+  Ci.nsISupportsWeakReference,
+]);
--- a/browser/actors/PageInfoChild.jsm
+++ b/browser/actors/PageInfoChild.jsm
@@ -1,18 +1,22 @@
 /* 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 = ["PageInfoChild"];
 
-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 {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
   setTimeout: "resource://gre/modules/Timer.jsm",
 });
 
 class PageInfoChild extends ActorChild {
   /* nsIMessageListener */
@@ -26,183 +30,239 @@ class PageInfoChild extends ActorChild {
     if (frameOuterWindowID != undefined) {
       window = Services.wm.getOuterWindowWithId(frameOuterWindowID);
     } else {
       window = message.target.content;
     }
 
     let document = window.document;
 
-    let pageInfoData = {metaViewRows: this.getMetaInfo(document),
-                        docInfo: this.getDocumentInfo(document),
-                        windowInfo: this.getWindowInfo(window)};
+    let pageInfoData = {
+      metaViewRows: this.getMetaInfo(document),
+      docInfo: this.getDocumentInfo(document),
+      windowInfo: this.getWindowInfo(window),
+    };
 
     message.target.sendAsyncMessage("PageInfo:data", pageInfoData);
 
     // Separate step so page info dialog isn't blank while waiting for this to finish.
     this.getMediaInfo(document, window, strings, message.target);
   }
 
   getMetaInfo(document) {
     let metaViewRows = [];
 
     // Get the meta tags from the page.
     let metaNodes = document.getElementsByTagName("meta");
 
     for (let metaNode of metaNodes) {
-      metaViewRows.push([metaNode.name || metaNode.httpEquiv || metaNode.getAttribute("property"),
-                        metaNode.content]);
+      metaViewRows.push([
+        metaNode.name ||
+          metaNode.httpEquiv ||
+          metaNode.getAttribute("property"),
+        metaNode.content,
+      ]);
     }
 
     return metaViewRows;
   }
 
   getWindowInfo(window) {
     let windowInfo = {};
     windowInfo.isTopWindow = window == window.top;
 
     let hostName = null;
     try {
       hostName = Services.io.newURI(window.location.href).displayHost;
-    } catch (exception) { }
+    } catch (exception) {}
 
     windowInfo.hostName = hostName;
     return windowInfo;
   }
 
   getDocumentInfo(document) {
     let docInfo = {};
     docInfo.title = document.title;
     docInfo.location = document.location.toString();
     try {
-      docInfo.location = Services.io.newURI(document.location.toString()).displaySpec;
-    } catch (exception) { }
+      docInfo.location = Services.io.newURI(
+        document.location.toString()
+      ).displaySpec;
+    } catch (exception) {}
     docInfo.referrer = document.referrer;
     try {
       if (document.referrer) {
         docInfo.referrer = Services.io.newURI(document.referrer).displaySpec;
       }
-    } catch (exception) { }
+    } catch (exception) {}
     docInfo.compatMode = document.compatMode;
     docInfo.contentType = document.contentType;
     docInfo.characterSet = document.characterSet;
     docInfo.lastModified = document.lastModified;
     docInfo.principal = document.nodePrincipal;
 
     let documentURIObject = {};
     documentURIObject.spec = document.documentURIObject.spec;
     docInfo.documentURIObject = documentURIObject;
 
-    docInfo.isContentWindowPrivate = PrivateBrowsingUtils.isContentWindowPrivate(document.ownerGlobal);
+    docInfo.isContentWindowPrivate = PrivateBrowsingUtils.isContentWindowPrivate(
+      document.ownerGlobal
+    );
 
     return docInfo;
   }
 
   // Only called once to get the media tab's media elements from the content page.
   getMediaInfo(document, window, strings, mm) {
     let frameList = this.goThroughFrames(document, window);
     this.processFrames(document, frameList, strings, mm);
   }
 
   goThroughFrames(document, window) {
     let frameList = [document];
     if (window && window.frames.length > 0) {
       let num = window.frames.length;
       for (let i = 0; i < num; i++) {
         // Recurse through the frames.
-        frameList = frameList.concat(this.goThroughFrames(window.frames[i].document,
-                                              window.frames[i]));
+        frameList = frameList.concat(
+          this.goThroughFrames(window.frames[i].document, window.frames[i])
+        );
       }
     }
     return frameList;
   }
 
   async processFrames(document, frameList, strings, mm) {
     let nodeCount = 0;
     let content = document.ownerGlobal;
     for (let doc of frameList) {
       let iterator = doc.createTreeWalker(doc, content.NodeFilter.SHOW_ELEMENT);
 
       // Goes through all the elements on the doc. imageViewRows takes only the media elements.
       while (iterator.nextNode()) {
-        let mediaItems = this.getMediaItems(document, strings, iterator.currentNode);
+        let mediaItems = this.getMediaItems(
+          document,
+          strings,
+          iterator.currentNode
+        );
 
         if (mediaItems.length) {
-          mm.sendAsyncMessage("PageInfo:mediaData",
-                           {mediaItems, isComplete: false});
+          mm.sendAsyncMessage("PageInfo:mediaData", {
+            mediaItems,
+            isComplete: false,
+          });
         }
 
         if (++nodeCount % 500 == 0) {
           // setTimeout every 500 elements so we don't keep blocking the content process.
           await new Promise(resolve => setTimeout(resolve, 10));
         }
       }
     }
     // Send that page info media fetching has finished.
-    mm.sendAsyncMessage("PageInfo:mediaData", {isComplete: true});
+    mm.sendAsyncMessage("PageInfo:mediaData", { isComplete: true });
   }
 
   getMediaItems(document, strings, elem) {
     // Check for images defined in CSS (e.g. background, borders)
     let computedStyle = elem.ownerGlobal.getComputedStyle(elem);
     // A node can have multiple media items associated with it - for example,
     // multiple background images.
     let mediaItems = [];
     let content = document.ownerGlobal;
 
     let addImage = (url, type, alt, el, isBg) => {
-      let element = this.serializeElementInfo(document, url, type, alt, el, isBg);
+      let element = this.serializeElementInfo(
+        document,
+        url,
+        type,
+        alt,
+        el,
+        isBg
+      );
       mediaItems.push([url, type, alt, element, isBg]);
     };
 
     if (computedStyle) {
       let addImgFunc = (label, urls) => {
         for (let url of urls) {
           addImage(url, label, strings.notSet, elem, true);
         }
       };
       // FIXME: This is missing properties. See the implementation of
       // getCSSImageURLs for a list of properties.
       //
       // If you don't care about the message you can also pass "all" here and
       // get all the ones the browser knows about.
-      addImgFunc(strings.mediaBGImg, computedStyle.getCSSImageURLs("background-image"));
-      addImgFunc(strings.mediaBorderImg, computedStyle.getCSSImageURLs("border-image-source"));
-      addImgFunc(strings.mediaListImg, computedStyle.getCSSImageURLs("list-style-image"));
+      addImgFunc(
+        strings.mediaBGImg,
+        computedStyle.getCSSImageURLs("background-image")
+      );
+      addImgFunc(
+        strings.mediaBorderImg,
+        computedStyle.getCSSImageURLs("border-image-source")
+      );
+      addImgFunc(
+        strings.mediaListImg,
+        computedStyle.getCSSImageURLs("list-style-image")
+      );
       addImgFunc(strings.mediaCursor, computedStyle.getCSSImageURLs("cursor"));
     }
 
     // One swi^H^H^Hif-else to rule them all.
     if (elem instanceof content.HTMLImageElement) {
-      addImage(elem.src, strings.mediaImg,
-               (elem.hasAttribute("alt")) ? elem.alt : strings.notSet, elem, false);
+      addImage(
+        elem.src,
+        strings.mediaImg,
+        elem.hasAttribute("alt") ? elem.alt : strings.notSet,
+        elem,
+        false
+      );
     } else if (elem instanceof content.SVGImageElement) {
       try {
         // Note: makeURLAbsolute will throw if either the baseURI is not a valid URI
         //       or the URI formed from the baseURI and the URL is not a valid URI.
         if (elem.href.baseVal) {
-          let href = Services.io.newURI(elem.href.baseVal, null, Services.io.newURI(elem.baseURI)).spec;
+          let href = Services.io.newURI(
+            elem.href.baseVal,
+            null,
+            Services.io.newURI(elem.baseURI)
+          ).spec;
           addImage(href, strings.mediaImg, "", elem, false);
         }
-      } catch (e) { }
+      } catch (e) {}
     } else if (elem instanceof content.HTMLVideoElement) {
       addImage(elem.currentSrc, strings.mediaVideo, "", elem, false);
     } else if (elem instanceof content.HTMLAudioElement) {
       addImage(elem.currentSrc, strings.mediaAudio, "", elem, false);
     } else if (elem instanceof content.HTMLLinkElement) {
       if (elem.rel && /\bicon\b/i.test(elem.rel)) {
         addImage(elem.href, strings.mediaLink, "", elem, false);
       }
-    } else if (elem instanceof content.HTMLInputElement || elem instanceof content.HTMLButtonElement) {
+    } else if (
+      elem instanceof content.HTMLInputElement ||
+      elem instanceof content.HTMLButtonElement
+    ) {
       if (elem.type.toLowerCase() == "image") {
-        addImage(elem.src, strings.mediaInput,
-                 (elem.hasAttribute("alt")) ? elem.alt : strings.notSet, elem, false);
+        addImage(
+          elem.src,
+          strings.mediaInput,
+          elem.hasAttribute("alt") ? elem.alt : strings.notSet,
+          elem,
+          false
+        );
       }
     } else if (elem instanceof content.HTMLObjectElement) {
-      addImage(elem.data, strings.mediaObject, this.getValueText(elem), elem, false);
+      addImage(
+        elem.data,
+        strings.mediaObject,
+        this.getValueText(elem),
+        elem,
+        false
+      );
     } else if (elem instanceof content.HTMLEmbedElement) {
       addImage(elem.src, strings.mediaEmbed, "", elem, false);
     }
 
     return mediaItems;
   }
 
   /**
@@ -210,53 +270,66 @@ class PageInfoChild extends ActorChild {
    * makePreview in pageInfo.js uses to figure out how to display the preview.
    */
 
   serializeElementInfo(document, url, type, alt, item, isBG) {
     let result = {};
     let content = document.ownerGlobal;
 
     let imageText;
-    if (!isBG &&
-        !(item instanceof content.SVGImageElement) &&
-        !(document instanceof content.ImageDocument)) {
+    if (
+      !isBG &&
+      !(item instanceof content.SVGImageElement) &&
+      !(document instanceof content.ImageDocument)
+    ) {
       imageText = item.title || item.alt;
 
       if (!imageText && !(item instanceof content.HTMLImageElement)) {
         imageText = this.getValueText(item);
       }
     }
 
     result.imageText = imageText;
     result.longDesc = item.longDesc;
     result.numFrames = 1;
 
-    if (item instanceof content.HTMLObjectElement ||
+    if (
+      item instanceof content.HTMLObjectElement ||
       item instanceof content.HTMLEmbedElement ||
-      item instanceof content.HTMLLinkElement) {
+      item instanceof content.HTMLLinkElement
+    ) {
       result.mimeType = item.type;
     }
 
-    if (!result.mimeType && !isBG && item instanceof Ci.nsIImageLoadingContent) {
+    if (
+      !result.mimeType &&
+      !isBG &&
+      item instanceof Ci.nsIImageLoadingContent
+    ) {
       // Interface for image loading content.
-      let imageRequest = item.getRequest(Ci.nsIImageLoadingContent.CURRENT_REQUEST);
+      let imageRequest = item.getRequest(
+        Ci.nsIImageLoadingContent.CURRENT_REQUEST
+      );
       if (imageRequest) {
         result.mimeType = imageRequest.mimeType;
-        let image = !(imageRequest.imageStatus & imageRequest.STATUS_ERROR) && imageRequest.image;
+        let image =
+          !(imageRequest.imageStatus & imageRequest.STATUS_ERROR) &&
+          imageRequest.image;
         if (image) {
           result.numFrames = image.numFrames;
         }
       }
     }
 
     // If we have a data url, get the MIME type from the url.
     if (!result.mimeType && url.startsWith("data:")) {
       let dataMimeType = /^data:(image\/[^;,]+)/i.exec(url);
-      if (dataMimeType)
+      if (dataMimeType) {
         result.mimeType = dataMimeType[1].toLowerCase();
+      }
     }
 
     result.HTMLLinkElement = item instanceof content.HTMLLinkElement;
     result.HTMLInputElement = item instanceof content.HTMLInputElement;
     result.HTMLImageElement = item instanceof content.HTMLImageElement;
     result.HTMLObjectElement = item instanceof content.HTMLObjectElement;
     result.SVGImageElement = item instanceof content.SVGImageElement;
     result.HTMLVideoElement = item instanceof content.HTMLVideoElement;
@@ -291,19 +364,21 @@ class PageInfoChild extends ActorChild {
   // Other Misc Stuff
   // Modified from the Links Panel v2.3, http://segment7.net/mozilla/links/links.html
   // parse a node to extract the contents of the node
   getValueText(node) {
     let valueText = "";
     let content = node.ownerGlobal;
 
     // Form input elements don't generally contain information that is useful to our callers, so return nothing.
-    if (node instanceof content.HTMLInputElement ||
-        node instanceof content.HTMLSelectElement ||
-        node instanceof content.HTMLTextAreaElement) {
+    if (
+      node instanceof content.HTMLInputElement ||
+      node instanceof content.HTMLSelectElement ||
+      node instanceof content.HTMLTextAreaElement
+    ) {
       return valueText;
     }
 
     // Otherwise recurse for each child.
     let length = node.childNodes.length;
 
     for (let i = 0; i < length; i++) {
       let childNode = node.childNodes[i];
@@ -331,17 +406,18 @@ class PageInfoChild extends ActorChild {
   getAltText(node) {
     let altText = "";
 
     if (node.alt) {
       return node.alt;
     }
     let length = node.childNodes.length;
     for (let i = 0; i < length; i++) {
-      if ((altText = this.getAltText(node.childNodes[i]) != undefined)) { // stupid js warning...
+      if ((altText = this.getAltText(node.childNodes[i]) != undefined)) {
+        // stupid js warning...
         return altText;
       }
     }
     return "";
   }
 
   // Copied from the Links Panel v2.3, http://segment7.net/mozilla/links/links.html.
   // Strip leading and trailing whitespace, and replace multiple consecutive whitespace characters with a single space.
--- a/browser/actors/PageStyleChild.jsm
+++ b/browser/actors/PageStyleChild.jsm
@@ -1,39 +1,46 @@
 /* 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 = ["PageStyleChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
 
 class PageStyleChild extends ActorChild {
   getViewer(content) {
     return content.docShell.contentViewer;
   }
 
   sendStyleSheetInfo(mm) {
     let content = mm.content;
     content.requestIdleCallback(() => {
-      let filteredStyleSheets = this._filterStyleSheets(this.getAllStyleSheets(content), content);
+      let filteredStyleSheets = this._filterStyleSheets(
+        this.getAllStyleSheets(content),
+        content
+      );
 
       mm.sendAsyncMessage("PageStyle:StyleSheets", {
         filteredStyleSheets,
         authorStyleDisabled: this.getViewer(content).authorStyleDisabled,
         preferredStyleSheetSet: content.document.preferredStyleSheetSet,
       });
     });
   }
 
   getAllStyleSheets(frameset) {
     let selfSheets = Array.from(frameset.document.styleSheets);
-    let subSheets = Array.from(frameset.frames, frame => this.getAllStyleSheets(frame));
+    let subSheets = Array.from(frameset.frames, frame =>
+      this.getAllStyleSheets(frame)
+    );
     return selfSheets.concat(...subSheets);
   }
 
   receiveMessage(msg) {
     let content = msg.target.content;
     switch (msg.name) {
       case "PageStyle:Switch":
         this.getViewer(content).authorStyleDisabled = false;
@@ -70,59 +77,64 @@ class PageStyleChild extends ActorChild 
   }
 
   _stylesheetSwitchFrame(frame, title) {
     var docStyleSheets = frame.document.styleSheets;
 
     for (let i = 0; i < docStyleSheets.length; ++i) {
       let docStyleSheet = docStyleSheets[i];
       if (docStyleSheet.title) {
-        docStyleSheet.disabled = (docStyleSheet.title != title);
+        docStyleSheet.disabled = docStyleSheet.title != title;
       } else if (docStyleSheet.disabled) {
         docStyleSheet.disabled = false;
       }
     }
   }
 
   _stylesheetInFrame(frame, title) {
-    return Array.from(frame.document.styleSheets).some((styleSheet) => styleSheet.title == title);
+    return Array.from(frame.document.styleSheets).some(
+      styleSheet => styleSheet.title == title
+    );
   }
 
   _filterStyleSheets(styleSheets, content) {
     let result = [];
 
     for (let currentStyleSheet of styleSheets) {
-      if (!currentStyleSheet.title)
+      if (!currentStyleSheet.title) {
         continue;
+      }
 
       // Skip any stylesheets that don't match the screen media type.
       if (currentStyleSheet.media.length > 0) {
         let mediaQueryList = currentStyleSheet.media.mediaText;
         if (!content.matchMedia(mediaQueryList).matches) {
           continue;
         }
       }
 
       let URI;
       try {
-        if (!currentStyleSheet.ownerNode ||
-            // special-case style nodes, which have no href
-            currentStyleSheet.ownerNode.nodeName.toLowerCase() != "style") {
+        if (
+          !currentStyleSheet.ownerNode ||
+          // special-case style nodes, which have no href
+          currentStyleSheet.ownerNode.nodeName.toLowerCase() != "style"
+        ) {
           URI = Services.io.newURI(currentStyleSheet.href);
         }
       } catch (e) {
         if (e.result != Cr.NS_ERROR_MALFORMED_URI) {
           throw e;
         }
         continue;
       }
 
       // We won't send data URIs all of the way up to the parent, as these
       // can be arbitrarily large.
-      let sentURI = (!URI || URI.scheme == "data") ? null : URI.spec;
+      let sentURI = !URI || URI.scheme == "data" ? null : URI.spec;
 
       result.push({
         title: currentStyleSheet.title,
         disabled: currentStyleSheet.disabled,
         href: sentURI,
       });
     }
 
--- a/browser/actors/PluginChild.jsm
+++ b/browser/actors/PluginChild.jsm
@@ -1,32 +1,44 @@
 /* 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 = ["PluginChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {BrowserUtils} = ChromeUtils.import("resource://gre/modules/BrowserUtils.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { BrowserUtils } = ChromeUtils.import(
+  "resource://gre/modules/BrowserUtils.jsm"
+);
 
-ChromeUtils.defineModuleGetter(this, "ContextMenuChild",
-                               "resource:///actors/ContextMenuChild.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "ContextMenuChild",
+  "resource:///actors/ContextMenuChild.jsm"
+);
 
 XPCOMUtils.defineLazyGetter(this, "gNavigatorBundle", function() {
   const url = "chrome://browser/locale/browser.properties";
   return Services.strings.createBundle(url);
 });
 
-ChromeUtils.defineModuleGetter(this, "AppConstants",
-  "resource://gre/modules/AppConstants.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "AppConstants",
+  "resource://gre/modules/AppConstants.jsm"
+);
 
 const OVERLAY_DISPLAY = {
   HIDDEN: 0, // The overlay will be transparent
   BLANK: 1, // The overlay will be just a grey box
   TINY: 2, // The overlay with a 16x16 plugin icon
   REDUCED: 3, // The overlay with a 32x32 plugin icon
   NOTEXT: 4, // The overlay with a 48x48 plugin icon and the close button
   FULL: 5, // The full overlay: 48x48 plugin icon, close button and label
@@ -36,32 +48,51 @@ class PluginChild extends ActorChild {
   constructor(dispatcher) {
     super(dispatcher);
 
     // Cache of plugin actions for the current page.
     this.pluginData = new Map();
     // Cache of plugin crash information sent from the parent
     this.pluginCrashData = new Map();
 
-    this.mm.addEventListener("pagehide", this, {capture: true, mozSystemGroup: true});
-    this.mm.addEventListener("pageshow", this, {capture: true, mozSystemGroup: true});
+    this.mm.addEventListener("pagehide", this, {
+      capture: true,
+      mozSystemGroup: true,
+    });
+    this.mm.addEventListener("pageshow", this, {
+      capture: true,
+      mozSystemGroup: true,
+    });
   }
 
   receiveMessage(msg) {
     switch (msg.name) {
       case "BrowserPlugins:ActivatePlugins":
         this.activatePlugins(msg.data.pluginInfo, msg.data.newState);
         break;
       case "BrowserPlugins:ContextMenuCommand":
         switch (msg.data.command) {
           case "play":
-            this._showClickToPlayNotification(ContextMenuChild.getTarget(this.docShell.browsingContext, msg, "plugin"), true);
+            this._showClickToPlayNotification(
+              ContextMenuChild.getTarget(
+                this.docShell.browsingContext,
+                msg,
+                "plugin"
+              ),
+              true
+            );
             break;
           case "hide":
-            this.hideClickToPlayOverlay(ContextMenuChild.getTarget(this.docShell.browsingContext, msg, "plugin"));
+            this.hideClickToPlayOverlay(
+              ContextMenuChild.getTarget(
+                this.docShell.browsingContext,
+                msg,
+                "plugin"
+              )
+            );
             break;
         }
         break;
       case "BrowserPlugins:NPAPIPluginProcessCrashed":
         this.NPAPIPluginProcessCrashed({
           pluginName: msg.data.pluginName,
           runID: msg.data.runID,
           state: msg.data.state,
@@ -81,20 +112,22 @@ class PluginChild extends ActorChild {
     }
   }
 
   observe(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "decoder-doctor-notification":
         let data = JSON.parse(aData);
         let type = data.type.toLowerCase();
-        if (type == "cannot-play" &&
-            this.haveShownNotification &&
-            aSubject.top.document == this.content.document &&
-            data.formats.toLowerCase().includes("application/x-mpegurl", 0)) {
+        if (
+          type == "cannot-play" &&
+          this.haveShownNotification &&
+          aSubject.top.document == this.content.document &&
+          data.formats.toLowerCase().includes("application/x-mpegurl", 0)
+        ) {
           this.content.pluginRequiresReload = true;
         }
     }
   }
 
   onPageShow(event) {
     // Ignore events that aren't from the main document.
     if (!this.content || event.target != this.content.document) {
@@ -115,126 +148,163 @@ class PluginChild extends ActorChild {
       return;
     }
 
     this.clearPluginCaches();
     this.haveShownNotification = false;
   }
 
   getPluginUI(plugin, anonid) {
-    if (plugin.openOrClosedShadowRoot &&
-        plugin.openOrClosedShadowRoot.isUAWidget()) {
+    if (
+      plugin.openOrClosedShadowRoot &&
+      plugin.openOrClosedShadowRoot.isUAWidget()
+    ) {
       return plugin.openOrClosedShadowRoot.getElementById(anonid);
     }
     return null;
   }
 
   _getPluginInfo(pluginElement) {
-    let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
+    let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(
+      Ci.nsIPluginHost
+    );
     pluginElement.QueryInterface(Ci.nsIObjectLoadingContent);
 
     let tagMimetype;
-    let pluginName = gNavigatorBundle.GetStringFromName("pluginInfo.unknownPlugin");
+    let pluginName = gNavigatorBundle.GetStringFromName(
+      "pluginInfo.unknownPlugin"
+    );
     let pluginTag = null;
     let permissionString = null;
     let fallbackType = null;
     let blocklistState = null;
 
     tagMimetype = pluginElement.actualType;
     if (tagMimetype == "") {
       tagMimetype = pluginElement.type;
     }
 
     if (this.isKnownPlugin(pluginElement)) {
       pluginTag = pluginHost.getPluginTagForType(pluginElement.actualType);
       pluginName = BrowserUtils.makeNicePluginName(pluginTag.name);
 
       // Convert this from nsIPluginTag so it can be serialized.
-      let properties = ["name", "description", "filename", "version", "enabledState", "niceName"];
+      let properties = [
+        "name",
+        "description",
+        "filename",
+        "version",
+        "enabledState",
+        "niceName",
+      ];
       let pluginTagCopy = {};
       for (let prop of properties) {
         pluginTagCopy[prop] = pluginTag[prop];
       }
       pluginTag = pluginTagCopy;
 
-      permissionString = pluginHost.getPermissionStringForType(pluginElement.actualType);
+      permissionString = pluginHost.getPermissionStringForType(
+        pluginElement.actualType
+      );
       fallbackType = pluginElement.defaultFallbackType;
-      blocklistState = pluginHost.getBlocklistStateForType(pluginElement.actualType);
+      blocklistState = pluginHost.getBlocklistStateForType(
+        pluginElement.actualType
+      );
       // Make state-softblocked == state-notblocked for our purposes,
       // they have the same UI. STATE_OUTDATED should not exist for plugin
       // items, but let's alias it anyway, just in case.
-      if (blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED ||
-          blocklistState == Ci.nsIBlocklistService.STATE_OUTDATED) {
+      if (
+        blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED ||
+        blocklistState == Ci.nsIBlocklistService.STATE_OUTDATED
+      ) {
         blocklistState = Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
       }
     }
 
-    return { mimetype: tagMimetype,
-             pluginName,
-             pluginTag,
-             permissionString,
-             fallbackType,
-             blocklistState,
-           };
+    return {
+      mimetype: tagMimetype,
+      pluginName,
+      pluginTag,
+      permissionString,
+      fallbackType,
+      blocklistState,
+    };
   }
 
   /**
    * _getPluginInfoForTag is called when iterating the plugins for a document,
    * and what we get from nsIDOMWindowUtils is an nsIPluginTag, and not an
    * nsIObjectLoadingContent. This only should happen if the plugin is
    * click-to-play (see bug 1186948).
    */
   _getPluginInfoForTag(pluginTag, tagMimetype) {
-    let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
+    let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(
+      Ci.nsIPluginHost
+    );
 
-    let pluginName = gNavigatorBundle.GetStringFromName("pluginInfo.unknownPlugin");
+    let pluginName = gNavigatorBundle.GetStringFromName(
+      "pluginInfo.unknownPlugin"
+    );
     let permissionString = null;
     let blocklistState = null;
 
     if (pluginTag) {
       pluginName = BrowserUtils.makeNicePluginName(pluginTag.name);
 
       permissionString = pluginHost.getPermissionStringForTag(pluginTag);
       blocklistState = pluginTag.blocklistState;
 
       // Convert this from nsIPluginTag so it can be serialized.
-      let properties = ["name", "description", "filename", "version", "enabledState", "niceName"];
+      let properties = [
+        "name",
+        "description",
+        "filename",
+        "version",
+        "enabledState",
+        "niceName",
+      ];
       let pluginTagCopy = {};
       for (let prop of properties) {
         pluginTagCopy[prop] = pluginTag[prop];
       }
       pluginTag = pluginTagCopy;
 
       // Make state-softblocked == state-notblocked for our purposes,
       // they have the same UI. STATE_OUTDATED should not exist for plugin
       // items, but let's alias it anyway, just in case.
-      if (blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED ||
-          blocklistState == Ci.nsIBlocklistService.STATE_OUTDATED) {
+      if (
+        blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED ||
+        blocklistState == Ci.nsIBlocklistService.STATE_OUTDATED
+      ) {
         blocklistState = Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
       }
     }
 
-    return { mimetype: tagMimetype,
-             pluginName,
-             pluginTag,
-             permissionString,
-             // Since we should only have entered _getPluginInfoForTag when
-             // examining a click-to-play plugin, we can safely hard-code
-             // this fallback type, since we don't actually have an
-             // nsIObjectLoadingContent to check.
-             fallbackType: Ci.nsIObjectLoadingContent.PLUGIN_CLICK_TO_PLAY,
-             blocklistState,
-           };
+    return {
+      mimetype: tagMimetype,
+      pluginName,
+      pluginTag,
+      permissionString,
+      // Since we should only have entered _getPluginInfoForTag when
+      // examining a click-to-play plugin, we can safely hard-code
+      // this fallback type, since we don't actually have an
+      // nsIObjectLoadingContent to check.
+      fallbackType: Ci.nsIObjectLoadingContent.PLUGIN_CLICK_TO_PLAY,
+      blocklistState,
+    };
   }
 
   /**
    * Update the visibility of the plugin overlay.
    */
   setVisibility(plugin, overlay, overlayDisplayState) {
-    overlay.classList.toggle("visible", overlayDisplayState != OVERLAY_DISPLAY.HIDDEN);
+    overlay.classList.toggle(
+      "visible",
+      overlayDisplayState != OVERLAY_DISPLAY.HIDDEN
+    );
     if (overlayDisplayState != OVERLAY_DISPLAY.HIDDEN) {
       overlay.removeAttribute("dismissed");
     }
   }
 
   /**
    * Adjust the style in which the overlay will be displayed. It might be adjusted
    * based on its size, or if there's some other element covering all corners of
@@ -266,22 +336,24 @@ class PluginChild extends ActorChild {
       return OVERLAY_DISPLAY.FULL;
     }
 
     let overlayDisplay = OVERLAY_DISPLAY.FULL;
     let contentWindow = plugin.ownerGlobal;
     let cwu = contentWindow.windowUtils;
 
     // Is the <object>'s size too small to hold what we want to show?
-    let pluginRect = flushLayout ? plugin.getBoundingClientRect() :
-                                   cwu.getBoundsWithoutFlushing(plugin);
+    let pluginRect = flushLayout
+      ? plugin.getBoundingClientRect()
+      : cwu.getBoundsWithoutFlushing(plugin);
     let pluginWidth = Math.ceil(pluginRect.width);
     let pluginHeight = Math.ceil(pluginRect.height);
 
-    let layoutNeedsFlush = !flushLayout &&
+    let layoutNeedsFlush =
+      !flushLayout &&
       cwu.needsFlush(cwu.FLUSH_STYLE) &&
       cwu.needsFlush(cwu.FLUSH_LAYOUT);
 
     // We must set the attributes while here inside this function in order
     // for a possible re-style to occur, which will make the scrollWidth/Height
     // checks below correct. Otherwise, we would be requesting e.g. a TINY
     // overlay here, but the default styling would be used, and that would make
     // it overflow, causing it to change to BLANK instead of remaining as TINY.
@@ -319,36 +391,39 @@ class PluginChild extends ActorChild {
     // We also don't want to access scrollWidth/scrollHeight if
     // the layout needs flush.
     if (layoutNeedsFlush) {
       return overlayDisplay;
     }
 
     // XXX bug 446693. The text-shadow on the submitted-report text at
     //     the bottom causes scrollHeight to be larger than it should be.
-    let overflows = (overlay.scrollWidth > pluginWidth) ||
-                    (overlay.scrollHeight - 5 > pluginHeight);
+    let overflows =
+      overlay.scrollWidth > pluginWidth ||
+      overlay.scrollHeight - 5 > pluginHeight;
     if (overflows) {
       overlay.setAttribute("sizing", "blank");
       return OVERLAY_DISPLAY.BLANK;
     }
 
     // Is the plugin covered up by other content so that it is not clickable?
     // Floating point can confuse .elementFromPoint, so inset just a bit
     let left = pluginRect.left + 2;
     let right = pluginRect.right - 2;
     let top = pluginRect.top + 2;
     let bottom = pluginRect.bottom - 2;
     let centerX = left + (right - left) / 2;
     let centerY = top + (bottom - top) / 2;
-    let points = [[left, top],
-                   [left, bottom],
-                   [right, top],
-                   [right, bottom],
-                   [centerX, centerY]];
+    let points = [
+      [left, top],
+      [left, bottom],
+      [right, top],
+      [right, bottom],
+      [centerX, centerY],
+    ];
 
     for (let [x, y] of points) {
       if (x < 0 || y < 0) {
         continue;
       }
       let el = cwu.elementFromPoint(x, y, true, true);
       if (el === plugin) {
         return overlayDisplay;
@@ -358,46 +433,55 @@ class PluginChild extends ActorChild {
     overlay.setAttribute("sizing", "blank");
     return OVERLAY_DISPLAY.BLANK;
   }
 
   addLinkClickCallback(linkNode, callbackName /* callbackArgs...*/) {
     // XXX just doing (callback)(arg) was giving a same-origin error. bug?
     let self = this;
     let callbackArgs = Array.prototype.slice.call(arguments).slice(2);
-    linkNode.addEventListener("click",
-                              function(evt) {
-                                if (!evt.isTrusted)
-                                  return;
-                                evt.preventDefault();
-                                if (callbackArgs.length == 0)
-                                  callbackArgs = [ evt ];
-                                (self[callbackName]).apply(self, callbackArgs);
-                              },
-                              true);
+    linkNode.addEventListener(
+      "click",
+      function(evt) {
+        if (!evt.isTrusted) {
+          return;
+        }
+        evt.preventDefault();
+        if (callbackArgs.length == 0) {
+          callbackArgs = [evt];
+        }
+        self[callbackName].apply(self, callbackArgs);
+      },
+      true
+    );
 
-    linkNode.addEventListener("keydown",
-                              function(evt) {
-                                if (!evt.isTrusted)
-                                  return;
-                                if (evt.keyCode == evt.DOM_VK_RETURN) {
-                                  evt.preventDefault();
-                                  if (callbackArgs.length == 0)
-                                    callbackArgs = [ evt ];
-                                  evt.preventDefault();
-                                  (self[callbackName]).apply(self, callbackArgs);
-                                }
-                              },
-                              true);
+    linkNode.addEventListener(
+      "keydown",
+      function(evt) {
+        if (!evt.isTrusted) {
+          return;
+        }
+        if (evt.keyCode == evt.DOM_VK_RETURN) {
+          evt.preventDefault();
+          if (callbackArgs.length == 0) {
+            callbackArgs = [evt];
+          }
+          evt.preventDefault();
+          self[callbackName].apply(self, callbackArgs);
+        }
+      },
+      true
+    );
   }
 
   // Helper to get the binding handler type from a plugin object
   _getBindingType(plugin) {
-    if (!(plugin instanceof Ci.nsIObjectLoadingContent))
+    if (!(plugin instanceof Ci.nsIObjectLoadingContent)) {
       return null;
+    }
 
     switch (plugin.pluginFallbackType) {
       case Ci.nsIObjectLoadingContent.PLUGIN_UNSUPPORTED:
         return "PluginNotFound";
       case Ci.nsIObjectLoadingContent.PLUGIN_DISABLED:
         return "PluginDisabled";
       case Ci.nsIObjectLoadingContent.PLUGIN_BLOCKLISTED:
         return "PluginBlocklisted";
@@ -429,36 +513,39 @@ class PluginChild extends ActorChild {
       return;
     }
 
     if (eventType == "click") {
       this.onOverlayClick(event);
       return;
     }
 
-    if (eventType == "PluginCrashed" &&
-        !(event.target instanceof Ci.nsIObjectLoadingContent)) {
+    if (
+      eventType == "PluginCrashed" &&
+      !(event.target instanceof Ci.nsIObjectLoadingContent)
+    ) {
       // If the event target is not a plugin object (i.e., an <object> or
       // <embed> element), this call is for a window-global plugin.
       this.onPluginCrashed(event.target, event);
       return;
     }
 
     if (eventType == "HiddenPlugin") {
       let pluginTag = event.tag.QueryInterface(Ci.nsIPluginTag);
       if (event.target.defaultView.top.document != this.content.document) {
         return;
       }
       this._showClickToPlayNotification(pluginTag, false);
     }
 
     let plugin = event.target;
 
-    if (!(plugin instanceof Ci.nsIObjectLoadingContent))
+    if (!(plugin instanceof Ci.nsIObjectLoadingContent)) {
       return;
+    }
 
     if (eventType == "PluginBindingAttached") {
       // The plugin binding fires this event when it is created.
       // As an untrusted event, ensure that this object actually has a binding
       // and make sure we don't handle it twice
       let overlay = this.getPluginUI(plugin, "main");
       if (!overlay || overlay._bindingHandled) {
         return;
@@ -487,227 +574,307 @@ class PluginChild extends ActorChild {
       case "PluginBlocklisted":
       case "PluginOutdated":
         shouldShowNotification = true;
         break;
 
       case "PluginVulnerableUpdatable":
         let updateLink = this.getPluginUI(plugin, "checkForUpdatesLink");
         let { pluginTag } = this._getPluginInfo(plugin);
-        this.addLinkClickCallback(updateLink, "forwardCallback",
-                                  "openPluginUpdatePage", pluginTag);
-        /* FALLTHRU */
+        this.addLinkClickCallback(
+          updateLink,
+          "forwardCallback",
+          "openPluginUpdatePage",
+          pluginTag
+        );
+      /* FALLTHRU */
 
       case "PluginVulnerableNoUpdate":
       case "PluginClickToPlay":
         this._handleClickToPlayEvent(plugin);
         let pluginName = this._getPluginInfo(plugin).pluginName;
-        let messageString = gNavigatorBundle.formatStringFromName("PluginClickToActivate2", [pluginName]);
+        let messageString = gNavigatorBundle.formatStringFromName(
+          "PluginClickToActivate2",
+          [pluginName]
+        );
         let overlayText = this.getPluginUI(plugin, "clickToPlay");
         overlayText.textContent = messageString;
-        if (eventType == "PluginVulnerableUpdatable" ||
-            eventType == "PluginVulnerableNoUpdate") {
-          let vulnerabilityString = gNavigatorBundle.GetStringFromName(eventType);
-          let vulnerabilityText = this.getPluginUI(plugin, "vulnerabilityStatus");
+        if (
+          eventType == "PluginVulnerableUpdatable" ||
+          eventType == "PluginVulnerableNoUpdate"
+        ) {
+          let vulnerabilityString = gNavigatorBundle.GetStringFromName(
+            eventType
+          );
+          let vulnerabilityText = this.getPluginUI(
+            plugin,
+            "vulnerabilityStatus"
+          );
           vulnerabilityText.textContent = vulnerabilityString;
         }
         shouldShowNotification = true;
         break;
 
       case "PluginDisabled":
         let manageLink = this.getPluginUI(plugin, "managePluginsLink");
-        this.addLinkClickCallback(manageLink, "forwardCallback", "managePlugins");
+        this.addLinkClickCallback(
+          manageLink,
+          "forwardCallback",
+          "managePlugins"
+        );
         shouldShowNotification = true;
         break;
 
       case "PluginInstantiated":
         shouldShowNotification = true;
         break;
     }
 
     // Show the in-content UI if it's not too big. The crashed plugin handler already did this.
     let overlay = this.getPluginUI(plugin, "main");
     if (eventType != "PluginCrashed") {
       if (overlay != null) {
-        this.setVisibility(plugin, overlay,
-                           this.computeAndAdjustOverlayDisplay(plugin, overlay, false));
+        this.setVisibility(
+          plugin,
+          overlay,
+          this.computeAndAdjustOverlayDisplay(plugin, overlay, false)
+        );
 
         let resizeListener = () => {
-          this.setVisibility(plugin, overlay,
-            this.computeAndAdjustOverlayDisplay(plugin, overlay, true));
+          this.setVisibility(
+            plugin,
+            overlay,
+            this.computeAndAdjustOverlayDisplay(plugin, overlay, true)
+          );
         };
         plugin.addEventListener("overflow", resizeListener);
         plugin.addEventListener("underflow", resizeListener);
       }
     }
 
     let closeIcon = this.getPluginUI(plugin, "closeIcon");
     if (closeIcon) {
-      closeIcon.addEventListener("click", clickEvent => {
-        if (clickEvent.button == 0 && clickEvent.isTrusted) {
-          this.hideClickToPlayOverlay(plugin);
-          overlay.setAttribute("dismissed", "true");
-        }
-      }, true);
+      closeIcon.addEventListener(
+        "click",
+        clickEvent => {
+          if (clickEvent.button == 0 && clickEvent.isTrusted) {
+            this.hideClickToPlayOverlay(plugin);
+            overlay.setAttribute("dismissed", "true");
+          }
+        },
+        true
+      );
     }
 
     if (shouldShowNotification) {
       this._showClickToPlayNotification(plugin, false);
     }
   }
 
   isKnownPlugin(objLoadingContent) {
-    return (objLoadingContent.getContentTypeForMIMEType(objLoadingContent.actualType) ==
-            Ci.nsIObjectLoadingContent.TYPE_PLUGIN);
+    return (
+      objLoadingContent.getContentTypeForMIMEType(
+        objLoadingContent.actualType
+      ) == Ci.nsIObjectLoadingContent.TYPE_PLUGIN
+    );
   }
 
   canActivatePlugin(objLoadingContent) {
     // if this isn't a known plugin, we can't activate it
     // (this also guards pluginHost.getPermissionStringForType against
     // unexpected input)
-    if (!this.isKnownPlugin(objLoadingContent))
+    if (!this.isKnownPlugin(objLoadingContent)) {
       return false;
+    }
 
-    let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
-    let permissionString = pluginHost.getPermissionStringForType(objLoadingContent.actualType);
+    let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(
+      Ci.nsIPluginHost
+    );
+    let permissionString = pluginHost.getPermissionStringForType(
+      objLoadingContent.actualType
+    );
     let principal = objLoadingContent.ownerGlobal.top.document.nodePrincipal;
-    let pluginPermission = Services.perms.testPermissionFromPrincipal(principal, permissionString);
+    let pluginPermission = Services.perms.testPermissionFromPrincipal(
+      principal,
+      permissionString
+    );
 
     let isFallbackTypeValid =
-      objLoadingContent.pluginFallbackType >= Ci.nsIObjectLoadingContent.PLUGIN_CLICK_TO_PLAY &&
-      objLoadingContent.pluginFallbackType <= Ci.nsIObjectLoadingContent.PLUGIN_CLICK_TO_PLAY_QUIET;
+      objLoadingContent.pluginFallbackType >=
+        Ci.nsIObjectLoadingContent.PLUGIN_CLICK_TO_PLAY &&
+      objLoadingContent.pluginFallbackType <=
+        Ci.nsIObjectLoadingContent.PLUGIN_CLICK_TO_PLAY_QUIET;
 
-    return !objLoadingContent.activated &&
-           pluginPermission != Ci.nsIPermissionManager.DENY_ACTION &&
-           isFallbackTypeValid;
+    return (
+      !objLoadingContent.activated &&
+      pluginPermission != Ci.nsIPermissionManager.DENY_ACTION &&
+      isFallbackTypeValid
+    );
   }
 
   hideClickToPlayOverlay(plugin) {
     let overlay = this.getPluginUI(plugin, "main");
     if (overlay) {
       overlay.classList.remove("visible");
     }
   }
 
   // Forward a link click callback to the chrome process.
   forwardCallback(name, pluginTag) {
-    this.mm.sendAsyncMessage("PluginContent:LinkClickCallback",
-      { name, pluginTag });
+    this.mm.sendAsyncMessage("PluginContent:LinkClickCallback", {
+      name,
+      pluginTag,
+    });
   }
 
   submitReport(plugin) {
     if (!AppConstants.MOZ_CRASHREPORTER) {
       return;
     }
     if (!plugin) {
-      Cu.reportError("Attempted to submit crash report without an associated plugin.");
+      Cu.reportError(
+        "Attempted to submit crash report without an associated plugin."
+      );
       return;
     }
     if (!(plugin instanceof Ci.nsIObjectLoadingContent)) {
-      Cu.reportError("Attempted to submit crash report on plugin that does not" +
-                     "implement nsIObjectLoadingContent.");
+      Cu.reportError(
+        "Attempted to submit crash report on plugin that does not" +
+          "implement nsIObjectLoadingContent."
+      );
       return;
     }
 
     let runID = plugin.runID;
     let submitURLOptIn = this.getPluginUI(plugin, "submitURLOptIn").checked;
     let keyVals = {};
     let userComment = this.getPluginUI(plugin, "submitComment").value.trim();
-    if (userComment)
+    if (userComment) {
       keyVals.PluginUserComment = userComment;
-    if (submitURLOptIn)
+    }
+    if (submitURLOptIn) {
       keyVals.PluginContentURL = plugin.ownerDocument.URL;
+    }
 
-    this.mm.sendAsyncMessage("PluginContent:SubmitReport",
-                                 { runID, keyVals, submitURLOptIn });
+    this.mm.sendAsyncMessage("PluginContent:SubmitReport", {
+      runID,
+      keyVals,
+      submitURLOptIn,
+    });
   }
 
   reloadPage() {
     this.content.location.reload();
   }
 
   // Event listener for click-to-play plugins.
   _handleClickToPlayEvent(plugin) {
     let doc = plugin.ownerDocument;
-    let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
+    let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(
+      Ci.nsIPluginHost
+    );
     let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
     // guard against giving pluginHost.getPermissionStringForType a type
     // not associated with any known plugin
-    if (!this.isKnownPlugin(objLoadingContent))
+    if (!this.isKnownPlugin(objLoadingContent)) {
       return;
-    let permissionString = pluginHost.getPermissionStringForType(objLoadingContent.actualType);
+    }
+    let permissionString = pluginHost.getPermissionStringForType(
+      objLoadingContent.actualType
+    );
     let principal = doc.defaultView.top.document.nodePrincipal;
-    let pluginPermission = Services.perms.testPermissionFromPrincipal(principal, permissionString);
+    let pluginPermission = Services.perms.testPermissionFromPrincipal(
+      principal,
+      permissionString
+    );
 
     let overlay = this.getPluginUI(plugin, "main");
 
-    if (pluginPermission == Ci.nsIPermissionManager.DENY_ACTION ||
-        pluginPermission == Ci.nsIObjectLoadingContent.PLUGIN_PERMISSION_PROMPT_ACTION_QUIET) {
+    if (
+      pluginPermission == Ci.nsIPermissionManager.DENY_ACTION ||
+      pluginPermission ==
+        Ci.nsIObjectLoadingContent.PLUGIN_PERMISSION_PROMPT_ACTION_QUIET
+    ) {
       if (overlay) {
         overlay.classList.remove("visible");
       }
       return;
     }
 
     if (overlay) {
       overlay.addEventListener("click", this, true);
     }
   }
 
   onOverlayClick(event) {
     let document = event.target.ownerDocument;
     let plugin = document.getBindingParent(event.target);
     let overlay = this.getPluginUI(plugin, "main");
     // Have to check that the target is not the link to update the plugin
-    if (!(ChromeUtils.getClassName(event.originalTarget) === "HTMLAnchorElement") &&
-        event.originalTarget.getAttribute("anonid") != "closeIcon" &&
-        event.originalTarget.id != "closeIcon" &&
-        !overlay.hasAttribute("dismissed") &&
-        event.button == 0 &&
-        event.isTrusted) {
+    if (
+      !(
+        ChromeUtils.getClassName(event.originalTarget) === "HTMLAnchorElement"
+      ) &&
+      event.originalTarget.getAttribute("anonid") != "closeIcon" &&
+      event.originalTarget.id != "closeIcon" &&
+      !overlay.hasAttribute("dismissed") &&
+      event.button == 0 &&
+      event.isTrusted
+    ) {
       this._showClickToPlayNotification(plugin, true);
-    event.stopPropagation();
-    event.preventDefault();
+      event.stopPropagation();
+      event.preventDefault();
     }
   }
 
   reshowClickToPlayNotification() {
     let contentWindow = this.content;
     let cwu = contentWindow.windowUtils;
     let plugins = cwu.plugins;
     for (let plugin of plugins) {
       let overlay = this.getPluginUI(plugin, "main");
-      if (overlay)
+      if (overlay) {
         overlay.removeEventListener("click", this, true);
+      }
       let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
-      if (this.canActivatePlugin(objLoadingContent))
+      if (this.canActivatePlugin(objLoadingContent)) {
         this._handleClickToPlayEvent(plugin);
+      }
     }
     this._showClickToPlayNotification(null, false);
   }
 
   /**
    * Activate the plugins that the user has specified.
    */
   activatePlugins(pluginInfo, newState) {
     let contentWindow = this.content;
     let cwu = contentWindow.windowUtils;
     let plugins = cwu.plugins;
-    let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
+    let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(
+      Ci.nsIPluginHost
+    );
 
     let pluginFound = false;
     for (let plugin of plugins) {
       plugin.QueryInterface(Ci.nsIObjectLoadingContent);
       if (!this.isKnownPlugin(plugin)) {
         continue;
       }
-      if (pluginInfo.permissionString == pluginHost.getPermissionStringForType(plugin.actualType)) {
+      if (
+        pluginInfo.permissionString ==
+        pluginHost.getPermissionStringForType(plugin.actualType)
+      ) {
         let overlay = this.getPluginUI(plugin, "main");
         pluginFound = true;
-        if (newState == "block" || newState == "blockalways" || newState == "continueblocking") {
+        if (
+          newState == "block" ||
+          newState == "blockalways" ||
+          newState == "continueblocking"
+        ) {
           if (overlay) {
             overlay.addEventListener("click", this, true);
           }
           plugin.pluginFallbackTypeOverride = pluginInfo.fallbackType;
           plugin.reload(true);
         } else if (this.canActivatePlugin(plugin)) {
           if (overlay) {
             overlay.removeEventListener("click", this, true);
@@ -715,33 +882,40 @@ class PluginChild extends ActorChild {
           plugin.playPlugin();
         }
       }
     }
 
     // If there are no instances of the plugin on the page any more or if we've
     // noted that the content needs to be reloaded due to replacing HLS, what the
     // user probably needs is for us to allow and then refresh.
-    if (newState != "block" && newState != "blockalways" && newState != "continueblocking" &&
-       (!pluginFound || contentWindow.pluginRequiresReload)) {
+    if (
+      newState != "block" &&
+      newState != "blockalways" &&
+      newState != "continueblocking" &&
+      (!pluginFound || contentWindow.pluginRequiresReload)
+    ) {
       this.reloadPage();
     }
   }
 
   _showClickToPlayNotification(plugin, showNow) {
     let plugins = [];
 
     // If plugin is null, that means the user has navigated back to a page with
     // plugins, and we need to collect all the plugins.
     if (plugin === null) {
       let contentWindow = this.content;
       let cwu = contentWindow.windowUtils;
       // cwu.plugins may contain non-plugin <object>s, filter them out
-      plugins = cwu.plugins.filter((p) =>
-        p.getContentTypeForMIMEType(p.actualType) == Ci.nsIObjectLoadingContent.TYPE_PLUGIN);
+      plugins = cwu.plugins.filter(
+        p =>
+          p.getContentTypeForMIMEType(p.actualType) ==
+          Ci.nsIObjectLoadingContent.TYPE_PLUGIN
+      );
 
       if (plugins.length == 0) {
         this.removeNotification("click-to-play-plugins");
         return;
       }
     } else {
       plugins = [plugin];
     }
@@ -762,36 +936,45 @@ class PluginChild extends ActorChild {
       if (pluginInfo.permissionString === null) {
         Cu.reportError("No permission string for active plugin.");
         continue;
       }
       if (pluginData.has(pluginInfo.permissionString)) {
         continue;
       }
 
-      let permissionObj = Services.perms.
-        getPermissionObject(principal, pluginInfo.permissionString, false);
+      let permissionObj = Services.perms.getPermissionObject(
+        principal,
+        pluginInfo.permissionString,
+        false
+      );
       if (permissionObj) {
-        pluginInfo.pluginPermissionPrePath = permissionObj.principal.originNoSuffix;
+        pluginInfo.pluginPermissionPrePath =
+          permissionObj.principal.originNoSuffix;
         pluginInfo.pluginPermissionType = permissionObj.expireType;
       } else {
         pluginInfo.pluginPermissionPrePath = principal.originNoSuffix;
         pluginInfo.pluginPermissionType = undefined;
       }
 
       this.pluginData.set(pluginInfo.permissionString, pluginInfo);
     }
 
     this.haveShownNotification = true;
 
-    this.mm.sendAsyncMessage("PluginContent:ShowClickToPlayNotification", {
-      plugins: [...this.pluginData.values()],
-      showNow,
-      location,
-    }, null, principal);
+    this.mm.sendAsyncMessage(
+      "PluginContent:ShowClickToPlayNotification",
+      {
+        plugins: [...this.pluginData.values()],
+        showNow,
+        location,
+      },
+      null,
+      principal
+    );
   }
 
   removeNotification(name) {
     this.mm.sendAsyncMessage("PluginContent:RemoveNotification", { name });
   }
 
   clearPluginCaches() {
     this.pluginData.clear();
@@ -813,18 +996,23 @@ class PluginChild extends ActorChild {
     /**
      * Traverses down iframes until it find a non-iframe full screen DOM element.
      * @param fullScreenIframe
      *  Target iframe to begin searching from.
      * @returns DOM element
      *  The full screen DOM element contained within the iframe (could be inner iframe), or the original iframe if no inner DOM element is found.
      **/
     let getTrueFullScreenElement = fullScreenIframe => {
-      if (typeof fullScreenIframe.contentDocument !== "undefined" && fullScreenIframe.contentDocument.mozFullScreenElement) {
-        return getTrueFullScreenElement(fullScreenIframe.contentDocument.mozFullScreenElement);
+      if (
+        typeof fullScreenIframe.contentDocument !== "undefined" &&
+        fullScreenIframe.contentDocument.mozFullScreenElement
+      ) {
+        return getTrueFullScreenElement(
+          fullScreenIframe.contentDocument.mozFullScreenElement
+        );
       }
       return fullScreenIframe;
     };
 
     if (fullScreenElement.tagName === "IFRAME") {
       fullScreenElement = getTrueFullScreenElement(fullScreenElement);
     }
 
@@ -839,33 +1027,35 @@ class PluginChild extends ActorChild {
   }
 
   /**
    * The PluginCrashed event handler. Note that the PluginCrashed event is
    * fired for both NPAPI and Gecko Media plugins. In the latter case, the
    * target of the event is the document that the GMP is being used in.
    */
   onPluginCrashed(target, aEvent) {
-    if (!(aEvent instanceof this.content.PluginCrashedEvent))
+    if (!(aEvent instanceof this.content.PluginCrashedEvent)) {
       return;
+    }
 
     let fullScreenElement = this.content.document.mozFullScreenElement;
     if (fullScreenElement) {
       if (this.isWithinFullScreenElement(fullScreenElement, target)) {
         this.content.document.mozCancelFullScreen();
       }
     }
 
     if (aEvent.gmpPlugin) {
       this.GMPCrashed(aEvent);
       return;
     }
 
-    if (!(target instanceof Ci.nsIObjectLoadingContent))
+    if (!(target instanceof Ci.nsIObjectLoadingContent)) {
       return;
+    }
 
     let crashData = this.pluginCrashData.get(target.runID);
     if (!crashData) {
       // We haven't received information from the parent yet about
       // this crash, so we should hold off showing the crash report
       // UI.
       return;
     }
@@ -877,36 +1067,41 @@ class PluginChild extends ActorChild {
 
     this.setCrashedNPAPIPluginState({
       plugin: target,
       state: crashData.state,
       message: crashData.message,
     });
   }
 
-  NPAPIPluginProcessCrashed({pluginName, runID, state}) {
-    let message =
-      gNavigatorBundle.formatStringFromName("crashedpluginsMessage.title",
-                                            [pluginName]);
+  NPAPIPluginProcessCrashed({ pluginName, runID, state }) {
+    let message = gNavigatorBundle.formatStringFromName(
+      "crashedpluginsMessage.title",
+      [pluginName]
+    );
 
     let contentWindow = this.content;
     let cwu = contentWindow.windowUtils;
     let plugins = cwu.plugins;
 
     for (let plugin of plugins) {
-      if (plugin instanceof Ci.nsIObjectLoadingContent &&
-          plugin.runID == runID) {
+      if (
+        plugin instanceof Ci.nsIObjectLoadingContent &&
+        plugin.runID == runID
+      ) {
         // The parent has told us that the plugin process has died.
         // It's possible that this content process hasn't yet noticed,
         // in which case we need to stash this data around until the
         // PluginCrashed events get sent up.
-        if (plugin.pluginFallbackType == Ci.nsIObjectLoadingContent.PLUGIN_CRASHED) {
+        if (
+          plugin.pluginFallbackType == Ci.nsIObjectLoadingContent.PLUGIN_CRASHED
+        ) {
           // This plugin has already been put into the crashed state by the
           // content process, so we can tweak its crash UI without delay.
-          this.setCrashedNPAPIPluginState({plugin, state, message});
+          this.setCrashedNPAPIPluginState({ plugin, state, message });
         } else {
           // The content process hasn't yet determined that the plugin has crashed.
           // Stash the data in our map, and throw the plugin into a WeakSet. When
           // the PluginCrashed event fires on the <object>/<embed>, we'll retrieve
           // the information we need from the Map and remove the instance from the
           // WeakSet. Once the WeakSet is empty, we can clear the map.
           if (!this.pluginCrashData.has(runID)) {
             this.pluginCrashData.set(runID, {
@@ -917,107 +1112,127 @@ class PluginChild extends ActorChild {
           }
           let crashData = this.pluginCrashData.get(runID);
           crashData.instances.add(plugin);
         }
       }
     }
   }
 
-  setCrashedNPAPIPluginState({plugin, state, message}) {
+  setCrashedNPAPIPluginState({ plugin, state, message }) {
     // Force a layout flush so the binding is attached.
     plugin.clientTop;
     let overlay = this.getPluginUI(plugin, "main");
     let statusDiv = this.getPluginUI(plugin, "submitStatus");
     let optInCB = this.getPluginUI(plugin, "submitURLOptIn");
 
-    this.getPluginUI(plugin, "submitButton")
-        .addEventListener("click", (event) => {
-          if (event.button != 0 || !event.isTrusted)
-            return;
-          this.submitReport(plugin);
-        });
+    this.getPluginUI(plugin, "submitButton").addEventListener(
+      "click",
+      event => {
+        if (event.button != 0 || !event.isTrusted) {
+          return;
+        }
+        this.submitReport(plugin);
+      }
+    );
 
     let pref = Services.prefs.getBranch("dom.ipc.plugins.reportCrashURL");
     optInCB.checked = pref.getBoolPref("");
 
     statusDiv.setAttribute("status", state);
 
     let helpIcon = this.getPluginUI(plugin, "helpIcon");
     this.addLinkClickCallback(helpIcon, "openHelpPage");
 
     let crashText = this.getPluginUI(plugin, "crashedText");
     crashText.textContent = message;
 
     let link = this.getPluginUI(plugin, "reloadLink");
     this.addLinkClickCallback(link, "reloadPage");
 
     // This might trigger force reflow, but plug-in crashing code path shouldn't be hot.
-    let overlayDisplayState = this.computeAndAdjustOverlayDisplay(plugin, overlay, true);
+    let overlayDisplayState = this.computeAndAdjustOverlayDisplay(
+      plugin,
+      overlay,
+      true
+    );
 
     // Is the <object>'s size too small to hold what we want to show?
     if (overlayDisplayState != OVERLAY_DISPLAY.FULL) {
       // First try hiding the crash report submission UI.
       statusDiv.removeAttribute("status");
 
-      overlayDisplayState = this.computeAndAdjustOverlayDisplay(plugin, overlay, true);
+      overlayDisplayState = this.computeAndAdjustOverlayDisplay(
+        plugin,
+        overlay,
+        true
+      );
     }
     this.setVisibility(plugin, overlay, overlayDisplayState);
 
     let doc = plugin.ownerDocument;
     let runID = plugin.runID;
 
     if (overlayDisplayState == OVERLAY_DISPLAY.FULL) {
       doc.mozNoPluginCrashedNotification = true;
 
       // Notify others that the crash reporter UI is now ready.
       // Currently, this event is only used by tests.
       let winUtils = this.content.windowUtils;
-      let event = new this.content.CustomEvent("PluginCrashReporterDisplayed", {bubbles: true});
+      let event = new this.content.CustomEvent("PluginCrashReporterDisplayed", {
+        bubbles: true,
+      });
       winUtils.dispatchEventToChromeOnly(plugin, event);
     } else if (!doc.mozNoPluginCrashedNotification) {
       // If another plugin on the page was large enough to show our UI, we don't
       // want to show a notification bar.
-      this.mm.sendAsyncMessage("PluginContent:ShowPluginCrashedNotification",
-                                   { messageString: message, pluginID: runID });
+      this.mm.sendAsyncMessage("PluginContent:ShowPluginCrashedNotification", {
+        messageString: message,
+        pluginID: runID,
+      });
     }
   }
 
   NPAPIPluginCrashReportSubmitted({ runID, state }) {
     this.pluginCrashData.delete(runID);
     let contentWindow = this.content;
     let cwu = contentWindow.windowUtils;
     let plugins = cwu.plugins;
 
     for (let plugin of plugins) {
-      if (plugin instanceof Ci.nsIObjectLoadingContent &&
-          plugin.runID == runID) {
+      if (
+        plugin instanceof Ci.nsIObjectLoadingContent &&
+        plugin.runID == runID
+      ) {
         let statusDiv = this.getPluginUI(plugin, "submitStatus");
         statusDiv.setAttribute("status", state);
       }
     }
   }
 
   GMPCrashed(aEvent) {
-    let target          = aEvent.target;
-    let pluginName      = aEvent.pluginName;
-    let gmpPlugin       = aEvent.gmpPlugin;
-    let pluginID        = aEvent.pluginID;
-    let doc             = target.document;
+    let target = aEvent.target;
+    let pluginName = aEvent.pluginName;
+    let gmpPlugin = aEvent.gmpPlugin;
+    let pluginID = aEvent.pluginID;
+    let doc = target.document;
 
     if (!gmpPlugin || !doc) {
       // TODO: Throw exception? How did we get here?
       return;
     }
 
-    let messageString =
-      gNavigatorBundle.formatStringFromName("crashedpluginsMessage.title",
-                                            [pluginName]);
+    let messageString = gNavigatorBundle.formatStringFromName(
+      "crashedpluginsMessage.title",
+      [pluginName]
+    );
 
-    this.mm.sendAsyncMessage("PluginContent:ShowPluginCrashedNotification",
-                                 { messageString, pluginID });
+    this.mm.sendAsyncMessage("PluginContent:ShowPluginCrashedNotification", {
+      messageString,
+      pluginID,
+    });
 
     // Remove the notification when the page is reloaded.
     doc.defaultView.top.addEventListener("unload", event => {
       this.hideNotificationBar("plugin-crashed");
     });
   }
 }
--- a/browser/actors/RFPHelperChild.jsm
+++ b/browser/actors/RFPHelperChild.jsm
@@ -1,22 +1,30 @@
 /* -*- 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 = ["RFPHelperChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 
 const kPrefLetterboxing = "privacy.resistFingerprinting.letterboxing";
 
-XPCOMUtils.defineLazyPreferenceGetter(this, "isLetterboxingEnabled",
-  kPrefLetterboxing, false);
+XPCOMUtils.defineLazyPreferenceGetter(
+  this,
+  "isLetterboxingEnabled",
+  kPrefLetterboxing,
+  false
+);
 
 class RFPHelperChild extends ActorChild {
   handleEvent() {
     if (isLetterboxingEnabled) {
       this.mm.sendAsyncMessage("Letterboxing:ContentSizeUpdated");
     }
   }
   receiveMessage(aMessage) {
--- a/browser/actors/SearchTelemetryChild.jsm
+++ b/browser/actors/SearchTelemetryChild.jsm
@@ -1,17 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 var EXPORTED_SYMBOLS = ["SearchTelemetryChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const SHARED_DATA_KEY = "SearchTelemetry:ProviderInfo";
 
 /**
  * SearchProviders looks after keeping track of the search provider information
  * received from the main process.
  *
  * It is separate to SearchTelemetryChild so that it is not constructed for each
@@ -86,18 +88,18 @@ class SearchTelemetryChild extends Actor
    * Determines if there is a provider that matches the supplied URL and returns
    * the information associated with that provider.
    *
    * @param {string} url The url to check
    * @returns {array|null} Returns null if there's no match, otherwise an array
    *   of provider name and the provider information.
    */
   _getProviderInfoForUrl(url) {
-    return Object.entries(searchProviders.info || []).find(
-      ([_, info]) => info.regexp.test(url)
+    return Object.entries(searchProviders.info || []).find(([_, info]) =>
+      info.regexp.test(url)
     );
   }
 
   /**
    * Checks to see if the page is a partner and has an ad link within it. If so,
    * it will notify SearchTelemetry.
    *
    * @param {object} doc The document object to check.
--- a/browser/actors/SubframeCrashChild.jsm
+++ b/browser/actors/SubframeCrashChild.jsm
@@ -1,17 +1,17 @@
 /* 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/. */
 "use strict";
 
 var EXPORTED_SYMBOLS = ["SubframeCrashChild"];
 
-let {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+let { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 class SubframeCrashChild extends JSWindowActorChild {
   receiveMessage(message) {
     if (message.name == "SubframeCrashed") {
       this.onSubframeCrashed(message.data.id);
     }
   }
 
--- a/browser/actors/SubframeCrashParent.jsm
+++ b/browser/actors/SubframeCrashParent.jsm
@@ -1,10 +1,9 @@
 /* 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/. */
 "use strict";
 
 var EXPORTED_SYMBOLS = ["SubframeCrashParent"];
 
-class SubframeCrashParent extends JSWindowActorParent {
-}
+class SubframeCrashParent extends JSWindowActorParent {}
--- a/browser/actors/URIFixupChild.jsm
+++ b/browser/actors/URIFixupChild.jsm
@@ -1,34 +1,39 @@
 /* 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/. */
 "use strict";
 
 var EXPORTED_SYMBOLS = ["URIFixupChild"];
 
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
 
 class URIFixupChild extends ActorChild {
   observe(subject) {
     let fixupInfo = subject.QueryInterface(Ci.nsIURIFixupInfo);
     if (!fixupInfo.consumer) {
       return;
     }
 
     // Ignore info from other docshells
-    let parent = fixupInfo.consumer.QueryInterface(Ci.nsIDocShellTreeItem).sameTypeRootTreeItem;
-    if (parent != this.mm.docShell)
+    let parent = fixupInfo.consumer.QueryInterface(Ci.nsIDocShellTreeItem)
+      .sameTypeRootTreeItem;
+    if (parent != this.mm.docShell) {
       return;
+    }
 
     let data = {};
     for (let f of Object.keys(fixupInfo)) {
-      if (f == "consumer" || typeof fixupInfo[f] == "function")
+      if (f == "consumer" || typeof fixupInfo[f] == "function") {
         continue;
+      }
 
       if (fixupInfo[f] && fixupInfo[f] instanceof Ci.nsIURI) {
         data[f] = fixupInfo[f].spec;
       } else {
         data[f] = fixupInfo[f];
       }
     }
 
--- a/browser/actors/WebRTCChild.jsm
+++ b/browser/actors/WebRTCChild.jsm
@@ -1,23 +1,32 @@
 /* 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 = ["WebRTCChild"];
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-const {ActorChild} = ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
-const {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
-XPCOMUtils.defineLazyServiceGetter(this, "MediaManagerService",
-                                   "@mozilla.org/mediaManagerService;1",
-                                   "nsIMediaManagerService");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
+const { ActorChild } = ChromeUtils.import(
+  "resource://gre/modules/ActorChild.jsm"
+);
+const { AppConstants } = ChromeUtils.import(
+  "resource://gre/modules/AppConstants.jsm"
+);
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "MediaManagerService",
+  "@mozilla.org/mediaManagerService;1",
+  "nsIMediaManagerService"
+);
 
 const kBrowserURL = AppConstants.BROWSER_CHROME_URL;
 
 class WebRTCChild extends ActorChild {
   // Called only for 'unload' to remove pending gUM prompts in reloaded frames.
   static handleEvent(aEvent) {
     let contentWindow = aEvent.target.defaultView;
     let mm = getMessageManagerForWindow(contentWindow);
@@ -51,42 +60,58 @@ class WebRTCChild extends ActorChild {
     }
   }
 
   receiveMessage(aMessage) {
     switch (aMessage.name) {
       case "rtcpeer:Allow":
       case "rtcpeer:Deny": {
         let callID = aMessage.data.callID;
-        let contentWindow = Services.wm.getOuterWindowWithId(aMessage.data.windowID);
+        let contentWindow = Services.wm.getOuterWindowWithId(
+          aMessage.data.windowID
+        );
         forgetPCRequest(contentWindow, callID);
-        let topic = (aMessage.name == "rtcpeer:Allow") ? "PeerConnection:response:allow" :
-                                                         "PeerConnection:response:deny";
+        let topic =
+          aMessage.name == "rtcpeer:Allow"
+            ? "PeerConnection:response:allow"
+            : "PeerConnection:response:deny";
         Services.obs.notifyObservers(null, topic, callID);
         break;
       }
       case "webrtc:Allow": {
         let callID = aMessage.data.callID;
-        let contentWindow = Services.wm.getOuterWindowWithId(aMessage.data.windowID);
+        let contentWindow = Services.wm.getOuterWindowWithId(
+          aMessage.data.windowID
+        );
         let devices = contentWindow.pendingGetUserMediaRequests.get(callID);
         forgetGUMRequest(contentWindow, callID);
 
-        let allowedDevices = Cc["@mozilla.org/array;1"]
-                               .createInstance(Ci.nsIMutableArray);
-        for (let deviceIndex of aMessage.data.devices)
-           allowedDevices.appendElement(devices[deviceIndex]);
+        let allowedDevices = Cc["@mozilla.org/array;1"].createInstance(
+          Ci.nsIMutableArray
+        );
+        for (let deviceIndex of aMessage.data.devices) {
+          allowedDevices.appendElement(devices[deviceIndex]);
+        }
 
-        Services.obs.notifyObservers(allowedDevices, "getUserMedia:response:allow", callID);
+        Services.obs.notifyObservers(
+          allowedDevices,
+          "getUserMedia:response:allow",
+          callID
+        );
         break;
       }
       case "webrtc:Deny":
         denyGUMRequest(aMessage.data);
         break;
       case "webrtc:StopSharing":
-        Services.obs.notifyObservers(null, "getUserMedia:revoke", aMessage.data);
+        Services.obs.notifyObservers(
+          null,
+          "getUserMedia:revoke",
+          aMessage.data
+        );
         break;
     }
   }
 }
 
 function handlePCRequest(aSubject, aTopic, aData) {
   let { windowID, innerWindowID, callID, isSecure } = aSubject;
   let contentWindow = Services.wm.getOuterWindowWithId(windowID);
@@ -123,107 +148,137 @@ function handleGUMStop(aSubject, aTopic,
 
   let request = {
     windowID: aSubject.windowID,
     rawID: aSubject.rawID,
     mediaSource: aSubject.mediaSource,
   };
 
   let mm = getMessageManagerForWindow(contentWindow);
-  if (mm)
+  if (mm) {
     mm.sendAsyncMessage("webrtc:StopRecording", request);
+  }
 }
 
 function handleGUMRequest(aSubject, aTopic, aData) {
   let constraints = aSubject.getConstraints();
   let secure = aSubject.isSecure;
   let isHandlingUserInput = aSubject.isHandlingUserInput;
   let contentWindow = Services.wm.getOuterWindowWithId(aSubject.windowID);
 
   contentWindow.navigator.mozGetUserMediaDevices(
     constraints,
     function(devices) {
       // If the window has been closed while we were waiting for the list of
       // devices, there's nothing to do in the callback anymore.
-      if (contentWindow.closed)
+      if (contentWindow.closed) {
         return;
+      }
 
-      prompt(contentWindow, aSubject.windowID, aSubject.callID,
-             constraints, devices, secure, isHandlingUserInput);
+      prompt(
+        contentWindow,
+        aSubject.windowID,
+        aSubject.callID,
+        constraints,
+        devices,
+        secure,
+        isHandlingUserInput
+      );
     },
     function(error) {
       // Device enumeration is done ahead of handleGUMRequest, so we're not
       // responsible for handling the NotFoundError spec case.
-      denyGUMRequest({callID: aSubject.callID});
+      denyGUMRequest({ callID: aSubject.callID });
     },
     aSubject.innerWindowID,
-    aSubject.callID);
+    aSubject.callID
+  );
 }
 
-function prompt(aContentWindow, aWindowID, aCallID, aConstraints, aDevices, aSecure, aIsHandlingUserInput) {
+function prompt(
+  aContentWindow,
+  aWindowID,
+  aCallID,
+  aConstraints,
+  aDevices,
+  aSecure,
+  aIsHandlingUserInput
+) {
   let audioDevices = [];
   let videoDevices = [];
   let devices = [];
 
   // MediaStreamConstraints defines video as 'boolean or MediaTrackConstraints'.
   let video = aConstraints.video || aConstraints.picture;
   let audio = aConstraints.audio;
-  let sharingScreen = video && typeof(video) != "boolean" &&
-                      video.mediaSource != "camera";
-  let sharingAudio = audio && typeof(audio) != "boolean" &&
-                     audio.mediaSource != "microphone";
+  let sharingScreen =
+    video && typeof video != "boolean" && video.mediaSource != "camera";
+  let sharingAudio =
+    audio && typeof audio != "boolean" && audio.mediaSource != "microphone";
   for (let device of aDevices) {
     device = device.QueryInterface(Ci.nsIMediaDevice);
     switch (device.type) {
       case "audioinput":
         // Check that if we got a microphone, we have not requested an audio
         // capture, and if we have requested an audio capture, we are not
         // getting a microphone instead.
         if (audio && (device.mediaSource == "microphone") != sharingAudio) {
-          audioDevices.push({name: device.name, deviceIndex: devices.length,
-                             id: device.rawId, mediaSource: device.mediaSource});
+          audioDevices.push({
+            name: device.name,
+            deviceIndex: devices.length,
+            id: device.rawId,
+            mediaSource: device.mediaSource,
+          });
           devices.push(device);
         }
         break;
       case "videoinput":
         // Verify that if we got a camera, we haven't requested a screen share,
         // or that if we requested a screen share we aren't getting a camera.
         if (video && (device.mediaSource == "camera") != sharingScreen) {
-          let deviceObject = {name: device.name, deviceIndex: devices.length,
-                              id: device.rawId, mediaSource: device.mediaSource};
-          if (device.scary)
+          let deviceObject = {
+            name: device.name,
+            deviceIndex: devices.length,
+            id: device.rawId,
+            mediaSource: device.mediaSource,
+          };
+          if (device.scary) {
             deviceObject.scary = true;
+          }
           videoDevices.push(deviceObject);
           devices.push(device);
         }
         break;
     }
   }
 
   let requestTypes = [];
-  if (videoDevices.length)
+  if (videoDevices.length) {
     requestTypes.push(sharingScreen ? "Screen" : "Camera");
-  if (audioDevices.length)
+  }
+  if (audioDevices.length) {
     requestTypes.push(sharingAudio ? "AudioCapture" : "Microphone");
+  }
 
   if (!requestTypes.length) {
     // Device enumeration is done ahead of handleGUMRequest, so we're not
     // responsible for handling the NotFoundError spec case.
-    denyGUMRequest({callID: aCallID});
+    denyGUMRequest({ callID: aCallID });
     return;
   }
 
   if (!aContentWindow.pendingGetUserMediaRequests) {
     setupPendingListsInitially(aContentWindow);
   }
   aContentWindow.pendingGetUserMediaRequests.set(aCallID, devices);
 
   // Record third party origins for telemetry.
   let isThirdPartyOrigin =
-    aContentWindow.document.location.origin != aContentWindow.top.document.location.origin;
+    aContentWindow.document.location.origin !=
+    aContentWindow.top.document.location.origin;
 
   // WebRTC prompts have a bunch of special requirements, such as being able to
   // grant two permissions (microphone and camera), selecting devices and showing
   // a screen sharing preview. All this could have probably been baked into
   // nsIContentPermissionRequest prompts, but the team that implemented this back
   // then chose to just build their own prompting mechanism instead.
   //
   // So, what you are looking at here is not a real nsIContentPermissionRequest, but
@@ -252,21 +307,23 @@ function denyGUMRequest(aData) {
   let subject;
   if (aData.noOSPermission) {
     subject = "getUserMedia:response:noOSPermission";
   } else {
     subject = "getUserMedia:response:deny";
   }
   Services.obs.notifyObservers(null, subject, aData.callID);
 
-  if (!aData.windowID)
+  if (!aData.windowID) {
     return;
+  }
   let contentWindow = Services.wm.getOuterWindowWithId(aData.windowID);
-  if (contentWindow.pendingGetUserMediaRequests)
+  if (contentWindow.pendingGetUserMediaRequests) {
     forgetGUMRequest(contentWindow, aData.callID);
+  }
 }
 
 function forgetGUMRequest(aContentWindow, aCallID) {
   aContentWindow.pendingGetUserMediaRequests.delete(aCallID);
   forgetPendingListsEventually(aContentWindow);
 }
 
 function forgetPCRequest(aContentWindow, aCallID) {
@@ -279,28 +336,32 @@ function setupPendingListsInitially(aCon
     return;
   }
   aContentWindow.pendingGetUserMediaRequests = new Map();
   aContentWindow.pendingPeerConnectionRequests = new Set();
   aContentWindow.addEventListener("unload", WebRTCChild.handleEvent);
 }
 
 function forgetPendingListsEventually(aContentWindow) {
-  if (aContentWindow.pendingGetUserMediaRequests.size ||
-      aContentWindow.pendingPeerConnectionRequests.size) {
+  if (
+    aContentWindow.pendingGetUserMediaRequests.size ||
+    aContentWindow.pendingPeerConnectionRequests.size
+  ) {
     return;
   }
   aContentWindow.pendingGetUserMediaRequests = null;
   aContentWindow.pendingPeerConnectionRequests = null;
   aContentWindow.removeEventListener("unload", WebRTCChild.handleEvent);
 }
 
 function updateIndicators(aSubject, aTopic, aData) {
-  if (aSubject instanceof Ci.nsIPropertyBag &&
-      aSubject.getProperty("requestURL") == kBrowserURL) {
+  if (
+    aSubject instanceof Ci.nsIPropertyBag &&
+    aSubject.getProperty("requestURL") == kBrowserURL
+  ) {
     // Ignore notifications caused by the browser UI showing previews.
     return;
   }
 
   let contentWindowArray = MediaManagerService.activeMediaCaptureWindows;
   let count = contentWindowArray.length;
 
   let state = {
@@ -312,43 +373,51 @@ function updateIndicators(aSubject, aTop
 
   Services.cpmm.sendAsyncMessage("webrtc:UpdatingIndicators");
 
   // If several iframes in the same page use media streams, it's possible to
   // have the same top level window several times. We use a Set to avoid
   // sending duplicate notifications.
   let contentWindows = new Set();
   for (let i = 0; i < count; ++i) {
-    contentWindows.add(contentWindowArray.queryElementAt(i, Ci.nsISupports).top);
+    contentWindows.add(
+      contentWindowArray.queryElementAt(i, Ci.nsISupports).top
+    );
   }
 
   for (let contentWindow of contentWindows) {
     if (contentWindow.document.documentURI == kBrowserURL) {
       // There may be a preview shown at the same time as other streams.
       continue;
     }
 
     let tabState = getTabStateForContentWindow(contentWindow);
-    if (tabState.camera == MediaManagerService.STATE_CAPTURE_ENABLED ||
-        tabState.camera == MediaManagerService.STATE_CAPTURE_DISABLED) {
+    if (
+      tabState.camera == MediaManagerService.STATE_CAPTURE_ENABLED ||
+      tabState.camera == MediaManagerService.STATE_CAPTURE_DISABLED
+    ) {
       state.showCameraIndicator = true;
     }
-    if (tabState.microphone == MediaManagerService.STATE_CAPTURE_ENABLED ||
-        tabState.microphone == MediaManagerService.STATE_CAPTURE_DISABLED) {
+    if (
+      tabState.microphone == MediaManagerService.STATE_CAPTURE_ENABLED ||
+      tabState.microphone == MediaManagerService.STATE_CAPTURE_DISABLED
+    ) {
       state.showMicrophoneIndicator = true;
     }
     if (tabState.screen) {
       if (tabState.screen.startsWith("Screen")) {
         state.showScreenSharingIndicator = "Screen";
       } else if (tabState.screen.startsWith("Window")) {
-        if (state.showScreenSharingIndicator != "Screen")
+        if (state.showScreenSharingIndicator != "Screen") {
           state.showScreenSharingIndicator = "Window";
+        }
       } else if (tabState.screen.startsWith("Browser")) {
-        if (!state.showScreenSharingIndicator)
+        if (!state.showScreenSharingIndicator) {
           state.showScreenSharingIndicator = "Browser";
+        }
       }
     }
 
     let mm = getMessageManagerForWindow(contentWindow);
     mm.sendAsyncMessage("webrtc:UpdateBrowserIndicators", tabState);
   }
 
   Services.cpmm.sendAsyncMessage("webrtc:UpdateGlobalIndicators", state);
@@ -357,48 +426,64 @@ function updateIndicators(aSubject, aTop
 function removeBrowserSpecificIndicator(aSubject, aTopic, aData) {
   let contentWindow = Services.wm.getOuterWindowWithId(aData).top;
   if (contentWindow.document.documentURI == kBrowserURL) {
     // Ignore notifications caused by the browser UI showing previews.
     return;
   }
 
   let tabState = getTabStateForContentWindow(contentWindow);
-  if (tabState.camera == MediaManagerService.STATE_NOCAPTURE &&
-      tabState.microphone == MediaManagerService.STATE_NOCAPTURE &&
-      !tabState.screen)
-    tabState = {windowId: tabState.windowId};
+  if (
+    tabState.camera == MediaManagerService.STATE_NOCAPTURE &&
+    tabState.microphone == MediaManagerService.STATE_NOCAPTURE &&
+    !tabState.screen
+  ) {
+    tabState = { windowId: tabState.windowId };
+  }
 
   let mm = getMessageManagerForWindow(contentWindow);
-  if (mm)
+  if (mm) {
     mm.sendAsyncMessage("webrtc:UpdateBrowserIndicators", tabState);
+  }
 }
 
 function getTabStateForContentWindow(aContentWindow) {
-  let camera = {}, microphone = {}, screen = {}, window = {}, browser = {};
-  MediaManagerService.mediaCaptureWindowState(aContentWindow,
-                                              camera, microphone,
-                                              screen, window, browser);
-  let tabState = {camera: camera.value, microphone: microphone.value};
-  if (screen.value == MediaManagerService.STATE_CAPTURE_ENABLED)
+  let camera = {},
+    microphone = {},
+    screen = {},
+    window = {},
+    browser = {};
+  MediaManagerService.mediaCaptureWindowState(
+    aContentWindow,
+    camera,
+    microphone,
+    screen,
+    window,
+    browser
+  );
+  let tabState = { camera: camera.value, microphone: microphone.value };
+  if (screen.value == MediaManagerService.STATE_CAPTURE_ENABLED) {
     tabState.screen = "Screen";
-  else if (window.value == MediaManagerService.STATE_CAPTURE_ENABLED)
+  } else if (window.value == MediaManagerService.STATE_CAPTURE_ENABLED) {
     tabState.screen = "Window";
-  else if (browser.value == MediaManagerService.STATE_CAPTURE_ENABLED)
+  } else if (browser.value == MediaManagerService.STATE_CAPTURE_ENABLED) {
     tabState.screen = "Browser";
-  else if (screen.value == MediaManagerService.STATE_CAPTURE_DISABLED)
+  } else if (screen.value == MediaManagerService.STATE_CAPTURE_DISABLED) {
     tabState.screen = "ScreenPaused";
-  else if (window.value == MediaManagerService.STATE_CAPTURE_DISABLED)
+  } else if (window.value == MediaManagerService.STATE_CAPTURE_DISABLED) {
     tabState.screen = "WindowPaused";
-  else if (browser.value == MediaManagerService.STATE_CAPTURE_DISABLED)
+  } else if (browser.value == MediaManagerService.STATE_CAPTURE_DISABLED) {
     tabState.screen = "BrowserPaused";
+  }
 
   let screenEnabled = tabState.screen && !tabState.screen.includes("Paused");
-  let cameraEnabled = tabState.camera == MediaManagerService.STATE_CAPTURE_ENABLED;
-  let microphoneEnabled = tabState.microphone == MediaManagerService.STATE_CAPTURE_ENABLED;
+  let cameraEnabled =
+    tabState.camera == MediaManagerService.STATE_CAPTURE_ENABLED;
+  let microphoneEnabled =
+    tabState.microphone == MediaManagerService.STATE_CAPTURE_ENABLED;
 
   // tabState.sharing controls which global indicator should be shown
   // for the tab. It should always be set to the _enabled_ device which
   // we consider most intrusive (screen > camera > microphone).
   if (screenEnabled) {
     tabState.sharing = "screen";
   } else if (cameraEnabled) {
     tabState.sharing = "camera";
@@ -409,18 +494,18 @@ function getTabStateForContentWindow(aCo
   } else if (tabState.camera) {
     tabState.sharing = "camera";
   } else if (tabState.microphone) {
     tabState.sharing = "microphone";
   }
 
   // The stream is considered paused when we're sharing something
   // but all devices are off or set to disabled.
-  tabState.paused = tabState.sharing &&
-    !screenEnabled && !cameraEnabled && !microphoneEnabled;
+  tabState.paused =
+    tabState.sharing && !screenEnabled && !cameraEnabled && !microphoneEnabled;
 
   tabState.windowId = getInnerWindowIDForWindow(aContentWindow);
   tabState.documentURI = aContentWindow.document.documentURI;
 
   return tabState;
 }
 
 function getInnerWindowIDForWindow(aContentWindow) {