Bug 1577835 - Reformat common/ and ldap/ code. r=mkmelin
authorPaul Morris <paul@thunderbird.net>
Fri, 30 Aug 2019 15:15:33 -0400
changeset 36567 ab9b63f9d2266b4607b926ba227d89ae117bb3f9
parent 36566 23725f0afc965c077f70a3cab7c75245c8e34189
child 36568 8d3544b6352837c58cc4984fdd0412800f863e7c
push id394
push userclokep@gmail.com
push dateMon, 21 Oct 2019 20:22:01 +0000
reviewersmkmelin
bugs1577835
Bug 1577835 - Reformat common/ and ldap/ code. r=mkmelin # ignore-this-changeset These changes were achieved by: 1. Using eslint to add curly brackets to control statements that did not have them (if, else, etc.), thanks to the eslint rule: "curly": ["error", "all"] Done by running |mach eslint common/ --fix| 2. Reformatting the code using Prettier. Done by deleting the common/ and ldap/ lines from the .prettierignore file and running: |mach eslint chat/ --fix|
.prettierignore
common/bindings/customizable-toolbar.js
common/saxparser/test/unit/test_parser.js
common/src/ChromeManifest.jsm
common/src/ExtensionSupport.jsm
common/src/Overlays.jsm
common/src/browser-development-helpers.js
common/src/customizeToolbar.js
common/src/viewSource.js
common/src/viewZoomOverlay.js
common/test/xpcshell/data/BootstrapMonitor.jsm
common/test/xpcshell/head_addons.js
common/test/xpcshell/test_bootstrap.js
common/test/xpcshell/test_bootstrap_const.js
common/test/xpcshell/test_bootstrap_globals.js
common/test/xpcshell/test_bootstrapped_chrome_manifest.js
ldap/xpcom/src/nsLDAPProtocolHandler.js
ldap/xpcom/tests/unit/test_nsLDAPURL.js
--- a/.prettierignore
+++ b/.prettierignore
@@ -6,14 +6,12 @@
 *.xhtml
 *.xul
 *.xml
 
 # Ignore .eslintrc.js for now.
 .eslintrc.js
 
 # Ignore all top-level directories that contain JS files (for now).
-common/**
 editor/**
-ldap/**
 mail/**
 mailnews/**
 suite/**
--- a/common/bindings/customizable-toolbar.js
+++ b/common/bindings/customizable-toolbar.js
@@ -1,11 +1,11 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
-  * License, v. 2.0. If a copy of the MPL was not distributed with this
-  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 /* globals MozXULElement */
 
 // Wrap in a block to prevent leaking to window scope.
 {
   /**
@@ -45,18 +45,18 @@
         }
 
         // Hold on to the palette but remove it from the document.
         toolbox.palette = node;
         toolbox.removeChild(node);
       }
 
       // Build up our contents from the palette.
-      let currentSet = this.getAttribute("currentset") ||
-        this.getAttribute("defaultset");
+      let currentSet =
+        this.getAttribute("currentset") || this.getAttribute("defaultset");
 
       if (currentSet) {
         this.currentSet = currentSet;
       }
     }
 
     /**
      * Get the toolbox element connected to this toolbar.
@@ -67,28 +67,34 @@
       if (this._toolbox) {
         return this._toolbox;
       }
 
       let toolboxId = this.getAttribute("toolboxid");
       if (toolboxId) {
         let toolbox = document.getElementById(toolboxId);
         if (!toolbox) {
-          let tbName = this.hasAttribute("toolbarname") ?
-            ` (${this.getAttribute("toolbarname")})` : "";
+          let tbName = this.hasAttribute("toolbarname")
+            ? ` (${this.getAttribute("toolbarname")})`
+            : "";
 
-          throw new Error(`toolbar ID ${this.id}${tbName}: toolboxid attribute '${toolboxId}' points to a toolbox that doesn't exist`);
+          throw new Error(
+            `toolbar ID ${
+              this.id
+            }${tbName}: toolboxid attribute '${toolboxId}' points to a toolbox that doesn't exist`
+          );
         }
         this._toolbox = toolbox;
         return this._toolbox;
       }
 
-      this._toolbox = (this.parentNode &&
-          this.parentNode.localName == "toolbox") ?
-        this.parentNode : null;
+      this._toolbox =
+        this.parentNode && this.parentNode.localName == "toolbox"
+          ? this.parentNode
+          : null;
 
       return this._toolbox;
     }
 
     /**
      * Sets the current set of items in the toolbar.
      *
      * @param {string} val  Comma-separated list of IDs or "__empty".
@@ -104,17 +110,17 @@
       let paletteChildren = palette ? palette.childNodes : [];
 
       let paletteItems = {};
 
       for (let item of paletteChildren) {
         paletteItems[item.id] = item;
       }
 
-      let ids = (val == "__empty") ? [] : val.split(",");
+      let ids = val == "__empty" ? [] : val.split(",");
       let children = this.childNodes;
       let nodeidx = 0;
       let added = {};
 
       // Iterate over the ids to use on the toolbar.
       for (let id of ids) {
         // Iterate over the existing nodes on the toolbar. nodeidx is the
         // spot where we want to insert items.
@@ -194,19 +200,19 @@
      * @param {Element} node  Return the ID of this node.
      * @return {string}  The ID of the node.
      */
     _idFromNode(node) {
       if (node.getAttribute("skipintoolbarset") == "true") {
         return "";
       }
       const specialItems = {
-        "toolbarseparator": "separator",
-        "toolbarspring": "spring",
-        "toolbarspacer": "spacer",
+        toolbarseparator: "separator",
+        toolbarspring: "spring",
+        toolbarspacer: "spacer",
       };
       return specialItems[node.localName] || node.id;
     }
 
     /**
      * Returns a toolbar item based on the given ID.
      *
      * @param {string} id  The ID for the new toolbar item.
@@ -214,34 +220,37 @@
      */
     _getToolbarItem(id) {
       // Handle special cases.
       if (["separator", "spring", "spacer"].includes(id)) {
         let newItem = document.createXULElement("toolbar" + id);
         // Due to timers resolution Date.now() can be the same for
         // elements created in small timeframes.  So ids are
         // differentiated through a unique count suffix.
-        newItem.id = id + Date.now() + (++this._newElementCount);
+        newItem.id = id + Date.now() + ++this._newElementCount;
         if (id == "spring") {
           newItem.flex = 1;
         }
         return newItem;
       }
 
       let toolbox = this.toolbox;
       if (!toolbox) {
         return null;
       }
 
       // Look for an item with the same id, as the item may be
       // in a different toolbar.
       let item = document.getElementById(id);
-      if (item && item.parentNode &&
-          item.parentNode.localName == "toolbar" &&
-          item.parentNode.toolbox == toolbox) {
+      if (
+        item &&
+        item.parentNode &&
+        item.parentNode.localName == "toolbar" &&
+        item.parentNode.toolbox == toolbox
+      ) {
         return item;
       }
 
       if (toolbox.palette) {
         // Attempt to locate an item with a matching ID within the palette.
         let paletteItem = toolbox.palette.firstChild;
         while (paletteItem) {
           if (paletteItem.id == id) {
@@ -297,16 +306,18 @@
       if (currentSet == "__empty") {
         return false;
       }
 
       let defaultOrNoninteractive = (this.getAttribute("defaultset") || "")
         .split(",")
         .concat(["separator", "spacer", "spring"]);
 
-      return currentSet.split(",")
+      return currentSet
+        .split(",")
         .some(item => !defaultOrNoninteractive.includes(item));
     }
   }
 
-  customElements.define("customizable-toolbar", CustomizableToolbar,
-    { extends: "toolbar" });
+  customElements.define("customizable-toolbar", CustomizableToolbar, {
+    extends: "toolbar",
+  });
 }
--- a/common/saxparser/test/unit/test_parser.js
+++ b/common/saxparser/test/unit/test_parser.js
@@ -1,36 +1,39 @@
-var {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
+var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 
 function updateDocumentSourceMaps(src) {
   const nsISAXXMLReader = Ci.nsISAXXMLReader;
-  const saxReader = Cc["@mozilla.org/saxparser/xmlreader;1"]
-                      .createInstance(nsISAXXMLReader);
+  const saxReader = Cc["@mozilla.org/saxparser/xmlreader;1"].createInstance(
+    nsISAXXMLReader
+  );
   try {
-    saxReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
+    saxReader.setFeature(
+      "http://xml.org/sax/features/namespace-prefixes",
+      true
+    );
     saxReader.setFeature("http://xml.org/sax/features/namespace", true);
   } catch (e) {
     // do nothing, we'll accept it as it is.
   }
   var parseErrorLog = [];
 
   /* XXX ajvincent Because throwing an exception doesn't stop parsing, we need
    * to record errors and handle them after the parsing is finished.
    */
   function do_parse_check(aCondition, aMsg) {
-    if (!aCondition)
+    if (!aCondition) {
       parseErrorLog[parseErrorLog.length] = aMsg;
+    }
   }
 
   var contentHandler = {
-    startDocument() {
-    },
+    startDocument() {},
 
-    endDocument() {
-    },
+    endDocument() {},
 
     handleAttributes(aAttributes) {
       for (var i = 0; i < aAttributes.length; i++) {
         var attrLocalName = aAttributes.getLocalName(i);
         var attrNodeName = aAttributes.getQName(i);
         do_parse_check(attrLocalName, "Missing attribute local name");
         do_parse_check(attrNodeName, "Missing attribute node name");
       }
@@ -43,18 +46,17 @@ function updateDocumentSourceMaps(src) {
       this.handleAttributes(aAttributes);
     },
 
     endElement(aNamespaceURI, aLocalName, aNodeName) {
       do_parse_check(aLocalName, "Missing element local name (endElement)");
       do_parse_check(aNodeName, "Missing element node name (endElement)");
     },
 
-    characters(aData) {
-    },
+    characters(aData) {},
 
     processingInstruction(aTarget, aData) {
       do_parse_check(aTarget, "Missing processing instruction target");
     },
   };
 
   var errorHandler = {
     error(aError) {
@@ -66,30 +68,33 @@ function updateDocumentSourceMaps(src) {
     },
 
     ignorableWarning(aError) {
       do_parse_check(!aError, "XML ignorable warning");
     },
   };
 
   saxReader.contentHandler = contentHandler;
-  saxReader.errorHandler   = errorHandler;
+  saxReader.errorHandler = errorHandler;
 
   let type = "application/xml";
   let uri = NetUtil.newURI("http://example.org/");
 
-  let sStream = Cc["@mozilla.org/io/string-input-stream;1"]
-               .createInstance(Ci.nsIStringInputStream);
+  let sStream = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(
+    Ci.nsIStringInputStream
+  );
   sStream.setData(src, src.length);
-  var bStream = Cc["@mozilla.org/network/buffered-input-stream;1"]
-                .createInstance(Ci.nsIBufferedInputStream);
+  var bStream = Cc[
+    "@mozilla.org/network/buffered-input-stream;1"
+  ].createInstance(Ci.nsIBufferedInputStream);
   bStream.init(sStream, 4096);
 
-  let channel = Cc["@mozilla.org/network/input-stream-channel;1"].
-    createInstance(Ci.nsIInputStreamChannel);
+  let channel = Cc[
+    "@mozilla.org/network/input-stream-channel;1"
+  ].createInstance(Ci.nsIInputStreamChannel);
   channel.setURI(uri);
   channel.contentStream = bStream;
   channel.QueryInterface(Ci.nsIChannel);
   channel.contentType = type;
 
   saxReader.parseAsync(null, uri);
   saxReader.onStartRequest(channel);
 
@@ -99,17 +104,17 @@ function updateDocumentSourceMaps(src) {
     saxReader.onDataAvailable(channel, bStream, pos, count);
     pos += count;
     count = bStream.available();
   }
   saxReader.onStopRequest(channel, Cr.NS_OK);
 
   // Just in case it leaks.
   saxReader.contentHandler = null;
-  saxReader.errorHandler   = null;
+  saxReader.errorHandler = null;
 
   return parseErrorLog;
 }
 
 function do_check_true_with_dump(aCondition, aParseLog) {
   if (!aCondition) {
     dump(aParseLog.join("\n"));
   }
@@ -131,10 +136,13 @@ function run_test() {
 
   // End tag isn't well-formed.
   src = "<!DOCTYPE foo>\n<!-- all your foo are belong to bar -->";
   src += "<foo id='foo'>\n<?foo wooly bully?>\nfoo";
   src += "<![CDATA[foo fighters]]></foo\n";
 
   parseErrorLog = updateDocumentSourceMaps(src);
 
-  do_check_true_with_dump(parseErrorLog.length == 1 && parseErrorLog[0] == "XML fatal error", parseErrorLog);
+  do_check_true_with_dump(
+    parseErrorLog.length == 1 && parseErrorLog[0] == "XML fatal error",
+    parseErrorLog
+  );
 }
--- a/common/src/ChromeManifest.jsm
+++ b/common/src/ChromeManifest.jsm
@@ -1,15 +1,15 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ["ChromeManifest"];
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 /**
  * A parser for chrome.manifest files. Implements a subset of
  * https://developer.mozilla.org/en-US/docs/Mozilla/Chrome_Registration
  */
 class ChromeManifest {
   /**
    * Constucts the chrome.manifest parser
@@ -34,17 +34,16 @@ class ChromeManifest {
     this.contract = new Map();
 
     this.content = new Map();
     this.skin = new Map();
     this.resource = new Map();
     this.override = new Map();
   }
 
-
   /**
    * Parse the given file.
    *
    * @param {String} filename           The filename to load
    * @param {String} base               The relative directory this file is expected to be in.
    * @return {Promise}                  Resolved when loading completes
    */
   async parse(filename = "chrome.manifest", base = "") {
@@ -63,28 +62,48 @@ class ChromeManifest {
     let extraManifests = [];
     for (let line of lines) {
       let parts = line.trim().split(/\s+/);
       let directive = parts.shift();
       switch (directive) {
         case "manifest":
           extraManifests.push(this._parseManifest(base, ...parts));
           break;
-        case "component": this._parseComponent(...parts); break;
-        case "contract": this._parseContract(...parts); break;
+        case "component":
+          this._parseComponent(...parts);
+          break;
+        case "contract":
+          this._parseContract(...parts);
+          break;
 
-        case "category": this._parseCategory(...parts); break;
-        case "content": this._parseContent(...parts); break;
-        case "locale": this._parseLocale(...parts); break;
-        case "skin": this._parseSkin(...parts); break;
-        case "resource": this._parseResource(...parts); break;
+        case "category":
+          this._parseCategory(...parts);
+          break;
+        case "content":
+          this._parseContent(...parts);
+          break;
+        case "locale":
+          this._parseLocale(...parts);
+          break;
+        case "skin":
+          this._parseSkin(...parts);
+          break;
+        case "resource":
+          this._parseResource(...parts);
+          break;
 
-        case "overlay": this._parseOverlay(...parts); break;
-        case "style": this._parseStyle(...parts); break;
-        case "override": this._parseOverride(...parts); break;
+        case "overlay":
+          this._parseOverlay(...parts);
+          break;
+        case "style":
+          this._parseStyle(...parts);
+          break;
+        case "override":
+          this._parseOverride(...parts);
+          break;
       }
     }
 
     await Promise.all(extraManifests);
   }
 
   /**
    * Ensure the flags provided for the instruction match our options
@@ -94,56 +113,70 @@ class ChromeManifest {
    */
   _parseFlags(flags) {
     if (flags.length == 0) {
       return true;
     }
 
     let matchString = (a, sign, b) => {
       if (sign != "=") {
-        console.warn(`Invalid sign ${sign} in ${a}${sign}${b}, dropping manifest instruction`);
+        console.warn(
+          `Invalid sign ${sign} in ${a}${sign}${b}, dropping manifest instruction`
+        );
         return false;
       }
       return a == b;
     };
 
     let matchVersion = (a, sign, b) => {
       switch (sign) {
-        case "=": return Services.vc.compare(a, b) == 0;
-        case ">": return Services.vc.compare(a, b) > 0;
-        case "<": return Services.vc.compare(a, b) < 0;
-        case ">=": return Services.vc.compare(a, b) >= 0;
-        case "<=": return Services.vc.compare(a, b) <= 0;
+        case "=":
+          return Services.vc.compare(a, b) == 0;
+        case ">":
+          return Services.vc.compare(a, b) > 0;
+        case "<":
+          return Services.vc.compare(a, b) < 0;
+        case ">=":
+          return Services.vc.compare(a, b) >= 0;
+        case "<=":
+          return Services.vc.compare(a, b) <= 0;
         default:
-          console.warn(`Invalid sign ${sign} in ${a}${sign}${b}, dropping manifest instruction`);
+          console.warn(
+            `Invalid sign ${sign} in ${a}${sign}${b}, dropping manifest instruction`
+          );
           return false;
       }
     };
 
     let flagMatches = (key, typeMatch) => {
-      return !flagdata.has(key) || flagdata.get(key).some(val => typeMatch(this.options[key], ...val));
+      return (
+        !flagdata.has(key) ||
+        flagdata.get(key).some(val => typeMatch(this.options[key], ...val))
+      );
     };
 
     let flagdata = new DefaultMap(() => []);
 
     for (let flag of flags) {
       let match = flag.match(/(\w+)(>=|<=|<|>|=)(.*)/);
       if (match) {
         flagdata.get(match[1]).push([match[2], match[3]]);
       } else {
         console.warn(`Invalid flag ${flag}, dropping manifest instruction`);
       }
     }
 
-    return flagMatches("application", matchString) &&
-           flagMatches("appversion", matchVersion) &&
-           flagMatches("platformversion", matchVersion) &&
-           flagMatches("os", matchString) &&
-           flagMatches("osversion", matchVersion) &&
-           flagMatches("abi", matchString);
+    return (
+      flagMatches("application", matchString) &&
+      flagMatches("appversion", matchVersion) &&
+      flagMatches("platformversion", matchVersion) &&
+      flagMatches("os", matchString) &&
+      flagMatches("osversion", matchVersion) &&
+      flagMatches("abi", matchString)
+    );
   }
 
   /**
    * Parse the manifest instruction, to load other files
    *
    * @param {String} base       The base directory the manifest file is in
    * @param {String} filename   The file and path to load
    * @param {...String} flags   The flags for this instruction
--- a/common/src/ExtensionSupport.jsm
+++ b/common/src/ExtensionSupport.jsm
@@ -4,23 +4,27 @@
 
 /**
  * Helper functions for use by extensions that should ease them plug
  * into the application.
  */
 
 this.EXPORTED_SYMBOLS = ["ExtensionSupport"];
 
-const {AddonManager} = ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { AddonManager } = ChromeUtils.import(
+  "resource://gre/modules/AddonManager.jsm"
+);
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 // ChromeUtils.import("resource://gre/modules/Deprecated.jsm") - needed for warning.
-const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
+const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
 
-var { fixIterator } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm");
-const {IOUtils} = ChromeUtils.import("resource:///modules/IOUtils.js");
+var { fixIterator } = ChromeUtils.import(
+  "resource:///modules/iteratorUtils.jsm"
+);
+const { IOUtils } = ChromeUtils.import("resource:///modules/IOUtils.js");
 
 var extensionHooks = new Map();
 var legacyExtensions = new Map();
 var bootstrapExtensions = new Set();
 var openWindowList;
 
 var ExtensionSupport = {
   /**
@@ -30,34 +34,42 @@ var ExtensionSupport = {
   loadedLegacyExtensions: {
     set(id, state) {
       legacyExtensions.set(id, state);
     },
     get(id) {
       return legacyExtensions.get(id);
     },
     has(id) {
-      if (!legacyExtensions.has(id))
+      if (!legacyExtensions.has(id)) {
         return false;
+      }
 
       let state = legacyExtensions.get(id);
       return !["install", "enable"].includes(state.pendingOperation);
     },
     hasAnyState(id) {
       return legacyExtensions.has(id);
     },
     _maybeDelete(id, newPendingOperation) {
-      if (!legacyExtensions.has(id))
+      if (!legacyExtensions.has(id)) {
         return;
+      }
 
       let state = legacyExtensions.get(id);
-      if (state.pendingOperation == "enable" && newPendingOperation == "disable") {
+      if (
+        state.pendingOperation == "enable" &&
+        newPendingOperation == "disable"
+      ) {
         legacyExtensions.delete(id);
         this.notifyObservers(state);
-      } else if (state.pendingOperation == "install" && newPendingOperation == "uninstall") {
+      } else if (
+        state.pendingOperation == "install" &&
+        newPendingOperation == "uninstall"
+      ) {
         legacyExtensions.delete(id);
         this.notifyObservers(state);
       }
     },
     notifyObservers(state) {
       let wrappedState = { wrappedJSObject: state };
       Services.obs.notifyObservers(wrappedState, "legacy-addon-status-changed");
     },
@@ -80,74 +92,85 @@ var ExtensionSupport = {
       return runningButNotInstalled;
     },
   },
 
   loadedBootstrapExtensions: bootstrapExtensions,
 
   loadAddonPrefs(addonFile) {
     function setPref(preferDefault, name, value) {
-      let branch = preferDefault ? Services.prefs.getDefaultBranch("") : Services.prefs.getBranch("");
+      let branch = preferDefault
+        ? Services.prefs.getDefaultBranch("")
+        : Services.prefs.getBranch("");
 
       if (typeof value == "boolean") {
         branch.setBoolPref(name, value);
       } else if (typeof value == "string") {
         if (value.startsWith("chrome://") && value.endsWith(".properties")) {
-          let valueLocal = Cc["@mozilla.org/pref-localizedstring;1"]
-                           .createInstance(Ci.nsIPrefLocalizedString);
+          let valueLocal = Cc[
+            "@mozilla.org/pref-localizedstring;1"
+          ].createInstance(Ci.nsIPrefLocalizedString);
           valueLocal.data = value;
           branch.setComplexValue(name, Ci.nsIPrefLocalizedString, valueLocal);
         } else {
           branch.setStringPref(name, value);
         }
       } else if (typeof value == "number" && Number.isInteger(value)) {
         branch.setIntPref(name, value);
       } else if (typeof value == "number" && Number.isFloat(value)) {
         // Floats are set as char prefs, then retrieved using getFloatPref
         branch.setCharPref(name, value);
       }
     }
 
     function walkExtensionPrefs(extensionRoot) {
       let prefFile = extensionRoot.clone();
       let foundPrefStrings = [];
-      if (!prefFile.exists())
+      if (!prefFile.exists()) {
         return [];
+      }
 
       if (prefFile.isDirectory()) {
         prefFile.append("defaults");
         prefFile.append("preferences");
-        if (!prefFile.exists() || !prefFile.isDirectory())
+        if (!prefFile.exists() || !prefFile.isDirectory()) {
           return [];
+        }
 
         let unsortedFiles = [];
         for (let file of fixIterator(prefFile.directoryEntries, Ci.nsIFile)) {
           if (file.isFile() && file.leafName.toLowerCase().endsWith(".js")) {
             unsortedFiles.push(file);
           }
         }
 
-        for (let file of unsortedFiles.sort((a, b) => a.path < b.path ? 1 : -1)) {
+        for (let file of unsortedFiles.sort((a, b) =>
+          a.path < b.path ? 1 : -1
+        )) {
           foundPrefStrings.push(IOUtils.loadFileToString(file));
         }
       } else if (prefFile.isFile() && prefFile.leafName.endsWith("xpi")) {
-        let zipReader = Cc["@mozilla.org/libjar/zip-reader;1"]
-                          .createInstance(Ci.nsIZipReader);
+        let zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(
+          Ci.nsIZipReader
+        );
         zipReader.open(prefFile);
         let entries = zipReader.findEntries("defaults/preferences/*.js");
         let unsortedEntries = [];
         while (entries.hasMore()) {
           unsortedEntries.push(entries.getNext());
         }
 
         for (let entryName of unsortedEntries.sort().reverse()) {
           let stream = zipReader.getInputStream(entryName);
           let entrySize = zipReader.getEntry(entryName).realSize;
           if (entrySize > 0) {
-            let content = NetUtil.readInputStreamToString(stream, entrySize, { charset: "utf-8", replacement: "?" });
+            let content = NetUtil.readInputStreamToString(stream, entrySize, {
+              charset: "utf-8",
+              replacement: "?",
+            });
             foundPrefStrings.push(content);
           }
         }
       }
 
       return foundPrefStrings;
     }
 
@@ -155,17 +178,22 @@ var ExtensionSupport = {
     sandbox.pref = setPref.bind(undefined, true);
     sandbox.user_pref = setPref.bind(undefined, false);
 
     let prefDataStrings = walkExtensionPrefs(addonFile);
     for (let prefDataString of prefDataStrings) {
       try {
         Cu.evalInSandbox(prefDataString, sandbox);
       } catch (e) {
-        Cu.reportError("Error reading default prefs of addon " + addonFile.leafName + ": " + e);
+        Cu.reportError(
+          "Error reading default prefs of addon " +
+            addonFile.leafName +
+            ": " +
+            e
+        );
       }
     }
 
     /*
     TODO: decide whether we need to warn the user/make addon authors to migrate away from these pref files.
     if (prefDataStrings.length > 0) {
       Deprecated.warning(addon.defaultLocale.name + " uses defaults/preferences/*.js files to load prefs",
                          "https://bugzilla.mozilla.org/show_bug.cgi?id=1414398");
@@ -194,37 +222,45 @@ var ExtensionSupport = {
    */
   registerWindowListener(aID, aExtensionHook) {
     if (!aID) {
       Cu.reportError("No extension ID provided for the window listener");
       return false;
     }
 
     if (extensionHooks.has(aID)) {
-      Cu.reportError("Window listener for extension + '" + aID + "' already registered");
+      Cu.reportError(
+        "Window listener for extension + '" + aID + "' already registered"
+      );
       return false;
     }
 
-    if (!("onLoadWindow" in aExtensionHook) && !("onUnloadWindow" in aExtensionHook)) {
-      Cu.reportError("The extension + '" + aID + "' does not provide any callbacks");
+    if (
+      !("onLoadWindow" in aExtensionHook) &&
+      !("onUnloadWindow" in aExtensionHook)
+    ) {
+      Cu.reportError(
+        "The extension + '" + aID + "' does not provide any callbacks"
+      );
       return false;
     }
 
     extensionHooks.set(aID, aExtensionHook);
 
     // Add our global listener if there isn't one already
     // (only when we have first caller).
     if (extensionHooks.size == 1) {
       Services.wm.addListener(this._windowListener);
     }
 
     if (openWindowList) {
       // We already have a list of open windows, notify the caller about them.
       openWindowList.forEach(domWindow =>
-        ExtensionSupport._checkAndRunMatchingExtensions(domWindow, "load", aID));
+        ExtensionSupport._checkAndRunMatchingExtensions(domWindow, "load", aID)
+      );
     } else {
       openWindowList = new Set();
       // Get the list of windows already open.
       let windows = Services.wm.getEnumerator(null);
       while (windows.hasMoreElements()) {
         let domWindow = windows.getNext();
         if (domWindow.document.location.href === "about:blank") {
           ExtensionSupport._waitForLoad(domWindow, aID);
@@ -248,17 +284,19 @@ var ExtensionSupport = {
   unregisterWindowListener(aID) {
     if (!aID) {
       Cu.reportError("No extension ID provided for the window listener");
       return false;
     }
 
     let windowListener = extensionHooks.get(aID);
     if (!windowListener) {
-      Cu.reportError("Couldn't remove window listener for extension + '" + aID + "'");
+      Cu.reportError(
+        "Couldn't remove window listener for extension + '" + aID + "'"
+      );
       return false;
     }
 
     extensionHooks.delete(aID);
     // Remove our global listener if there are no callers registered anymore.
     if (extensionHooks.size == 0) {
       Services.wm.removeListener(this._windowListener);
       openWindowList.clear();
@@ -293,34 +331,42 @@ var ExtensionSupport = {
    * Set up listeners to run the callbacks on the given window.
    *
    * @param aWindow {nsIDOMWindow}  The window to set up.
    * @param aID {String} Optional.  ID of the new caller that has registered right now.
    */
   _waitForLoad(aWindow, aID) {
     // Wait for the load event of the window. At that point
     // aWindow.document.location.href will not be "about:blank" any more.
-    aWindow.addEventListener("load", function() {
-      ExtensionSupport._addToListAndNotify(aWindow, aID);
-    }, { once: true });
+    aWindow.addEventListener(
+      "load",
+      function() {
+        ExtensionSupport._addToListAndNotify(aWindow, aID);
+      },
+      { once: true }
+    );
   },
 
   /**
    * Once the window is fully loaded with the href referring to the XUL document,
    * add it to our list, attach the "unload" listener to it and notify interested
    * callers.
    *
    * @param aWindow {nsIDOMWindow}  The window to process.
    * @param aID {String} Optional.  ID of the new caller that has registered right now.
    */
   _addToListAndNotify(aWindow, aID) {
     openWindowList.add(aWindow);
-    aWindow.addEventListener("unload", function() {
-      ExtensionSupport._checkAndRunMatchingExtensions(aWindow, "unload");
-    }, { once: true });
+    aWindow.addEventListener(
+      "unload",
+      function() {
+        ExtensionSupport._checkAndRunMatchingExtensions(aWindow, "unload");
+      },
+      { once: true }
+    );
     ExtensionSupport._checkAndRunMatchingExtensions(aWindow, "load", aID);
   },
 
   /**
    * Check if the caller matches the given window and run its callback function.
    *
    * @param aWindow {nsIDOMWindow}  The window to run the callbacks on.
    * @param aEventType {String}     Which callback to run if caller matches (load/unload).
@@ -341,29 +387,34 @@ var ExtensionSupport = {
      * and run its callback function.
      *
      * @param aExtensionHook {Object}  The object describing the hook the caller
      *                                 has registered.
      */
     function checkAndRunExtensionCode(aExtensionHook) {
       let windowChromeURL = aWindow.document.location.href;
       // Check if extension applies to this document URL.
-      if (("chromeURLs" in aExtensionHook) &&
-          (!aExtensionHook.chromeURLs.some(url => url == windowChromeURL)))
+      if (
+        "chromeURLs" in aExtensionHook &&
+        !aExtensionHook.chromeURLs.some(url => url == windowChromeURL)
+      ) {
         return;
+      }
 
       // Run the relevant callback.
       switch (aEventType) {
         case "load":
-          if ("onLoadWindow" in aExtensionHook)
+          if ("onLoadWindow" in aExtensionHook) {
             aExtensionHook.onLoadWindow(aWindow);
+          }
           break;
         case "unload":
-          if ("onUnloadWindow" in aExtensionHook)
+          if ("onUnloadWindow" in aExtensionHook) {
             aExtensionHook.onUnloadWindow(aWindow);
+          }
           break;
       }
     }
   },
 
   get registeredWindowListenerCount() {
     return extensionHooks.size;
   },
--- a/common/src/Overlays.jsm
+++ b/common/src/Overlays.jsm
@@ -6,18 +6,26 @@
  * Load overlays in a similar way as XUL did for legacy XUL add-ons.
  */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["Overlays"];
 
 const { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm");
-ChromeUtils.defineModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
-ChromeUtils.defineModuleGetter(this, "setTimeout", "resource://gre/modules/Timer.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Services",
+  "resource://gre/modules/Services.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "setTimeout",
+  "resource://gre/modules/Timer.jsm"
+);
 
 let oconsole = new ConsoleAPI({
   prefix: "Overlays.jsm",
   consoleID: "overlays-jsm",
   maxLogLevelPref: "extensions.overlayloader.loglevel",
 });
 
 /**
@@ -91,43 +99,55 @@ class Overlays {
     while (unloadedOverlays.length) {
       let url = unloadedOverlays.shift();
       let xhr = this.fetchOverlay(url);
       let doc = xhr.responseXML;
 
       oconsole.debug(`Applying ${url} to ${this.location}`);
 
       // clean the document a bit
-      let emptyNodes = doc.evaluate("//text()[normalize-space(.) = '']", doc, null, 7, null);
+      let emptyNodes = doc.evaluate(
+        "//text()[normalize-space(.) = '']",
+        doc,
+        null,
+        7,
+        null
+      );
       for (let i = 0, len = emptyNodes.snapshotLength; i < len; ++i) {
         let node = emptyNodes.snapshotItem(i);
         node.remove();
       }
 
       let commentNodes = doc.evaluate("//comment()", doc, null, 7, null);
       for (let i = 0, len = commentNodes.snapshotLength; i < len; ++i) {
         let node = commentNodes.snapshotItem(i);
         node.remove();
       }
 
       // Force a re-evaluation of inline styles to work around an issue
       // causing inline styles to be initially ignored.
       let styledNodes = doc.evaluate("//*[@style]", doc, null, 7, null);
       for (let i = 0, len = styledNodes.snapshotLength; i < len; ++i) {
         let node = styledNodes.snapshotItem(i);
-        node.style.display = node.style.display;  // eslint-disable-line no-self-assign
+        node.style.display = node.style.display; // eslint-disable-line no-self-assign
       }
 
       // Load css styles from the registry
       for (let sheet of this.overlayProvider.style.get(url, false)) {
         unloadedSheets.push(sheet);
       }
 
       // Load css processing instructions from the overlay
-      let stylesheets = doc.evaluate("/processing-instruction('xml-stylesheet')", doc, null, 7, null);
+      let stylesheets = doc.evaluate(
+        "/processing-instruction('xml-stylesheet')",
+        doc,
+        null,
+        7,
+        null
+      );
       for (let i = 0, len = stylesheets.snapshotLength; i < len; ++i) {
         let node = stylesheets.snapshotItem(i);
         let match = node.nodeValue.match(/href=["']([^"']*)["']/);
         if (match) {
           unloadedSheets.push(new URL(match[1], node.baseURI).href);
         }
       }
 
@@ -167,17 +187,20 @@ class Overlays {
           unresolved.push(ref);
         }
       }
 
       forwardReferences = unresolved;
     }
 
     if (forwardReferences.length) {
-      oconsole.warn(`Could not resolve ${forwardReferences.length} references`, forwardReferences);
+      oconsole.warn(
+        `Could not resolve ${forwardReferences.length} references`,
+        forwardReferences
+      );
     }
 
     // Loading the sheets now to avoid race conditions with xbl bindings
     for (let sheet of unloadedSheets) {
       this.loadCSS(sheet);
     }
 
     this._decksToResolve = new Map();
@@ -217,44 +240,58 @@ class Overlays {
           }
         }
 
         for (let listener of bubbles) {
           this._fireEventListener(listener);
         }
       });
     } else {
-      this.document.defaultView.addEventListener("load", this._finish.bind(this), { once: true });
+      this.document.defaultView.addEventListener(
+        "load",
+        this._finish.bind(this),
+        { once: true }
+      );
     }
   }
 
   _finish() {
     for (let [deck, selectedIndex] of this._decksToResolve.entries()) {
       deck.setAttribute("selectedIndex", selectedIndex);
     }
 
     for (let bar of this._toolbarsToResolve) {
-      let currentset = Services.xulStore.getValue(this.location, bar.id, "currentset");
+      let currentset = Services.xulStore.getValue(
+        this.location,
+        bar.id,
+        "currentset"
+      );
       if (currentset) {
         bar.currentSet = currentset;
       } else if (bar.getAttribute("defaultset")) {
         bar.currentSet = bar.getAttribute("defaultset");
       }
     }
   }
 
   /**
    * Gets the overlays referenced by processing instruction on a document.
    *
    * @param {DOMDocument} document  The document to read instuctions from
    * @return {String[]}             URLs of the overlays from the document
    */
   _collectOverlays(doc) {
     let urls = [];
-    let instructions = doc.evaluate("/processing-instruction('xul-overlay')", doc, null, 7, null);
+    let instructions = doc.evaluate(
+      "/processing-instruction('xul-overlay')",
+      doc,
+      null,
+      7,
+      null
+    );
     for (let i = 0, len = instructions.snapshotLength; i < len; ++i) {
       let node = instructions.snapshotItem(i);
       let match = node.nodeValue.match(/href=["']([^"']*)["']/);
       if (match) {
         urls.push(match[1]);
       }
     }
     return urls;
@@ -293,75 +330,89 @@ class Overlays {
           box = target.closest("toolbox");
         } else {
           // These vanish from the document but still exist via the palette property
           let boxes = [...this.document.getElementsByTagName("toolbox")];
           box = boxes.find(box => box.palette && box.palette.id == node.id);
           let palette = box ? box.palette : null;
 
           if (!palette) {
-            oconsole.debug(`The palette for ${node.id} could not be found, deferring to later`);
+            oconsole.debug(
+              `The palette for ${
+                node.id
+              } could not be found, deferring to later`
+            );
             return false;
           }
 
           target = palette;
         }
 
-        this._toolbarsToResolve.push(...box.querySelectorAll("toolbar:not([type=\"menubar\"])"));
+        this._toolbarsToResolve.push(
+          ...box.querySelectorAll('toolbar:not([type="menubar"])')
+        );
       } else if (!target) {
-        oconsole.debug(`The node ${node.id} could not be found, deferring to later`);
+        oconsole.debug(
+          `The node ${node.id} could not be found, deferring to later`
+        );
         return false;
       }
 
       this._mergeElement(target, node);
     } else {
-       this._insertElement(this.document.documentElement, node);
+      this._insertElement(this.document.documentElement, node);
     }
     return true;
   }
 
   /**
    * Insert the node in the given parent, observing the insertbefore/insertafter/position attributes
    *
    * @param {Element} parent        The parent element to insert the node into.
    * @param {Element} node          The node to insert.
    */
   _insertElement(parent, node) {
     // These elements need their values set before they are added to
     // the document, or bad things happen.
     for (let element of node.querySelectorAll("menulist")) {
       if (element.id && this.persistedIDs.has(element.id)) {
-        element.setAttribute("value", Services.xulStore.getValue(this.location, element.id, "value"));
+        element.setAttribute(
+          "value",
+          Services.xulStore.getValue(this.location, element.id, "value")
+        );
       }
     }
 
     let wasInserted = false;
     let pos = node.getAttribute("insertafter");
     let after = true;
 
     if (!pos) {
       pos = node.getAttribute("insertbefore");
       after = false;
     }
 
     if (pos) {
       for (let id of pos.split(",")) {
         let targetchild = this.document.getElementById(id);
         if (targetchild && targetchild.parentNode == parent) {
-          parent.insertBefore(node, after ? targetchild.nextSibling : targetchild);
+          parent.insertBefore(
+            node,
+            after ? targetchild.nextSibling : targetchild
+          );
           wasInserted = true;
           break;
         }
       }
     }
 
     if (!wasInserted) {
       // position is 1-based
       let position = parseInt(node.getAttribute("position"), 10);
-      if (position > 0 && (position - 1) <= parent.childNodes.length) {
+      if (position > 0 && position - 1 <= parent.childNodes.length) {
         parent.insertBefore(node, parent.childNodes[position - 1]);
         wasInserted = true;
       }
     }
 
     if (!wasInserted) {
       parent.appendChild(node);
     }
@@ -381,24 +432,30 @@ class Overlays {
         continue;
       }
 
       if (attribute.name == "removeelement" && attribute.value == "true") {
         target.remove();
         return;
       }
 
-      target.setAttributeNS(attribute.namespaceURI, attribute.name, attribute.value);
+      target.setAttributeNS(
+        attribute.namespaceURI,
+        attribute.name,
+        attribute.value
+      );
     }
 
     for (let i = 0, len = node.childElementCount; i < len; i++) {
       let child = node.firstElementChild;
       child.remove();
 
-      let elementInDocument = child.id ? this.document.getElementById(child.id) : null;
+      let elementInDocument = child.id
+        ? this.document.getElementById(child.id)
+        : null;
       let parentId = elementInDocument ? elementInDocument.parentNode.id : null;
 
       if (parentId && parentId == target.id) {
         this._mergeElement(elementInDocument, child);
       } else {
         this._insertElement(target, child);
       }
     }
@@ -408,29 +465,33 @@ class Overlays {
    * Fetches the overlay from the given chrome:// or resource:// URL. This happen synchronously so
    * we have a chance to complete before the load event.
    *
    * @param {String} srcUrl                         The URL to load
    * @return {XMLHttpRequest}                       The completed XHR.
    */
   fetchOverlay(srcUrl) {
     if (!srcUrl.startsWith("chrome://") && !srcUrl.startsWith("resource://")) {
-      throw new Error("May only load overlays from chrome:// or resource:// uris");
+      throw new Error(
+        "May only load overlays from chrome:// or resource:// uris"
+      );
     }
 
     let xhr = new XMLHttpRequest();
     xhr.overrideMimeType("application/xml");
     xhr.open("GET", srcUrl, false);
 
     // Elevate the request, so DTDs will work. Should not be a security issue since we
     // only load chrome, resource and file URLs, and that is our privileged chrome package.
     try {
       xhr.channel.owner = Services.scriptSecurityManager.getSystemPrincipal();
     } catch (ex) {
-      oconsole.error("Failed to set system principal while fetching overlay " + srcUrl);
+      oconsole.error(
+        "Failed to set system principal while fetching overlay " + srcUrl
+      );
       xhr.close();
       throw new Error("Failed to set system principal");
     }
 
     xhr.send(null);
     return xhr;
   }
 
@@ -443,44 +504,56 @@ class Overlays {
    *                                                  describing load handlers the script creates
    *                                                  when first run.
    */
   loadScript(node) {
     let deferredLoad = [];
 
     let oldAddEventListener = this.window.addEventListener;
     if (this.document.readyState == "complete") {
-      this.window.addEventListener = function(type, listener, useCapture, ...args) {
+      this.window.addEventListener = function(
+        type,
+        listener,
+        useCapture,
+        ...args
+      ) {
         if (type == "load") {
           if (typeof useCapture == "object") {
             useCapture = useCapture.capture;
           }
 
           if (typeof useCapture == "undefined") {
             useCapture = true;
           }
           deferredLoad.push({ listener, useCapture });
           return null;
         }
-        return oldAddEventListener.call(this, type, listener, useCapture, ...args);
+        return oldAddEventListener.call(
+          this,
+          type,
+          listener,
+          useCapture,
+          ...args
+        );
       };
     }
 
     if (node.hasAttribute("src")) {
       let url = new URL(node.getAttribute("src"), node.baseURI).href;
       oconsole.debug(`Loading script ${url} into ${this.window.location}`);
       try {
         Services.scriptloader.loadSubScript(url, this.window);
       } catch (ex) {
         Cu.reportError(ex);
       }
     } else if (node.textContent) {
       oconsole.debug(`Loading eval'd script into ${this.window.location}`);
       try {
-        let dataURL = "data:application/javascript," + encodeURIComponent(node.textContent);
+        let dataURL =
+          "data:application/javascript," + encodeURIComponent(node.textContent);
         // It would be great if we could have script errors show the right url, but for now
         // loadSubScript will have to do.
         Services.scriptloader.loadSubScript(dataURL, this.window);
       } catch (ex) {
         Cu.reportError(ex);
       }
     }
 
@@ -499,17 +572,20 @@ class Overlays {
    * @param {String} url        The url to load from
    * @return {Element}          An HTML link element for this stylesheet
    */
   loadCSS(url) {
     oconsole.debug(`Loading ${url} into ${this.window.location}`);
 
     // domWindowUtils.loadSheetUsingURIString doesn't record the sheet in document.styleSheets,
     // adding a html link element seems to do so.
-    let link = this.document.createElementNS("http://www.w3.org/1999/xhtml", "link");
+    let link = this.document.createElementNS(
+      "http://www.w3.org/1999/xhtml",
+      "link"
+    );
     link.setAttribute("rel", "stylesheet");
     link.setAttribute("type", "text/css");
     link.setAttribute("href", url);
 
     this.document.documentElement.appendChild(link);
     return link;
   }
 }
--- a/common/src/browser-development-helpers.js
+++ b/common/src/browser-development-helpers.js
@@ -13,21 +13,24 @@ var DevelopmentHelpers = {
   init() {
     this.quickRestart = this.quickRestart.bind(this);
     this.addRestartShortcut();
   },
 
   quickRestart() {
     Services.obs.notifyObservers(null, "startupcache-invalidate");
 
-    let env = Cc["@mozilla.org/process/environment;1"].
-              getService(Ci.nsIEnvironment);
+    let env = Cc["@mozilla.org/process/environment;1"].getService(
+      Ci.nsIEnvironment
+    );
     env.set("MOZ_DISABLE_SAFE_MODE_KEY", "1");
 
-    Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
+    Services.startup.quit(
+      Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart
+    );
   },
 
   addRestartShortcut() {
     let command = document.createXULElement("command");
     command.setAttribute("id", "cmd_quickRestart");
     command.addEventListener("command", this.quickRestart, true);
     command.setAttribute("oncommand", "void 0;"); // Needed - bug 371900
     document.getElementById("mainCommandSet").prepend(command);
--- a/common/src/customizeToolbar.js
+++ b/common/src/customizeToolbar.js
@@ -4,25 +4,26 @@
 
 var gToolboxDocument = null;
 var gToolbox = null;
 var gCurrentDragOverItem = null;
 var gToolboxChanged = false;
 var gToolboxSheet = false;
 var gPaletteBox = null;
 
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { AppConstants } = ChromeUtils.import(
+  "resource://gre/modules/AppConstants.jsm"
+);
 
 function onLoad() {
   if ("arguments" in window && window.arguments[0]) {
     InitWithToolbox(window.arguments[0]);
     repositionDialog(window);
-  } else if (window.frameElement &&
-           "toolbox" in window.frameElement) {
+  } else if (window.frameElement && "toolbox" in window.frameElement) {
     gToolboxSheet = true;
     InitWithToolbox(window.frameElement.toolbox);
     repositionDialog(window.frameElement.panel);
   }
 }
 
 function InitWithToolbox(aToolbox) {
   gToolbox = aToolbox;
@@ -41,25 +42,27 @@ function InitWithToolbox(aToolbox) {
     elts[i].addEventListener("dragexit", onToolbarDragExit, true);
     elts[i].addEventListener("drop", onToolbarDrop, true);
   }
 
   initDialog();
 }
 
 function onClose() {
-  if (!gToolboxSheet)
+  if (!gToolboxSheet) {
     window.close();
-  else
+  } else {
     finishToolbarCustomization();
+  }
 }
 
 function onUnload() {
-  if (!gToolboxSheet)
+  if (!gToolboxSheet) {
     finishToolbarCustomization();
+  }
 }
 
 function finishToolbarCustomization() {
   removeToolboxListeners();
   unwrapToolbarItems();
   persistCurrentSets();
   gToolbox.customizing = false;
   forEachCustomizableToolbar(function(toolbar) {
@@ -69,54 +72,60 @@ function finishToolbarCustomization() {
   notifyParentComplete();
 }
 
 function initDialog() {
   var mode = gToolbox.getAttribute("mode");
   document.getElementById("modelist").value = mode;
   var smallIconsCheckbox = document.getElementById("smallicons");
   smallIconsCheckbox.checked = gToolbox.getAttribute("iconsize") == "small";
-  if (mode == "text")
+  if (mode == "text") {
     smallIconsCheckbox.disabled = true;
+  }
 
   if (AppConstants.MOZ_APP_NAME == "thunderbird") {
-      document.getElementById("showTitlebar").checked =
-        !Services.prefs.getBoolPref("mail.tabs.drawInTitlebar");
-      document.getElementById("showDragSpace").checked =
-        Services.prefs.getBoolPref("mail.tabs.extraDragSpace");
-    if (window.opener &&
-       (window.opener.document.documentElement.getAttribute("windowtype") ==
-        "mail:3pane")) {
+    document.getElementById(
+      "showTitlebar"
+    ).checked = !Services.prefs.getBoolPref("mail.tabs.drawInTitlebar");
+    document.getElementById(
+      "showDragSpace"
+    ).checked = Services.prefs.getBoolPref("mail.tabs.extraDragSpace");
+    if (
+      window.opener &&
+      window.opener.document.documentElement.getAttribute("windowtype") ==
+        "mail:3pane"
+    ) {
       document.getElementById("titlebarSettings").hidden = false;
     }
   }
 
   // Build up the palette of other items.
   buildPalette();
 
   // Wrap all the items on the toolbar in toolbarpaletteitems.
   wrapToolbarItems();
 }
 
 function repositionDialog(aWindow) {
   // Position the dialog touching the bottom of the toolbox and centered with
   // it.
-  if (!aWindow)
+  if (!aWindow) {
     return;
+  }
 
   var width;
-  if (aWindow != window)
+  if (aWindow != window) {
     width = aWindow.getBoundingClientRect().width;
-  else if (document.documentElement.hasAttribute("width"))
+  } else if (document.documentElement.hasAttribute("width")) {
     width = document.documentElement.getAttribute("width");
-  else
+  } else {
     width = parseInt(document.documentElement.style.width);
+  }
   var boundingRect = gToolbox.getBoundingClientRect();
-  var screenX = gToolbox.screenX
-                + ((boundingRect.width - width) / 2);
+  var screenX = gToolbox.screenX + (boundingRect.width - width) / 2;
   var screenY = gToolbox.screenY + boundingRect.height;
 
   aWindow.moveTo(screenX, screenY);
 }
 
 function removeToolboxListeners() {
   var elts = getRootElements();
   for (let i = 0; i < elts.length; i++) {
@@ -127,59 +136,63 @@ function removeToolboxListeners() {
   }
 }
 
 /**
  * Invoke a callback on the toolbox to notify it that the dialog is done
  * and going away.
  */
 function notifyParentComplete() {
-  if ("customizeDone" in gToolbox)
+  if ("customizeDone" in gToolbox) {
     gToolbox.customizeDone(gToolboxChanged);
+  }
   dispatchCustomizationEvent("aftercustomization");
 }
 
 function toolboxChanged(aType) {
   gToolboxChanged = true;
-  if ("customizeChange" in gToolbox)
+  if ("customizeChange" in gToolbox) {
     gToolbox.customizeChange(aType);
+  }
   dispatchCustomizationEvent("customizationchange");
 }
 
 function dispatchCustomizationEvent(aEventName) {
   var evt = document.createEvent("Events");
   evt.initEvent(aEventName, true, true);
   gToolbox.dispatchEvent(evt);
 }
 
 /**
  * Persist the current set of buttons in all customizable toolbars to
  * localstore.
  */
 function persistCurrentSets() {
-  if (!gToolboxChanged || gToolboxDocument.defaultView.closed)
+  if (!gToolboxChanged || gToolboxDocument.defaultView.closed) {
     return;
+  }
 
   forEachCustomizableToolbar(function(toolbar) {
     // Calculate currentset and store it in the attribute.
     var currentSet = toolbar.currentSet;
     toolbar.setAttribute("currentset", currentSet);
     Services.xulStore.persist(toolbar, "currentset");
   });
 }
 
 /**
  * Wraps all items in all customizable toolbars in a toolbox.
  */
 function wrapToolbarItems() {
   forEachCustomizableToolbar(function(toolbar) {
     for (let item of toolbar.childNodes) {
       if (AppConstants.platform == "macosx") {
-        if (item.firstChild && item.firstChild.localName == "menubar")
+        if (item.firstChild && item.firstChild.localName == "menubar") {
           return;
+        }
       }
       if (isToolbarItem(item)) {
         let wrapper = wrapToolbarItem(item);
         cleanupItemForToolbar(item, wrapper);
       }
     }
   });
 }
@@ -258,31 +271,33 @@ function wrapToolbarItem(aToolbarItem) {
 /**
  * Get the list of ids for the current set of items on each toolbar.
  */
 function getCurrentItemIds() {
   var currentItems = {};
   forEachCustomizableToolbar(function(toolbar) {
     var child = toolbar.firstChild;
     while (child) {
-      if (isToolbarItem(child))
+      if (isToolbarItem(child)) {
         currentItems[child.id] = 1;
+      }
       child = child.nextSibling;
     }
   });
   return currentItems;
 }
 
 /**
  * Builds the palette of draggable items that are not yet in a toolbar.
  */
 function buildPalette() {
   // Empty the palette first.
-  while (gPaletteBox.lastChild)
+  while (gPaletteBox.lastChild) {
     gPaletteBox.removeChild(gPaletteBox.lastChild);
+  }
 
   // Add the toolbar separator item.
   var templateNode = document.createXULElement("toolbarseparator");
   templateNode.id = "separator";
   wrapPaletteItem(templateNode);
 
   // Add the toolbar spring item.
   templateNode = document.createXULElement("toolbarspring");
@@ -366,30 +381,33 @@ function cleanupItemForToolbar(aItem, aW
     aItem.disabled = false;
   }
 }
 
 /**
  * Restore all the properties that we stripped off above.
  */
 function restoreItemForToolbar(aItem, aWrapper) {
-  if (aWrapper.hasAttribute("itemdisabled"))
+  if (aWrapper.hasAttribute("itemdisabled")) {
     aItem.disabled = true;
+  }
 
-  if (aWrapper.hasAttribute("itemchecked"))
+  if (aWrapper.hasAttribute("itemchecked")) {
     aItem.checked = true;
+  }
 
   if (aWrapper.hasAttribute("itemcommand")) {
     let commandID = aWrapper.getAttribute("itemcommand");
     aItem.setAttribute("command", commandID);
 
     // XXX Bug 309953 - toolbarbuttons aren't in sync with their commands after customizing
     let command = gToolboxDocument.getElementById(commandID);
-    if (command && command.hasAttribute("disabled"))
+    if (command && command.hasAttribute("disabled")) {
       aItem.setAttribute("disabled", command.getAttribute("disabled"));
+    }
   }
 }
 
 function setWrapperType(aItem, aWrapper) {
   if (aItem.localName == "toolbarseparator") {
     aWrapper.setAttribute("type", "separator");
   } else if (aItem.localName == "toolbarspring") {
     aWrapper.setAttribute("type", "spring");
@@ -404,22 +422,24 @@ function setDragActive(aItem, aValue) {
   var node = aItem;
   var direction = window.getComputedStyle(aItem).direction;
   var value = direction == "ltr" ? "left" : "right";
   if (aItem.localName == "toolbar") {
     node = aItem.lastChild;
     value = direction == "ltr" ? "right" : "left";
   }
 
-  if (!node)
+  if (!node) {
     return;
+  }
 
   if (aValue) {
-    if (!node.hasAttribute("dragover"))
+    if (!node.hasAttribute("dragover")) {
       node.setAttribute("dragover", value);
+    }
   } else {
     node.removeAttribute("dragover");
   }
 }
 
 /**
  * Restore the default set of buttons to fixed toolbars,
  * remove all custom toolbars, and rebuild the palette.
@@ -439,22 +459,23 @@ function restoreDefaultSet() {
     } else {
       child = child.previousSibling;
     }
   }
 
   // Restore the defaultset for fixed toolbars.
   forEachCustomizableToolbar(function(toolbar) {
     var defaultSet = toolbar.getAttribute("defaultset");
-    if (defaultSet)
+    if (defaultSet) {
       toolbar.currentSet = defaultSet;
+    }
   });
 
   // Restore the default icon size and mode.
-  document.getElementById("smallicons").checked = (updateIconSize() == "small");
+  document.getElementById("smallicons").checked = updateIconSize() == "small";
   document.getElementById("modelist").value = updateToolbarMode();
 
   // Now rebuild the palette.
   buildPalette();
 
   // Now re-wrap the items on the toolbar.
   wrapToolbarItems();
 
@@ -462,109 +483,130 @@ function restoreDefaultSet() {
 }
 
 function updateIconSize(aSize) {
   return updateToolboxProperty("iconsize", aSize, "large");
 }
 
 function updateTitlebar() {
   let titlebarCheckbox = document.getElementById("showTitlebar");
-  Services.prefs.setBoolPref("mail.tabs.drawInTitlebar", !titlebarCheckbox.checked);
+  Services.prefs.setBoolPref(
+    "mail.tabs.drawInTitlebar",
+    !titlebarCheckbox.checked
+  );
 
   // Bring the customizeToolbar window to front (on linux it's behind the main
   // window). Otherwise the customization window gets left in the background.
   setTimeout(() => window.focus(), 100);
 }
 
 function updateDragSpace() {
   let dragSpaceCheckbox = document.getElementById("showDragSpace");
-  Services.prefs.setBoolPref("mail.tabs.extraDragSpace", dragSpaceCheckbox.checked);
+  Services.prefs.setBoolPref(
+    "mail.tabs.extraDragSpace",
+    dragSpaceCheckbox.checked
+  );
 
   // Bring the customizeToolbar window to front (on linux it's behind the main
   // window). Otherwise the customization window gets left in the background.
   setTimeout(() => window.focus(), 100);
 }
 
 function updateToolbarMode(aModeValue) {
   var mode = updateToolboxProperty("mode", aModeValue, "icons");
 
   var iconSizeCheckbox = document.getElementById("smallicons");
   iconSizeCheckbox.disabled = mode == "text";
 
   return mode;
 }
 
 function updateToolboxProperty(aProp, aValue, aToolkitDefault) {
-  var toolboxDefault = gToolbox.getAttribute("default" + aProp) ||
-                       aToolkitDefault;
+  var toolboxDefault =
+    gToolbox.getAttribute("default" + aProp) || aToolkitDefault;
 
   gToolbox.setAttribute(aProp, aValue || toolboxDefault);
   Services.xulStore.persist(gToolbox, aProp);
 
   forEachCustomizableToolbar(function(toolbar) {
-    var toolbarDefault = toolbar.getAttribute("default" + aProp) ||
-                         toolboxDefault;
-    if (toolbar.getAttribute("lock" + aProp) == "true" &&
-        toolbar.getAttribute(aProp) == toolbarDefault)
+    var toolbarDefault =
+      toolbar.getAttribute("default" + aProp) || toolboxDefault;
+    if (
+      toolbar.getAttribute("lock" + aProp) == "true" &&
+      toolbar.getAttribute(aProp) == toolbarDefault
+    ) {
       return;
+    }
 
     toolbar.setAttribute(aProp, aValue || toolbarDefault);
     Services.xulStore.persist(toolbar, aProp);
   });
 
   toolboxChanged(aProp);
 
   return aValue || toolboxDefault;
 }
 
 function forEachCustomizableToolbar(callback) {
   if (window.frameElement && "externalToolbars" in window.frameElement) {
     Array.from(window.frameElement.externalToolbars)
-      .filter(isCustomizableToolbar).forEach(callback);
+      .filter(isCustomizableToolbar)
+      .forEach(callback);
   } else if ("arguments" in window && window.arguments[1].length > 0) {
-    Array.from(window.arguments[1]).filter(isCustomizableToolbar).forEach(callback);
+    Array.from(window.arguments[1])
+      .filter(isCustomizableToolbar)
+      .forEach(callback);
   }
-  Array.from(gToolbox.childNodes).filter(isCustomizableToolbar).forEach(callback);
+  Array.from(gToolbox.childNodes)
+    .filter(isCustomizableToolbar)
+    .forEach(callback);
 }
 
 function isCustomizableToolbar(aElt) {
-  return aElt.localName == "toolbar" &&
-         aElt.getAttribute("customizable") == "true";
+  return (
+    aElt.localName == "toolbar" && aElt.getAttribute("customizable") == "true"
+  );
 }
 
 function isSpecialItem(aElt) {
-  return aElt.localName == "toolbarseparator" ||
-         aElt.localName == "toolbarspring" ||
-         aElt.localName == "toolbarspacer";
+  return (
+    aElt.localName == "toolbarseparator" ||
+    aElt.localName == "toolbarspring" ||
+    aElt.localName == "toolbarspacer"
+  );
 }
 
 function isToolbarItem(aElt) {
-  return aElt.localName == "toolbarbutton" ||
-         aElt.localName == "toolbaritem" ||
-         aElt.localName == "toolbarseparator" ||
-         aElt.localName == "toolbarspring" ||
-         aElt.localName == "toolbarspacer";
+  return (
+    aElt.localName == "toolbarbutton" ||
+    aElt.localName == "toolbaritem" ||
+    aElt.localName == "toolbarseparator" ||
+    aElt.localName == "toolbarspring" ||
+    aElt.localName == "toolbarspacer"
+  );
 }
 
 // Drag and Drop observers
 
 function onToolbarDragExit(aEvent) {
   if (isUnwantedDragEvent(aEvent)) {
     return;
   }
 
-  if (gCurrentDragOverItem)
+  if (gCurrentDragOverItem) {
     setDragActive(gCurrentDragOverItem, false);
+  }
 }
 
 function onToolbarDragStart(aEvent) {
   var item = aEvent.target;
   while (item && item.localName != "toolbarpaletteitem") {
-    if (item.localName == "toolbar")
+    if (item.localName == "toolbar") {
       return;
+    }
     item = item.parentNode;
   }
 
   item.setAttribute("dragactive", "true");
 
   var dt = aEvent.dataTransfer;
   var documentId = gToolboxDocument.documentElement.id;
   dt.setData("text/toolbarwrapper-id/" + documentId, item.firstChild.id);
@@ -572,18 +614,23 @@ function onToolbarDragStart(aEvent) {
 }
 
 function onToolbarDragOver(aEvent) {
   if (isUnwantedDragEvent(aEvent)) {
     return;
   }
 
   var documentId = gToolboxDocument.documentElement.id;
-  if (!aEvent.dataTransfer.types.includes("text/toolbarwrapper-id/" + documentId.toLowerCase()))
+  if (
+    !aEvent.dataTransfer.types.includes(
+      "text/toolbarwrapper-id/" + documentId.toLowerCase()
+    )
+  ) {
     return;
+  }
 
   var toolbar = aEvent.target;
   var dropTarget = aEvent.target;
   while (toolbar && toolbar.localName != "toolbar") {
     dropTarget = toolbar;
     toolbar = toolbar.parentNode;
   }
 
@@ -597,27 +644,29 @@ function onToolbarDragOver(aEvent) {
 
   if (dropTarget.localName == "toolbar") {
     gCurrentDragOverItem = dropTarget;
   } else {
     gCurrentDragOverItem = null;
 
     var direction = window.getComputedStyle(dropTarget.parentNode).direction;
     var boundingRect = dropTarget.getBoundingClientRect();
-    var dropTargetCenter = boundingRect.x + (boundingRect.width / 2);
+    var dropTargetCenter = boundingRect.x + boundingRect.width / 2;
     var dragAfter;
-    if (direction == "ltr")
+    if (direction == "ltr") {
       dragAfter = aEvent.clientX > dropTargetCenter;
-    else
+    } else {
       dragAfter = aEvent.clientX < dropTargetCenter;
+    }
 
     if (dragAfter) {
       gCurrentDragOverItem = dropTarget.nextSibling;
-      if (!gCurrentDragOverItem)
+      if (!gCurrentDragOverItem) {
         gCurrentDragOverItem = toolbar;
+      }
     } else {
       gCurrentDragOverItem = dropTarget;
     }
   }
 
   if (previousDragItem && gCurrentDragOverItem != previousDragItem) {
     setDragActive(previousDragItem, false);
   }
@@ -628,134 +677,162 @@ function onToolbarDragOver(aEvent) {
   aEvent.stopPropagation();
 }
 
 function onToolbarDrop(aEvent) {
   if (isUnwantedDragEvent(aEvent)) {
     return;
   }
 
-  if (!gCurrentDragOverItem)
+  if (!gCurrentDragOverItem) {
     return;
+  }
 
   setDragActive(gCurrentDragOverItem, false);
 
   var documentId = gToolboxDocument.documentElement.id;
-  var draggedItemId = aEvent.dataTransfer.getData("text/toolbarwrapper-id/" + documentId);
-  if (gCurrentDragOverItem.id == draggedItemId)
+  var draggedItemId = aEvent.dataTransfer.getData(
+    "text/toolbarwrapper-id/" + documentId
+  );
+  if (gCurrentDragOverItem.id == draggedItemId) {
     return;
+  }
 
   var toolbar = aEvent.target;
-  while (toolbar.localName != "toolbar")
+  while (toolbar.localName != "toolbar") {
     toolbar = toolbar.parentNode;
+  }
 
-  var draggedPaletteWrapper = document.getElementById("wrapper-" + draggedItemId);
+  var draggedPaletteWrapper = document.getElementById(
+    "wrapper-" + draggedItemId
+  );
   if (!draggedPaletteWrapper) {
     // The wrapper has been dragged from the toolbar.
     // Get the wrapper from the toolbar document and make sure that
     // it isn't being dropped on itself.
     let wrapper = gToolboxDocument.getElementById("wrapper-" + draggedItemId);
-    if (wrapper == gCurrentDragOverItem)
-       return;
+    if (wrapper == gCurrentDragOverItem) {
+      return;
+    }
 
     // Don't allow non-removable kids (e.g., the menubar) to move.
-    if (wrapper.firstChild.getAttribute("removable") != "true")
+    if (wrapper.firstChild.getAttribute("removable") != "true") {
       return;
+    }
 
     // Remove the item from its place in the toolbar.
     wrapper.remove();
 
     // Determine which toolbar we are dropping on.
     var dropToolbar = null;
-    if (gCurrentDragOverItem.localName == "toolbar")
+    if (gCurrentDragOverItem.localName == "toolbar") {
       dropToolbar = gCurrentDragOverItem;
-    else
+    } else {
       dropToolbar = gCurrentDragOverItem.parentNode;
+    }
 
     // Insert the item into the toolbar.
-    if (gCurrentDragOverItem != dropToolbar)
+    if (gCurrentDragOverItem != dropToolbar) {
       dropToolbar.insertBefore(wrapper, gCurrentDragOverItem);
-    else
+    } else {
       dropToolbar.appendChild(wrapper);
+    }
   } else {
     // The item has been dragged from the palette
 
     // Create a new wrapper for the item. We don't know the id yet.
     let wrapper = createWrapper("", gToolboxDocument);
 
     // Ask the toolbar to clone the item's template, place it inside the wrapper, and insert it in the toolbar.
-    var newItem = toolbar.insertItem(draggedItemId, gCurrentDragOverItem == toolbar ? null : gCurrentDragOverItem, wrapper);
+    var newItem = toolbar.insertItem(
+      draggedItemId,
+      gCurrentDragOverItem == toolbar ? null : gCurrentDragOverItem,
+      wrapper
+    );
 
     // Prepare the item and wrapper to look good on the toolbar.
     cleanupItemForToolbar(newItem, wrapper);
     wrapper.id = "wrapper-" + newItem.id;
     wrapper.flex = newItem.flex;
 
     // Remove the wrapper from the palette.
-    if (draggedItemId != "separator" &&
-        draggedItemId != "spring" &&
-        draggedItemId != "spacer")
+    if (
+      draggedItemId != "separator" &&
+      draggedItemId != "spring" &&
+      draggedItemId != "spacer"
+    ) {
       gPaletteBox.removeChild(draggedPaletteWrapper);
+    }
   }
 
   gCurrentDragOverItem = null;
 
   toolboxChanged();
 }
 
 function onPaletteDragOver(aEvent) {
   if (isUnwantedDragEvent(aEvent)) {
     return;
   }
   var documentId = gToolboxDocument.documentElement.id;
-  if (aEvent.dataTransfer.types.includes("text/toolbarwrapper-id/" + documentId.toLowerCase()))
+  if (
+    aEvent.dataTransfer.types.includes(
+      "text/toolbarwrapper-id/" + documentId.toLowerCase()
+    )
+  ) {
     aEvent.preventDefault();
+  }
 }
 
 function onPaletteDrop(aEvent) {
   if (isUnwantedDragEvent(aEvent)) {
     return;
   }
   var documentId = gToolboxDocument.documentElement.id;
-  var itemId = aEvent.dataTransfer.getData("text/toolbarwrapper-id/" + documentId);
+  var itemId = aEvent.dataTransfer.getData(
+    "text/toolbarwrapper-id/" + documentId
+  );
 
   var wrapper = gToolboxDocument.getElementById("wrapper-" + itemId);
   if (wrapper) {
     // Don't allow non-removable kids (e.g., the menubar) to move.
-    if (wrapper.firstChild.getAttribute("removable") != "true")
+    if (wrapper.firstChild.getAttribute("removable") != "true") {
       return;
+    }
 
     var wrapperType = wrapper.getAttribute("type");
-    if (wrapperType != "separator" &&
-        wrapperType != "spacer" &&
-        wrapperType != "spring") {
+    if (
+      wrapperType != "separator" &&
+      wrapperType != "spacer" &&
+      wrapperType != "spring"
+    ) {
       restoreItemForToolbar(wrapper.firstChild, wrapper);
       wrapPaletteItem(document.importNode(wrapper.firstChild, true));
       gToolbox.palette.appendChild(wrapper.firstChild);
     }
 
     // The item was dragged out of the toolbar.
     wrapper.remove();
   }
 
   toolboxChanged();
 }
 
-
 function isUnwantedDragEvent(aEvent) {
   try {
-    if (Services.prefs.getBoolPref("toolkit.customization.unsafe_drag_events")) {
+    if (
+      Services.prefs.getBoolPref("toolkit.customization.unsafe_drag_events")
+    ) {
       return false;
     }
   } catch (ex) {}
 
   /* Discard drag events that originated from a separate window to
      prevent content->chrome privilege escalations. */
   let mozSourceNode = aEvent.dataTransfer.mozSourceNode;
   // mozSourceNode is null in the dragStart event handler or if
   // the drag event originated in an external application.
   if (!mozSourceNode) {
     return true;
   }
   let sourceWindow = mozSourceNode.ownerGlobal;
   return sourceWindow != window && sourceWindow != gToolboxDocument.defaultView;
 }
-
--- a/common/src/viewSource.js
+++ b/common/src/viewSource.js
@@ -1,38 +1,47 @@
 // -*- 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/. */
 
 /* globals internalSave, goDoCommand */
 
-var {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-var {ViewSourceBrowser} = ChromeUtils.import("resource://gre/modules/ViewSourceBrowser.jsm");
+var { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
+var { ViewSourceBrowser } = ChromeUtils.import(
+  "resource://gre/modules/ViewSourceBrowser.jsm"
+);
 
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {CharsetMenu} = ChromeUtils.import("resource://gre/modules/CharsetMenu.jsm");
-var {Deprecated} = ChromeUtils.import("resource://gre/modules/Deprecated.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { CharsetMenu } = ChromeUtils.import(
+  "resource://gre/modules/CharsetMenu.jsm"
+);
+var { Deprecated } = ChromeUtils.import(
+  "resource://gre/modules/Deprecated.jsm"
+);
 
 /* global gBrowser, gViewSourceBundle, gContextMenu */
 [
-  ["gBrowser",          "content"],
+  ["gBrowser", "content"],
   ["gViewSourceBundle", "viewSourceBundle"],
-  ["gContextMenu",      "viewSourceContextMenu"],
+  ["gContextMenu", "viewSourceContextMenu"],
 ].forEach(function([name, id]) {
   Object.defineProperty(window, name, {
     configurable: true,
     enumerable: true,
     get() {
       var element = document.getElementById(id);
-      if (!element)
+      if (!element) {
         return null;
+      }
       delete window[name];
-      return window[name] = element;
+      return (window[name] = element);
     },
   });
 });
 
 /**
  * ViewSourceChrome is the primary interface for interacting with
  * the view source browser from a self-contained window.  It extends
  * ViewSourceBrowser with additional things needed inside the special window.
@@ -76,21 +85,25 @@ ViewSourceChrome.prototype = {
   ]),
 
   /**
    * This called via ViewSourceBrowser's constructor.  This should be called as
    * soon as the script loads.  When this function executes, we can assume the
    * DOM content has not yet loaded.
    */
   init() {
-    this.mm.loadFrameScript("chrome://global/content/viewSource-content.js", true);
+    this.mm.loadFrameScript(
+      "chrome://global/content/viewSource-content.js",
+      true
+    );
 
     this.shouldWrap = Services.prefs.getBoolPref("view_source.wrap_long_lines");
-    this.shouldHighlight =
-      Services.prefs.getBoolPref("view_source.syntax_highlight");
+    this.shouldHighlight = Services.prefs.getBoolPref(
+      "view_source.syntax_highlight"
+    );
 
     addEventListener("load", this);
     addEventListener("unload", this);
     addEventListener("AppCommand", this, true);
     addEventListener("MozSwipeGesture", this, true);
 
     ViewSourceBrowser.prototype.init.call(this);
   },
@@ -104,18 +117,22 @@ ViewSourceChrome.prototype = {
 
     // "load" event listener is removed in its handler, to
     // ensure we only fire it once.
     removeEventListener("unload", this);
     removeEventListener("AppCommand", this, true);
     removeEventListener("MozSwipeGesture", this, true);
     gContextMenu.removeEventListener("popupshowing", this);
     gContextMenu.removeEventListener("popuphidden", this);
-    Services.els.removeSystemEventListener(this.browser, "dragover", this,
-                                           true);
+    Services.els.removeSystemEventListener(
+      this.browser,
+      "dragover",
+      this,
+      true
+    );
     Services.els.removeSystemEventListener(this.browser, "drop", this, true);
   },
 
   /**
    * Anything added to the messages array will get handled here, and should
    * get dispatched to a specific function for the message name.
    */
   receiveMessage(message) {
@@ -320,49 +337,59 @@ ViewSourceChrome.prototype = {
   },
 
   /**
    * This is the deprecated API for viewSource.xul, for old-timer consumers.
    * This API might eventually go away.
    */
   // NOT WORKING ANYMORE AFTER REMOVAL OF THE "ViewSource:LoadSourceDeprecated" MESSAGE IN BUG 1443371.
   _loadViewSourceDeprecated(aArguments) {
-    Deprecated.warning("The arguments you're passing to viewSource.xul " +
-                       "are using an out-of-date API.",
-                       "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+    Deprecated.warning(
+      "The arguments you're passing to viewSource.xul " +
+        "are using an out-of-date API.",
+      "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+    );
     // Parse the 'arguments' supplied with the dialog.
     //    arg[0] - URL string.
     //    arg[1] - Charset value in the form 'charset=xxx'.
     //    arg[2] - Page descriptor used to load content from the cache.
     //    arg[3] - Line number to go to.
     //    arg[4] - Whether charset was forced by the user
 
     if (aArguments[2]) {
       let pageDescriptor = aArguments[2];
       if (Cu.isCrossProcessWrapper(pageDescriptor)) {
-        throw new Error("Cannot pass a CPOW as the page descriptor to viewSource.xul.");
+        throw new Error(
+          "Cannot pass a CPOW as the page descriptor to viewSource.xul."
+        );
       }
     }
 
     if (this.browser.isRemoteBrowser) {
-      throw new Error("Deprecated view source API should not use a remote browser.");
+      throw new Error(
+        "Deprecated view source API should not use a remote browser."
+      );
     }
 
     let forcedCharSet;
     if (aArguments[4] && aArguments[1].startsWith("charset=")) {
       forcedCharSet = aArguments[1].split("=")[1];
     }
 
-    this.sendAsyncMessage("ViewSource:LoadSourceDeprecated", {
-      URL: aArguments[0],
-      lineNumber: aArguments[3],
-      forcedCharSet,
-    }, {
-      pageDescriptor: aArguments[2],
-    });
+    this.sendAsyncMessage(
+      "ViewSource:LoadSourceDeprecated",
+      {
+        URL: aArguments[0],
+        lineNumber: aArguments[3],
+        forcedCharSet,
+      },
+      {
+        pageDescriptor: aArguments[2],
+      }
+    );
   },
 
   /**
    * Handler for the AppCommand event.
    *
    * @param event
    *        The AppCommand event being handled.
    */
@@ -437,18 +464,19 @@ ViewSourceChrome.prototype = {
     if (event.target.hasAttribute("charset")) {
       let charset = event.target.getAttribute("charset");
       // Replace generic Japanses with Shift_JIS which will also auto-detect
       // ISO-2022-JP and EUC-JP.
       if (charset == "Japanese") {
         charset = "Shift_JIS";
       }
       this.browser.docShell.charset = charset;
-      this.browser
-          .reloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE);
+      this.browser.reloadWithFlags(
+        Ci.nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE
+      );
     }
   },
 
   /**
    * Called from the frame script when the context menu is about to
    * open. This tells ViewSourceChrome things about the item that
    * the context menu is being opened on. This should be called before
    * the popupshowing event handler fires.
@@ -481,18 +509,19 @@ ViewSourceChrome.prototype = {
    */
   onContextMenuCopyLinkOrEmail() {
     // It doesn't make any sense to call this if the context menu
     // isn't open...
     if (!this.contextMenuData.isOpen) {
       return;
     }
 
-    let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"]
-                      .getService(Ci.nsIClipboardHelper);
+    let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(
+      Ci.nsIClipboardHelper
+    );
     clipboard.copyString(this.contextMenuData.href);
   },
 
   /**
    * Called when the context menu closes, and invalidates any data
    * that the frame script might have sent up about what the context
    * menu was opened on.
    */
@@ -505,35 +534,39 @@ ViewSourceChrome.prototype = {
   /**
    * Called when the user drags something over the content browser.
    */
   onDragOver(event) {
     // For drags that appear to be internal text (for example, tab drags),
     // set the dropEffect to 'none'. This prevents the drop even if some
     // other listener cancelled the event.
     let types = event.dataTransfer.types;
-    if (types.includes("text/x-moz-text-internal") && !types.includes("text/plain")) {
-        event.dataTransfer.dropEffect = "none";
-        event.stopPropagation();
-        event.preventDefault();
+    if (
+      types.includes("text/x-moz-text-internal") &&
+      !types.includes("text/plain")
+    ) {
+      event.dataTransfer.dropEffect = "none";
+      event.stopPropagation();
+      event.preventDefault();
     }
 
     if (Services.droppedLinkHandler.canDropLink(event, false)) {
       event.preventDefault();
     }
   },
 
   /**
    * Called twhen the user drops something onto the content browser.
    */
   onDrop(event) {
-    if (event.defaultPrevented)
+    if (event.defaultPrevented) {
       return;
+    }
 
-    let name = { };
+    let name = {};
     let uri;
     try {
       // Pass true to prevent the dropping of javascript:/data: URIs
       uri = Services.droppedLinkHandler.dropLink(event, name, true);
     } catch (e) {
       return;
     }
 
@@ -593,18 +626,20 @@ ViewSourceChrome.prototype = {
       }
     }
   },
 
   /**
    * Reloads the browser, bypassing the network cache.
    */
   reload() {
-    this.browser.reloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY |
-                                 Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);
+    this.browser.reloadWithFlags(
+      Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY |
+        Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE
+    );
   },
 
   /**
    * Closes the view source window.
    */
   close() {
     window.close();
   },
@@ -635,18 +670,20 @@ ViewSourceChrome.prototype = {
    * @param shouldBeRemote
    *        True if the browser should be made remote. If the browsers
    *        remoteness already matches this value, this function does
    *        nothing.
    * @param remoteType
    *        The type of remote browser process.
    */
   updateBrowserRemoteness(shouldBeRemote, remoteType) {
-    if (this.browser.isRemoteBrowser == shouldBeRemote &&
-        this.browser.remoteType == remoteType) {
+    if (
+      this.browser.isRemoteBrowser == shouldBeRemote &&
+      this.browser.remoteType == remoteType
+    ) {
       return;
     }
 
     let parentNode = this.browser.parentNode;
     let nextSibling = this.browser.nextSibling;
 
     // Removing and re-adding the browser from and to the DOM strips its XBL
     // properties. Save and restore sameProcessAsFrameLoader. Note that when we
@@ -702,18 +739,19 @@ var PrintPreviewListener = {
 
     if (gBrowser.isRemoteBrowser) {
       this._ppBrowser.setAttribute("remote", "true");
     } else {
       this._ppBrowser.removeAttribute("remote");
     }
 
     let findBar = document.getElementById("FindToolbar");
-    document.getElementById("appcontent")
-            .insertBefore(this._ppBrowser, findBar);
+    document
+      .getElementById("appcontent")
+      .insertBefore(this._ppBrowser, findBar);
 
     return this._ppBrowser;
   },
 
   getSourceBrowser() {
     return gBrowser;
   },
 
@@ -743,122 +781,158 @@ function getBrowser() {
   return gBrowser;
 }
 
 Object.defineProperty(this, "gPageLoader", {
   configurable: true,
   enumerable: true,
   get() {
     var webnav = viewSourceChrome.webNav;
-    if (!webnav)
+    if (!webnav) {
       return null;
+    }
     delete this.gPageLoader;
-    this.gPageLoader = (webnav instanceof Ci.nsIWebPageDescriptor) ? webnav
-                                                                   : null;
+    this.gPageLoader =
+      webnav instanceof Ci.nsIWebPageDescriptor ? webnav : null;
     return this.gPageLoader;
   },
 });
 
 // Strips the |view-source:| for internalSave()
 function ViewSourceSavePage() {
-  internalSave(gBrowser.currentURI.spec.replace(/^view-source:/i, ""),
-               null, null, null, null, null, "SaveLinkTitle",
-               null, null, gBrowser.contentDocument, null,
-               gPageLoader, null,
-               Services.scriptSecurityManager.getSystemPrincipal());
+  internalSave(
+    gBrowser.currentURI.spec.replace(/^view-source:/i, ""),
+    null,
+    null,
+    null,
+    null,
+    null,
+    "SaveLinkTitle",
+    null,
+    null,
+    gBrowser.contentDocument,
+    null,
+    gPageLoader,
+    null,
+    Services.scriptSecurityManager.getSystemPrincipal()
+  );
 }
 
 // Below are old deprecated functions and variables left behind for
 // compatibility reasons. These will be removed soon via bug 1159293.
 
 Object.defineProperty(this, "gLastLineFound", {
   configurable: true,
   enumerable: true,
   get() {
-    Deprecated.warning("gLastLineFound is deprecated - please use " +
-                       "viewSourceChrome.lastLineFound instead.",
-                       "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+    Deprecated.warning(
+      "gLastLineFound is deprecated - please use " +
+        "viewSourceChrome.lastLineFound instead.",
+      "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+    );
     return viewSourceChrome.lastLineFound;
   },
 });
 
 function onLoadViewSource() {
-  Deprecated.warning("onLoadViewSource() is deprecated - please use " +
-                     "viewSourceChrome.onXULLoaded() instead.",
-                     "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+  Deprecated.warning(
+    "onLoadViewSource() is deprecated - please use " +
+      "viewSourceChrome.onXULLoaded() instead.",
+    "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+  );
   viewSourceChrome.onXULLoaded();
 }
 
 function isHistoryEnabled() {
-  Deprecated.warning("isHistoryEnabled() is deprecated - please use " +
-                     "viewSourceChrome.historyEnabled instead.",
-                     "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+  Deprecated.warning(
+    "isHistoryEnabled() is deprecated - please use " +
+      "viewSourceChrome.historyEnabled instead.",
+    "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+  );
   return viewSourceChrome.historyEnabled;
 }
 
 function ViewSourceClose() {
-  Deprecated.warning("ViewSourceClose() is deprecated - please use " +
-                     "viewSourceChrome.close() instead.",
-                     "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+  Deprecated.warning(
+    "ViewSourceClose() is deprecated - please use " +
+      "viewSourceChrome.close() instead.",
+    "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+  );
   viewSourceChrome.close();
 }
 
 function ViewSourceReload() {
-  Deprecated.warning("ViewSourceReload() is deprecated - please use " +
-                     "viewSourceChrome.reload() instead.",
-                     "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+  Deprecated.warning(
+    "ViewSourceReload() is deprecated - please use " +
+      "viewSourceChrome.reload() instead.",
+    "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+  );
   viewSourceChrome.reload();
 }
 
 function getWebNavigation() {
-  Deprecated.warning("getWebNavigation() is deprecated - please use " +
-                     "viewSourceChrome.webNav instead.",
-                     "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+  Deprecated.warning(
+    "getWebNavigation() is deprecated - please use " +
+      "viewSourceChrome.webNav instead.",
+    "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+  );
   // The original implementation returned null if anything threw during
   // the getting of the webNavigation.
   try {
     return viewSourceChrome.webNav;
   } catch (e) {
     return null;
   }
 }
 
 function viewSource(url) {
-  Deprecated.warning("viewSource() is deprecated - please use " +
-                     "viewSourceChrome.loadURL() instead.",
-                     "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+  Deprecated.warning(
+    "viewSource() is deprecated - please use " +
+      "viewSourceChrome.loadURL() instead.",
+    "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+  );
   viewSourceChrome.loadURL(url);
 }
 
 function ViewSourceGoToLine() {
-  Deprecated.warning("ViewSourceGoToLine() is deprecated - please use " +
-                     "viewSourceChrome.promptAndGoToLine() instead.",
-                     "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+  Deprecated.warning(
+    "ViewSourceGoToLine() is deprecated - please use " +
+      "viewSourceChrome.promptAndGoToLine() instead.",
+    "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+  );
   viewSourceChrome.promptAndGoToLine();
 }
 
 function goToLine(line) {
-  Deprecated.warning("goToLine() is deprecated - please use " +
-                     "viewSourceChrome.goToLine() instead.",
-                     "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+  Deprecated.warning(
+    "goToLine() is deprecated - please use " +
+      "viewSourceChrome.goToLine() instead.",
+    "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+  );
   viewSourceChrome.goToLine(line);
 }
 
 function BrowserForward(aEvent) {
-  Deprecated.warning("BrowserForward() is deprecated - please use " +
-                     "viewSourceChrome.goForward() instead.",
-                     "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+  Deprecated.warning(
+    "BrowserForward() is deprecated - please use " +
+      "viewSourceChrome.goForward() instead.",
+    "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+  );
   viewSourceChrome.goForward();
 }
 
 function BrowserBack(aEvent) {
-  Deprecated.warning("BrowserBack() is deprecated - please use " +
-                     "viewSourceChrome.goBack() instead.",
-                     "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+  Deprecated.warning(
+    "BrowserBack() is deprecated - please use " +
+      "viewSourceChrome.goBack() instead.",
+    "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+  );
   viewSourceChrome.goBack();
 }
 
 function UpdateBackForwardCommands() {
-  Deprecated.warning("UpdateBackForwardCommands() is deprecated - please use " +
-                     "viewSourceChrome.updateCommands() instead.",
-                     "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications");
+  Deprecated.warning(
+    "UpdateBackForwardCommands() is deprecated - please use " +
+      "viewSourceChrome.updateCommands() instead.",
+    "https://developer.mozilla.org/en-US/Add-ons/Code_snippets/View_Source_for_XUL_Applications"
+  );
   viewSourceChrome.updateCommands();
 }
--- a/common/src/viewZoomOverlay.js
+++ b/common/src/viewZoomOverlay.js
@@ -6,92 +6,101 @@
 
 /* globals getBrowser */
 
 /** Document Zoom Management Code
  *
  * Forked from M-C since we don't provide a global gBrowser variable.
  **/
 
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var ZoomManager = {
   get MIN() {
     delete this.MIN;
-    return this.MIN = Services.prefs.getIntPref("zoom.minPercent") / 100;
+    return (this.MIN = Services.prefs.getIntPref("zoom.minPercent") / 100);
   },
 
   get MAX() {
     delete this.MAX;
-    return this.MAX = Services.prefs.getIntPref("zoom.maxPercent") / 100;
+    return (this.MAX = Services.prefs.getIntPref("zoom.maxPercent") / 100);
   },
 
   get useFullZoom() {
     return Services.prefs.getBoolPref("browser.zoom.full");
   },
 
   set useFullZoom(aVal) {
     Services.prefs.setBoolPref("browser.zoom.full", aVal);
     return aVal;
   },
 
   get zoom() {
     return this.getZoomForBrowser(getBrowser());
   },
 
   getZoomForBrowser(aBrowser) {
-    let zoom = (this.useFullZoom || aBrowser.isSyntheticDocument)
-               ? aBrowser.fullZoom : aBrowser.textZoom;
+    let zoom =
+      this.useFullZoom || aBrowser.isSyntheticDocument
+        ? aBrowser.fullZoom
+        : aBrowser.textZoom;
     // Round to remove any floating-point error.
     return Number(zoom ? zoom.toFixed(2) : 1);
   },
 
   set zoom(aVal) {
     this.setZoomForBrowser(getBrowser(), aVal);
     return aVal;
   },
 
   setZoomForBrowser(aBrowser, aVal) {
-    if (aVal < this.MIN || aVal > this.MAX)
+    if (aVal < this.MIN || aVal > this.MAX) {
       throw Cr.NS_ERROR_INVALID_ARG;
+    }
 
     if (this.useFullZoom || aBrowser.isSyntheticDocument) {
       aBrowser.textZoom = 1;
       aBrowser.fullZoom = aVal;
     } else {
       aBrowser.textZoom = aVal;
       aBrowser.fullZoom = 1;
     }
   },
 
   get zoomValues() {
-    var zoomValues = Services.prefs.getCharPref("toolkit.zoomManager.zoomValues")
-                                   .split(",").map(parseFloat);
+    var zoomValues = Services.prefs
+      .getCharPref("toolkit.zoomManager.zoomValues")
+      .split(",")
+      .map(parseFloat);
     zoomValues.sort((a, b) => a - b);
 
-    while (zoomValues[0] < this.MIN)
+    while (zoomValues[0] < this.MIN) {
       zoomValues.shift();
+    }
 
-    while (zoomValues[zoomValues.length - 1] > this.MAX)
+    while (zoomValues[zoomValues.length - 1] > this.MAX) {
       zoomValues.pop();
+    }
 
     delete this.zoomValues;
-    return this.zoomValues = zoomValues;
+    return (this.zoomValues = zoomValues);
   },
 
   enlarge() {
     var i = this.zoomValues.indexOf(this.snap(this.zoom)) + 1;
-    if (i < this.zoomValues.length)
+    if (i < this.zoomValues.length) {
       this.zoom = this.zoomValues[i];
+    }
   },
 
   reduce() {
     var i = this.zoomValues.indexOf(this.snap(this.zoom)) - 1;
-    if (i >= 0)
+    if (i >= 0) {
       this.zoom = this.zoomValues[i];
+    }
   },
 
   reset() {
     this.zoom = 1;
   },
 
   toggleZoom() {
     var zoomLevel = this.zoom;
@@ -99,16 +108,17 @@ var ZoomManager = {
     this.useFullZoom = !this.useFullZoom;
     this.zoom = zoomLevel;
   },
 
   snap(aVal) {
     var values = this.zoomValues;
     for (var i = 0; i < values.length; i++) {
       if (values[i] >= aVal) {
-        if (i > 0 && aVal - values[i - 1] < values[i] - aVal)
+        if (i > 0 && aVal - values[i - 1] < values[i] - aVal) {
           i--;
+        }
         return values[i];
       }
     }
     return values[i - 1];
   },
 };
--- a/common/test/xpcshell/data/BootstrapMonitor.jsm
+++ b/common/test/xpcshell/data/BootstrapMonitor.jsm
@@ -1,33 +1,41 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-var EXPORTED_SYMBOLS = [ "monitor" ];
+var EXPORTED_SYMBOLS = ["monitor"];
 
 function notify(event, originalMethod, data, reason) {
   let info = {
     event,
     data: Object.assign({}, data, {
       resourceURI: data.resourceURI.spec,
     }),
     reason,
   };
 
-  let subject = {wrappedJSObject: {data}};
+  let subject = { wrappedJSObject: { data } };
 
-  Services.obs.notifyObservers(subject, "bootstrapmonitor-event", JSON.stringify(info));
+  Services.obs.notifyObservers(
+    subject,
+    "bootstrapmonitor-event",
+    JSON.stringify(info)
+  );
 
   // If the bootstrap scope already declares a method call it
-  if (originalMethod)
+  if (originalMethod) {
     originalMethod(data, reason);
+  }
 }
 
 // Allows a simple one-line bootstrap script:
 // Components.utils.import("resource://xpcshelldata/bootstrapmonitor.jsm").monitor(this);
-var monitor = function(scope, methods = ["install", "startup", "shutdown", "uninstall"]) {
+var monitor = function(
+  scope,
+  methods = ["install", "startup", "shutdown", "uninstall"]
+) {
   for (let event of methods) {
     scope[event] = notify.bind(null, event, scope[event]);
   }
 };
--- a/common/test/xpcshell/head_addons.js
+++ b/common/test/xpcshell/head_addons.js
@@ -1,62 +1,101 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-const PREF_EM_CHECK_UPDATE_SECURITY   = "extensions.checkUpdateSecurity";
-const PREF_EM_STRICT_COMPATIBILITY    = "extensions.strictCompatibility";
-const PREF_GETADDONS_BYIDS               = "extensions.getAddons.get.url";
-const PREF_COMPAT_OVERRIDES              = "extensions.getAddons.compatOverides.url";
-const PREF_XPI_SIGNATURES_REQUIRED    = "xpinstall.signatures.required";
+const PREF_EM_CHECK_UPDATE_SECURITY = "extensions.checkUpdateSecurity";
+const PREF_EM_STRICT_COMPATIBILITY = "extensions.strictCompatibility";
+const PREF_GETADDONS_BYIDS = "extensions.getAddons.get.url";
+const PREF_COMPAT_OVERRIDES = "extensions.getAddons.compatOverides.url";
+const PREF_XPI_SIGNATURES_REQUIRED = "xpinstall.signatures.required";
 
-const PREF_DISABLE_SECURITY = ("security.turn_off_all_security_so_that_" +
-                               "viruses_can_take_over_this_computer");
+const PREF_DISABLE_SECURITY =
+  "security.turn_off_all_security_so_that_" +
+  "viruses_can_take_over_this_computer";
 
 // Maximum error in file modification times. Some file systems don't store
 // modification times exactly. As long as we are closer than this then it
 // still passes.
 const MAX_TIME_DIFFERENCE = 3000;
 
 // Time to reset file modified time relative to Date.now() so we can test that
 // times are modified (10 hours old).
 const MAKE_FILE_OLD_DIFFERENCE = 10 * 3600 * 1000;
 
-var {AppConstants} = ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
-var {FileUtils} = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
-var {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-var {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
-var {AddonRepository} = ChromeUtils.import("resource://gre/modules/addons/AddonRepository.jsm");
-var {OS} = ChromeUtils.import("resource://gre/modules/osfile.jsm");
+var { AppConstants } = ChromeUtils.import(
+  "resource://gre/modules/AppConstants.jsm"
+);
+var { FileUtils } = ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
+var { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
+var { AddonRepository } = ChromeUtils.import(
+  "resource://gre/modules/addons/AddonRepository.jsm"
+);
+var { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
 
-var {AddonTestUtils, MockAsyncShutdown} = ChromeUtils.import("resource://testing-common/AddonTestUtils.jsm");
+var { AddonTestUtils, MockAsyncShutdown } = ChromeUtils.import(
+  "resource://testing-common/AddonTestUtils.jsm"
+);
 
-ChromeUtils.defineModuleGetter(this, "Blocklist",
-                               "resource://gre/modules/Blocklist.jsm");
-ChromeUtils.defineModuleGetter(this, "Extension",
-                               "resource://gre/modules/Extension.jsm");
-ChromeUtils.defineModuleGetter(this, "ExtensionTestUtils",
-                               "resource://testing-common/ExtensionXPCShellUtils.jsm");
-ChromeUtils.defineModuleGetter(this, "ExtensionTestCommon",
-                               "resource://testing-common/ExtensionTestCommon.jsm");
-ChromeUtils.defineModuleGetter(this, "HttpServer",
-                               "resource://testing-common/httpd.js");
-ChromeUtils.defineModuleGetter(this, "MockRegistrar",
-                               "resource://testing-common/MockRegistrar.jsm");
-ChromeUtils.defineModuleGetter(this, "MockRegistry",
-                               "resource://testing-common/MockRegistry.jsm");
-ChromeUtils.defineModuleGetter(this, "PromiseTestUtils",
-                               "resource://testing-common/PromiseTestUtils.jsm");
-ChromeUtils.defineModuleGetter(this, "TestUtils",
-                               "resource://testing-common/TestUtils.jsm");
+ChromeUtils.defineModuleGetter(
+  this,
+  "Blocklist",
+  "resource://gre/modules/Blocklist.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "Extension",
+  "resource://gre/modules/Extension.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "ExtensionTestUtils",
+  "resource://testing-common/ExtensionXPCShellUtils.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "ExtensionTestCommon",
+  "resource://testing-common/ExtensionTestCommon.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "HttpServer",
+  "resource://testing-common/httpd.js"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "MockRegistrar",
+  "resource://testing-common/MockRegistrar.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "MockRegistry",
+  "resource://testing-common/MockRegistry.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "PromiseTestUtils",
+  "resource://testing-common/PromiseTestUtils.jsm"
+);
+ChromeUtils.defineModuleGetter(
+  this,
+  "TestUtils",
+  "resource://testing-common/TestUtils.jsm"
+);
 
-XPCOMUtils.defineLazyServiceGetter(this, "aomStartup",
-                                   "@mozilla.org/addons/addon-manager-startup;1",
-                                   "amIAddonManagerStartup");
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "aomStartup",
+  "@mozilla.org/addons/addon-manager-startup;1",
+  "amIAddonManagerStartup"
+);
 
 const {
   createAppInfo,
   createHttpServer,
   createTempWebExtensionFile,
   getFileForAddon,
   manuallyInstall,
   manuallyUninstall,
@@ -80,44 +119,48 @@ const {
 } = AddonTestUtils;
 
 // WebExtension wrapper for ease of testing
 ExtensionTestUtils.init(this);
 
 AddonTestUtils.init(this, false);
 AddonTestUtils.overrideCertDB();
 
-XPCOMUtils.defineLazyGetter(this, "BOOTSTRAP_REASONS",
-                            () => AddonManagerPrivate.BOOTSTRAP_REASONS);
+XPCOMUtils.defineLazyGetter(
+  this,
+  "BOOTSTRAP_REASONS",
+  () => AddonManagerPrivate.BOOTSTRAP_REASONS
+);
 
 function getReasonName(reason) {
   for (let key of Object.keys(BOOTSTRAP_REASONS)) {
     if (BOOTSTRAP_REASONS[key] == reason) {
       return key;
     }
   }
   throw new Error("This shouldn't happen.");
 }
 
-
 Object.defineProperty(this, "gAppInfo", {
   get() {
     return AddonTestUtils.appInfo;
   },
 });
 
 Object.defineProperty(this, "gAddonStartup", {
   get() {
     return AddonTestUtils.addonStartup.clone();
   },
 });
 
 Object.defineProperty(this, "gInternalManager", {
   get() {
-    return AddonTestUtils.addonIntegrationService.QueryInterface(Ci.nsITimerCallback);
+    return AddonTestUtils.addonIntegrationService.QueryInterface(
+      Ci.nsITimerCallback
+    );
   },
 });
 
 Object.defineProperty(this, "gProfD", {
   get() {
     return AddonTestUtils.profileDir.clone();
   },
 });
@@ -128,42 +171,46 @@ Object.defineProperty(this, "gTmpD", {
   },
 });
 
 Object.defineProperty(this, "gUseRealCertChecks", {
   get() {
     return AddonTestUtils.useRealCertChecks;
   },
   set(val) {
-   return AddonTestUtils.useRealCertChecks = val;
+    return (AddonTestUtils.useRealCertChecks = val);
   },
 });
 
 Object.defineProperty(this, "TEST_UNPACKED", {
   get() {
     return AddonTestUtils.testUnpacked;
   },
   set(val) {
-   return AddonTestUtils.testUnpacked = val;
+    return (AddonTestUtils.testUnpacked = val);
   },
 });
 
 // We need some internal bits of AddonManager
-var AMscope = ChromeUtils.import("resource://gre/modules/AddonManager.jsm", null);
+var AMscope = ChromeUtils.import(
+  "resource://gre/modules/AddonManager.jsm",
+  null
+);
 var { AddonManager, AddonManagerInternal, AddonManagerPrivate } = AMscope;
 
 const promiseAddonByID = AddonManager.getAddonByID;
 const promiseAddonsByIDs = AddonManager.getAddonsByIDs;
 
 var gPort = null;
 var gUrlToFileMap = {};
 
 // Map resource://xpcshell-data/ to the data directory
-var resHandler = Services.io.getProtocolHandler("resource")
-                         .QueryInterface(Ci.nsISubstitutingProtocolHandler);
+var resHandler = Services.io
+  .getProtocolHandler("resource")
+  .QueryInterface(Ci.nsISubstitutingProtocolHandler);
 // Allow non-existent files because of bug 1207735
 var dataURI = NetUtil.newURI(do_get_file("data", true));
 resHandler.setSubstitution("xpcshell-data", dataURI);
 
 function isManifestRegistered(file) {
   let manifests = Components.manager.getManifestLocations();
   for (let i = 0; i < manifests.length; i++) {
     let manifest = manifests.queryElementAt(i, Ci.nsIURI);
@@ -173,18 +220,19 @@ function isManifestRegistered(file) {
     if (manifest instanceof Ci.nsIJARURI) {
       manifest = manifest.JARFile.QueryInterface(Ci.nsIFileURL).file;
     } else if (manifest instanceof Ci.nsIFileURL) {
       manifest = manifest.file.parent;
     } else {
       continue;
     }
 
-    if (manifest.equals(file))
+    if (manifest.equals(file)) {
       return true;
+    }
   }
   return false;
 }
 
 const BOOTSTRAP_MONITOR_BOOTSTRAP_JS = `
   ChromeUtils.import("resource://xpcshell-data/BootstrapMonitor.jsm").monitor(this);
 `;
 
@@ -208,18 +256,19 @@ this.BootstrapMonitor = {
   restartfulIds: new Set(),
 
   init() {
     this.inited = true;
     Services.obs.addObserver(this, "bootstrapmonitor-event");
   },
 
   shutdownCheck() {
-    if (!this.inited)
+    if (!this.inited) {
       return;
+    }
 
     Assert.equal(this.started.size, 0);
   },
 
   clear(id) {
     this.installed.delete(id);
     this.started.delete(id);
     this.stopped.delete(id);
@@ -237,25 +286,32 @@ this.BootstrapMonitor = {
       this.installPromises.push(resolve);
     });
   },
 
   checkMatches(cached, current) {
     Assert.notEqual(cached, undefined);
     Assert.equal(current.data.version, cached.data.version);
     Assert.equal(current.data.installPath, cached.data.installPath);
-    Assert.ok(Services.io.newURI(current.data.resourceURI).equals(Services.io.newURI(cached.data.resourceURI)),
-              `Resource URIs match: "${current.data.resourceURI}" == "${cached.data.resourceURI}"`);
+    Assert.ok(
+      Services.io
+        .newURI(current.data.resourceURI)
+        .equals(Services.io.newURI(cached.data.resourceURI)),
+      `Resource URIs match: "${current.data.resourceURI}" == "${
+        cached.data.resourceURI
+      }"`
+    );
   },
 
   checkAddonStarted(id, version = undefined) {
     let started = this.started.get(id);
     Assert.notEqual(started, undefined);
-    if (version != undefined)
+    if (version != undefined) {
       Assert.equal(started.data.version, version);
+    }
 
     // Chrome should be registered by now
     // Get the install path from the resource URI, since it is not passed any longer.
     let uri = Services.io.newURI(started.data.resourceURI);
     let jarFile = uri.QueryInterface(Ci.nsIJARURI).JARFile;
     let installPath = jarFile.QueryInterface(Ci.nsIFileURL).file;
 
     let isRegistered = isManifestRegistered(installPath);
@@ -299,18 +355,19 @@ this.BootstrapMonitor = {
     }
 
     // If this is the install event the add-ons shouldn't already be installed
     if (info.event == "install") {
       this.checkAddonNotInstalled(id);
 
       this.installed.set(id, info);
 
-      for (let resolve of this.installPromises)
+      for (let resolve of this.installPromises) {
         resolve();
+      }
       this.installPromises = [];
     } else {
       this.checkMatches(this.installed.get(id), info);
     }
 
     // If this is the shutdown event than the add-on should already be started
     if (info.event == "shutdown") {
       this.checkMatches(this.started.get(id), info);
@@ -320,18 +377,19 @@ this.BootstrapMonitor = {
 
       // Chrome should still be registered at this point
       let isRegistered = isManifestRegistered(installPath);
       Assert.ok(isRegistered);
 
       // XPIProvider doesn't bother unregistering chrome on app shutdown but
       // since we simulate restarts we must do so manually to keep the registry
       // consistent.
-      if (info.reason == 2 /* APP_SHUTDOWN */)
+      if (info.reason == 2 /* APP_SHUTDOWN */) {
         Components.manager.removeBootstrappedManifestLocation(installPath);
+      }
     } else {
       this.checkAddonNotStarted(id);
     }
 
     if (info.event == "uninstall") {
       // We currently support registering, but not unregistering,
       // restartful add-on manifests during xpcshell AOM "restarts".
       if (!this.restartfulIds.has(id)) {
@@ -344,18 +402,19 @@ this.BootstrapMonitor = {
       this.uninstalled.set(id, info);
     } else if (info.event == "startup") {
       this.started.set(id, info);
 
       // Chrome should be registered at this point
       let isRegistered = isManifestRegistered(installPath);
       Assert.ok(isRegistered);
 
-      for (let resolve of this.startupPromises)
+      for (let resolve of this.startupPromises) {
         resolve();
+      }
       this.startupPromises = [];
     }
   },
 };
 
 AddonTestUtils.on("addon-manager-shutdown", () => {
   BootstrapMonitor.shutdownCheck();
   Cu.unload("resource:///modules/BootstrapLoader.jsm");
@@ -370,135 +429,170 @@ var SlightlyLessDodgyBootstrapMonitor = 
   init() {
     this.onEvent = this.onEvent.bind(this);
 
     AddonTestUtils.on("addon-manager-shutdown", this.onEvent);
     AddonTestUtils.on("bootstrap-method", this.onEvent);
   },
 
   shutdownCheck() {
-    equal(this.started.size, 0,
-          "Should have no add-ons that were started but not shutdown");
+    equal(
+      this.started.size,
+      0,
+      "Should have no add-ons that were started but not shutdown"
+    );
   },
 
   onEvent(msg, data) {
     switch (msg) {
       case "addon-manager-shutdown":
         this.shutdownCheck();
         break;
       case "bootstrap-method":
         this.onBootstrapMethod(data.method, data.params, data.reason);
         break;
     }
   },
 
   onBootstrapMethod(method, params, reason) {
-    let {id} = params;
+    let { id } = params;
 
-    info(`Bootstrap method ${method} for ${params.id} version ${params.version}`);
+    info(
+      `Bootstrap method ${method} for ${params.id} version ${params.version}`
+    );
 
     if (method !== "install") {
       this.checkInstalled(id);
     }
 
     switch (method) {
       case "install":
         this.checkNotInstalled(id);
-        this.installed.set(id, {reason, params});
+        this.installed.set(id, { reason, params });
         this.uninstalled.delete(id);
         break;
       case "startup":
         this.checkNotStarted(id);
-        this.started.set(id, {reason, params});
+        this.started.set(id, { reason, params });
         this.stopped.delete(id);
         break;
       case "shutdown":
         this.checkMatches("shutdown", "startup", params, this.started.get(id));
         this.checkStarted(id);
-        this.stopped.set(id, {reason, params});
+        this.stopped.set(id, { reason, params });
         this.started.delete(id);
         break;
       case "uninstall":
-        this.checkMatches("uninstall", "install", params, this.installed.get(id));
-        this.uninstalled.set(id, {reason, params});
+        this.checkMatches(
+          "uninstall",
+          "install",
+          params,
+          this.installed.get(id)
+        );
+        this.uninstalled.set(id, { reason, params });
         this.installed.delete(id);
         break;
       case "update":
         this.checkMatches("update", "install", params, this.installed.get(id));
-        this.installed.set(id, {reason, params});
+        this.installed.set(id, { reason, params });
         break;
     }
   },
 
   clear(id) {
     this.installed.delete(id);
     this.started.delete(id);
     this.stopped.delete(id);
     this.uninstalled.delete(id);
   },
 
-  checkMatches(method, lastMethod, params, {params: lastParams} = {}) {
-    ok(lastParams,
-       `Expecting matching ${lastMethod} call for add-on ${params.id} ${method} call`);
+  checkMatches(method, lastMethod, params, { params: lastParams } = {}) {
+    ok(
+      lastParams,
+      `Expecting matching ${lastMethod} call for add-on ${
+        params.id
+      } ${method} call`
+    );
 
     if (method == "update") {
-      equal(params.oldVersion, lastParams.version,
-            "params.version should match last call");
+      equal(
+        params.oldVersion,
+        lastParams.version,
+        "params.version should match last call"
+      );
     } else {
-      equal(params.version, lastParams.version,
-            "params.version should match last call");
+      equal(
+        params.version,
+        lastParams.version,
+        "params.version should match last call"
+      );
     }
 
     if (method !== "update" && method !== "uninstall") {
-      equal(params.installPath.path, lastParams.installPath.path,
-            `params.installPath should match last call`);
+      equal(
+        params.installPath.path,
+        lastParams.installPath.path,
+        `params.installPath should match last call`
+      );
 
-      ok(params.resourceURI.equals(lastParams.resourceURI),
-         `params.resourceURI should match: "${params.resourceURI.spec}" == "${lastParams.resourceURI.spec}"`);
+      ok(
+        params.resourceURI.equals(lastParams.resourceURI),
+        `params.resourceURI should match: "${params.resourceURI.spec}" == "${
+          lastParams.resourceURI.spec
+        }"`
+      );
     }
   },
 
   checkStarted(id, version = undefined) {
     let started = this.started.get(id);
     ok(started, `Should have seen startup method call for ${id}`);
 
-    if (version !== undefined)
-      equal(started.params.version, version,
-            "Expected version number");
+    if (version !== undefined) {
+      equal(started.params.version, version, "Expected version number");
+    }
   },
 
   checkNotStarted(id) {
-    ok(!this.started.has(id),
-       `Should not have seen startup method call for ${id}`);
+    ok(
+      !this.started.has(id),
+      `Should not have seen startup method call for ${id}`
+    );
   },
 
   checkInstalled(id, version = undefined) {
     const installed = this.installed.get(id);
     ok(installed, `Should have seen install call for ${id}`);
 
-    if (version !== undefined)
-      equal(installed.params.version, version,
-            "Expected version number");
+    if (version !== undefined) {
+      equal(installed.params.version, version, "Expected version number");
+    }
 
     return installed;
   },
 
   checkNotInstalled(id) {
-    ok(!this.installed.has(id),
-       `Should not have seen install method call for ${id}`);
+    ok(
+      !this.installed.has(id),
+      `Should not have seen install method call for ${id}`
+    );
   },
 };
 
 function isNightlyChannel() {
   var channel = Services.prefs.getCharPref("app.update.channel", "default");
 
-  return channel != "aurora" && channel != "beta" && channel != "release" && channel != "esr";
+  return (
+    channel != "aurora" &&
+    channel != "beta" &&
+    channel != "release" &&
+    channel != "esr"
+  );
 }
 
-
 async function restartWithLocales(locales) {
   Services.locale.requestedLocales = locales;
   await promiseRestartManager();
 }
 
 /**
  * Returns a map of Addon objects for installed add-ons with the given
  * IDs. The returned map contains a key for the ID of each add-on that
@@ -535,17 +629,21 @@ function checkAddon(id, addon, expected)
   info(`Checking state of addon ${id}`);
 
   if (expected === null) {
     ok(!addon, `Addon ${id} should not exist`);
   } else {
     ok(addon, `Addon ${id} should exist`);
     for (let [key, value] of Object.entries(expected)) {
       if (value instanceof Ci.nsIURI) {
-        equal(addon[key] && addon[key].spec, value.spec, `Expected value of addon.${key}`);
+        equal(
+          addon[key] && addon[key].spec,
+          value.spec,
+          `Expected value of addon.${key}`
+        );
       } else {
         deepEqual(addon[key], value, `Expected value of addon.${key}`);
       }
     }
   }
 }
 
 /**
@@ -563,17 +661,21 @@ function do_check_in_crash_annotation(aI
   }
 
   if (!("Add-ons" in gAppInfo.annotations)) {
     Assert.ok(false, "Cannot find Add-ons entry in crash annotations");
     return;
   }
 
   let addons = gAppInfo.annotations["Add-ons"].split(",");
-  Assert.ok(addons.includes(`${encodeURIComponent(aId)}:${encodeURIComponent(aVersion)}`));
+  Assert.ok(
+    addons.includes(
+      `${encodeURIComponent(aId)}:${encodeURIComponent(aVersion)}`
+    )
+  );
 }
 
 /**
  * Tests that an add-on does not appear in the crash report annotations, if
  * crash reporting is enabled. The test will fail if the add-on is in the
  * annotation.
  * @param  aId
  *         The ID of the add-on
@@ -586,28 +688,35 @@ function do_check_not_in_crash_annotatio
   }
 
   if (!("Add-ons" in gAppInfo.annotations)) {
     Assert.ok(true);
     return;
   }
 
   let addons = gAppInfo.annotations["Add-ons"].split(",");
-  Assert.ok(!addons.includes(`${encodeURIComponent(aId)}:${encodeURIComponent(aVersion)}`));
+  Assert.ok(
+    !addons.includes(
+      `${encodeURIComponent(aId)}:${encodeURIComponent(aVersion)}`
+    )
+  );
 }
 
 function do_get_file_hash(aFile, aAlgorithm) {
-  if (!aAlgorithm)
+  if (!aAlgorithm) {
     aAlgorithm = "sha1";
+  }
 
-  let crypto = Cc["@mozilla.org/security/hash;1"].
-               createInstance(Ci.nsICryptoHash);
+  let crypto = Cc["@mozilla.org/security/hash;1"].createInstance(
+    Ci.nsICryptoHash
+  );
   crypto.initWithString(aAlgorithm);
-  let fis = Cc["@mozilla.org/network/file-input-stream;1"].
-            createInstance(Ci.nsIFileInputStream);
+  let fis = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(
+    Ci.nsIFileInputStream
+  );
   fis.init(aFile, -1, -1, false);
   crypto.updateFromStream(fis, aFile.fileSize);
 
   // return the two-digit hexadecimal code for a byte
   let toHexString = charCode => ("0" + charCode.toString(16)).slice(-2);
 
   let binary = crypto.finish(false);
   let hash = Array.from(binary, c => toHexString(c.charCodeAt(0)));
@@ -627,18 +736,19 @@ function do_get_addon_root_uri(aProfileD
   if (!path.exists()) {
     path.leafName += ".xpi";
     return "jar:" + Services.io.newFileURI(path).spec + "!/";
   }
   return Services.io.newFileURI(path).spec;
 }
 
 function do_get_expected_addon_name(aId) {
-  if (TEST_UNPACKED)
+  if (TEST_UNPACKED) {
     return aId;
+  }
   return aId + ".xpi";
 }
 
 /**
  * Check that an array of actual add-ons is the same as an array of
  * expected add-ons.
  *
  * @param  aActualAddons
@@ -646,18 +756,19 @@ function do_get_expected_addon_name(aId)
  * @param  aExpectedAddons
  *         The array of expected add-ons to check against.
  * @param  aProperties
  *         An array of properties to check.
  */
 function do_check_addons(aActualAddons, aExpectedAddons, aProperties) {
   Assert.notEqual(aActualAddons, null);
   Assert.equal(aActualAddons.length, aExpectedAddons.length);
-  for (let i = 0; i < aActualAddons.length; i++)
+  for (let i = 0; i < aActualAddons.length; i++) {
     do_check_addon(aActualAddons[i], aExpectedAddons[i], aProperties);
+  }
 }
 
 /**
  * Check that the actual add-on is the same as the expected add-on.
  *
  * @param  aActualAddon
  *         The actual add-on to check.
  * @param  aExpectedAddon
@@ -670,68 +781,93 @@ function do_check_addon(aActualAddon, aE
 
   aProperties.forEach(function(aProperty) {
     let actualValue = aActualAddon[aProperty];
     let expectedValue = aExpectedAddon[aProperty];
 
     // Check that all undefined expected properties are null on actual add-on
     if (!(aProperty in aExpectedAddon)) {
       if (actualValue !== undefined && actualValue !== null) {
-        do_throw("Unexpected defined/non-null property for add-on " +
-                 aExpectedAddon.id + " (addon[" + aProperty + "] = " +
-                 actualValue.toSource() + ")");
+        do_throw(
+          "Unexpected defined/non-null property for add-on " +
+            aExpectedAddon.id +
+            " (addon[" +
+            aProperty +
+            "] = " +
+            actualValue.toSource() +
+            ")"
+        );
       }
 
       return;
     }
     if (expectedValue && !actualValue) {
-      do_throw("Missing property for add-on " + aExpectedAddon.id +
-        ": expected addon[" + aProperty + "] = " + expectedValue);
+      do_throw(
+        "Missing property for add-on " +
+          aExpectedAddon.id +
+          ": expected addon[" +
+          aProperty +
+          "] = " +
+          expectedValue
+      );
       return;
     }
 
     switch (aProperty) {
       case "creator":
         do_check_author(actualValue, expectedValue);
         break;
 
       case "developers":
         Assert.equal(actualValue.length, expectedValue.length);
-        for (let i = 0; i < actualValue.length; i++)
+        for (let i = 0; i < actualValue.length; i++) {
           do_check_author(actualValue[i], expectedValue[i]);
+        }
         break;
 
       case "screenshots":
         Assert.equal(actualValue.length, expectedValue.length);
-        for (let i = 0; i < actualValue.length; i++)
+        for (let i = 0; i < actualValue.length; i++) {
           do_check_screenshot(actualValue[i], expectedValue[i]);
+        }
         break;
 
       case "sourceURI":
         Assert.equal(actualValue.spec, expectedValue);
         break;
 
       case "updateDate":
         Assert.equal(actualValue.getTime(), expectedValue.getTime());
         break;
 
       case "compatibilityOverrides":
         Assert.equal(actualValue.length, expectedValue.length);
-        for (let i = 0; i < actualValue.length; i++)
+        for (let i = 0; i < actualValue.length; i++) {
           do_check_compatibilityoverride(actualValue[i], expectedValue[i]);
+        }
         break;
 
       case "icons":
         do_check_icons(actualValue, expectedValue);
         break;
 
       default:
-        if (actualValue !== expectedValue)
-          do_throw("Failed for " + aProperty + " for add-on " + aExpectedAddon.id +
-                   " (" + actualValue + " === " + expectedValue + ")");
+        if (actualValue !== expectedValue) {
+          do_throw(
+            "Failed for " +
+              aProperty +
+              " for add-on " +
+              aExpectedAddon.id +
+              " (" +
+              actualValue +
+              " === " +
+              expectedValue +
+              ")"
+          );
+        }
     }
   });
 }
 
 /**
  * Check that the actual author is the same as the expected author.
  *
  * @param  aActual
@@ -803,17 +939,21 @@ function isExtensionInBootstrappedList(a
  * @param   aManifest
  *          The data to write
  * @param   aDir
  *          The install directory to add the extension to
  * @param   aId
  *          An optional string to override the default installation aId
  * @return  A file pointing to where the extension was installed
  */
-function promiseWriteWebManifestForExtension(aData, aDir, aId = aData.applications.gecko.id) {
+function promiseWriteWebManifestForExtension(
+  aData,
+  aDir,
+  aId = aData.applications.gecko.id
+) {
   let files = {
     "manifest.json": JSON.stringify(aData),
   };
   return AddonTestUtils.promiseWriteFilesToExtension(aDir.path, aId, files);
 }
 
 /**
  * Creates an XPI file for some manifest data in the temporary directory and
@@ -822,74 +962,84 @@ function promiseWriteWebManifestForExten
  * @param   aData
  *          The object holding data about the add-on
  * @return  A file pointing to the created XPI file
  */
 function createTempXPIFile(aData, aExtraFile) {
   let files = {
     "install.rdf": aData,
   };
-  if (typeof aExtraFile == "object")
+  if (typeof aExtraFile == "object") {
     Object.assign(files, aExtraFile);
-  else if (aExtraFile)
+  } else if (aExtraFile) {
     files[aExtraFile] = "";
+  }
 
   return AddonTestUtils.createTempXPIFile(files);
 }
 
 var gExpectedEvents = {};
 var gExpectedInstalls = [];
 var gNext = null;
 
 function getExpectedEvent(aId) {
-  if (!(aId in gExpectedEvents))
+  if (!(aId in gExpectedEvents)) {
     do_throw("Wasn't expecting events for " + aId);
-  if (gExpectedEvents[aId].length == 0)
+  }
+  if (gExpectedEvents[aId].length == 0) {
     do_throw("Too many events for " + aId);
+  }
   let event = gExpectedEvents[aId].shift();
-  if (event instanceof Array)
+  if (event instanceof Array) {
     return event;
+  }
   return [event, true];
 }
 
 function getExpectedInstall(aAddon) {
-  if (gExpectedInstalls instanceof Array)
+  if (gExpectedInstalls instanceof Array) {
     return gExpectedInstalls.shift();
-  if (!aAddon || !aAddon.id)
+  }
+  if (!aAddon || !aAddon.id) {
     return gExpectedInstalls.NO_ID.shift();
+  }
   let id = aAddon.id;
-  if (!(id in gExpectedInstalls) || !(gExpectedInstalls[id] instanceof Array))
+  if (!(id in gExpectedInstalls) || !(gExpectedInstalls[id] instanceof Array)) {
     do_throw("Wasn't expecting events for " + id);
-  if (gExpectedInstalls[id].length == 0)
+  }
+  if (gExpectedInstalls[id].length == 0) {
     do_throw("Too many events for " + id);
+  }
   return gExpectedInstalls[id].shift();
 }
 
 const AddonListener = {
   onPropertyChanged(aAddon, aProperties) {
     info(`Got onPropertyChanged event for ${aAddon.id}`);
     let [event, properties] = getExpectedEvent(aAddon.id);
     Assert.equal("onPropertyChanged", event);
     Assert.equal(aProperties.length, properties.length);
     properties.forEach(function(aProperty) {
       // Only test that the expected properties are listed, having additional
       // properties listed is not necessary a problem
-      if (!aProperties.includes(aProperty))
+      if (!aProperties.includes(aProperty)) {
         do_throw("Did not see property change for " + aProperty);
+      }
     });
     return check_test_completed(arguments);
   },
 
   onEnabling(aAddon, aRequiresRestart) {
     info(`Got onEnabling event for ${aAddon.id}`);
     let [event, expectedRestart] = getExpectedEvent(aAddon.id);
     Assert.equal("onEnabling", event);
     Assert.equal(aRequiresRestart, expectedRestart);
-    if (expectedRestart)
+    if (expectedRestart) {
       Assert.ok(hasFlag(aAddon.pendingOperations, AddonManager.PENDING_ENABLE));
+    }
     Assert.ok(!hasFlag(aAddon.permissions, AddonManager.PERM_CAN_ENABLE));
     return check_test_completed(arguments);
   },
 
   onEnabled(aAddon) {
     info(`Got onEnabled event for ${aAddon.id}`);
     let [event] = getExpectedEvent(aAddon.id);
     Assert.equal("onEnabled", event);
@@ -897,18 +1047,21 @@ const AddonListener = {
     return check_test_completed(arguments);
   },
 
   onDisabling(aAddon, aRequiresRestart) {
     info(`Got onDisabling event for ${aAddon.id}`);
     let [event, expectedRestart] = getExpectedEvent(aAddon.id);
     Assert.equal("onDisabling", event);
     Assert.equal(aRequiresRestart, expectedRestart);
-    if (expectedRestart)
-      Assert.ok(hasFlag(aAddon.pendingOperations, AddonManager.PENDING_DISABLE));
+    if (expectedRestart) {
+      Assert.ok(
+        hasFlag(aAddon.pendingOperations, AddonManager.PENDING_DISABLE)
+      );
+    }
     Assert.ok(!hasFlag(aAddon.permissions, AddonManager.PERM_CAN_DISABLE));
     return check_test_completed(arguments);
   },
 
   onDisabled(aAddon) {
     info(`Got onDisabled event for ${aAddon.id}`);
     let [event] = getExpectedEvent(aAddon.id);
     Assert.equal("onDisabled", event);
@@ -916,35 +1069,41 @@ const AddonListener = {
     return check_test_completed(arguments);
   },
 
   onInstalling(aAddon, aRequiresRestart) {
     info(`Got onInstalling event for ${aAddon.id}`);
     let [event, expectedRestart] = getExpectedEvent(aAddon.id);
     Assert.equal("onInstalling", event);
     Assert.equal(aRequiresRestart, expectedRestart);
-    if (expectedRestart)
-      Assert.ok(hasFlag(aAddon.pendingOperations, AddonManager.PENDING_INSTALL));
+    if (expectedRestart) {
+      Assert.ok(
+        hasFlag(aAddon.pendingOperations, AddonManager.PENDING_INSTALL)
+      );
+    }
     return check_test_completed(arguments);
   },
 
   onInstalled(aAddon) {
     info(`Got onInstalled event for ${aAddon.id}`);
     let [event] = getExpectedEvent(aAddon.id);
     Assert.equal("onInstalled", event);
     return check_test_completed(arguments);
   },
 
   onUninstalling(aAddon, aRequiresRestart) {
     info(`Got onUninstalling event for ${aAddon.id}`);
     let [event, expectedRestart] = getExpectedEvent(aAddon.id);
     Assert.equal("onUninstalling", event);
     Assert.equal(aRequiresRestart, expectedRestart);
-    if (expectedRestart)
-      Assert.ok(hasFlag(aAddon.pendingOperations, AddonManager.PENDING_UNINSTALL));
+    if (expectedRestart) {
+      Assert.ok(
+        hasFlag(aAddon.pendingOperations, AddonManager.PENDING_UNINSTALL)
+      );
+    }
     return check_test_completed(arguments);
   },
 
   onUninstalled(aAddon) {
     info(`Got onUninstalled event for ${aAddon.id}`);
     let [event] = getExpectedEvent(aAddon.id);
     Assert.equal("onUninstalled", event);
     return check_test_completed(arguments);
@@ -955,24 +1114,28 @@ const AddonListener = {
     let [event] = getExpectedEvent(aAddon.id);
     Assert.equal("onOperationCancelled", event);
     return check_test_completed(arguments);
   },
 };
 
 const InstallListener = {
   onNewInstall(install) {
-    if (install.state != AddonManager.STATE_DOWNLOADED &&
-        install.state != AddonManager.STATE_DOWNLOAD_FAILED &&
-        install.state != AddonManager.STATE_AVAILABLE)
+    if (
+      install.state != AddonManager.STATE_DOWNLOADED &&
+      install.state != AddonManager.STATE_DOWNLOAD_FAILED &&
+      install.state != AddonManager.STATE_AVAILABLE
+    ) {
       do_throw("Bad install state " + install.state);
-    if (install.state != AddonManager.STATE_DOWNLOAD_FAILED)
+    }
+    if (install.state != AddonManager.STATE_DOWNLOAD_FAILED) {
       Assert.equal(install.error, 0);
-    else
+    } else {
       Assert.notEqual(install.error, 0);
+    }
     Assert.equal("onNewInstall", getExpectedInstall());
     return check_test_completed(arguments);
   },
 
   onDownloadStarted(install) {
     Assert.equal(install.state, AddonManager.STATE_DOWNLOADING);
     Assert.equal(install.error, 0);
     Assert.equal("onDownloadStarted", getExpectedInstall());
@@ -1017,18 +1180,20 @@ const InstallListener = {
     Assert.equal(install.state, AddonManager.STATE_INSTALL_FAILED);
     Assert.equal("onInstallFailed", getExpectedInstall(install.addon));
     return check_test_completed(arguments);
   },
 
   onInstallCancelled(install) {
     // If the install was cancelled by a listener returning false from
     // onInstallStarted, then the state will revert to STATE_DOWNLOADED.
-    let possibleStates = [AddonManager.STATE_CANCELLED,
-                          AddonManager.STATE_DOWNLOADED];
+    let possibleStates = [
+      AddonManager.STATE_CANCELLED,
+      AddonManager.STATE_DOWNLOADED,
+    ];
     Assert.ok(possibleStates.includes(install.state));
     Assert.equal(install.error, 0);
     Assert.equal("onInstallCancelled", getExpectedInstall(install.addon));
     return check_test_completed(arguments);
   },
 
   onExternalInstall(aAddon, existingAddon, aRequiresRestart) {
     Assert.equal("onExternalInstall", getExpectedInstall(aAddon));
@@ -1057,46 +1222,55 @@ function clearListeners() {
 }
 
 function end_test() {
   clearListeners();
 }
 
 // Checks if all expected events have been seen and if so calls the callback.
 function check_test_completed(aArgs) {
-  if (!gNext)
+  if (!gNext) {
     return undefined;
+  }
 
-  if (gExpectedInstalls instanceof Array &&
-      gExpectedInstalls.length > 0)
+  if (gExpectedInstalls instanceof Array && gExpectedInstalls.length > 0) {
     return undefined;
+  }
 
   for (let id in gExpectedInstalls) {
     let installList = gExpectedInstalls[id];
-    if (installList.length > 0)
+    if (installList.length > 0) {
       return undefined;
+    }
   }
 
   for (let id in gExpectedEvents) {
-    if (gExpectedEvents[id].length > 0)
+    if (gExpectedEvents[id].length > 0) {
       return undefined;
+    }
   }
 
   return gNext.apply(null, aArgs);
 }
 
 // Verifies that all the expected events for all add-ons were seen.
 function ensure_test_completed() {
   for (let i in gExpectedEvents) {
-    if (gExpectedEvents[i].length > 0)
-      do_throw(`Didn't see all the expected events for ${i}: Still expecting ${gExpectedEvents[i]}`);
+    if (gExpectedEvents[i].length > 0) {
+      do_throw(
+        `Didn't see all the expected events for ${i}: Still expecting ${
+          gExpectedEvents[i]
+        }`
+      );
+    }
   }
   gExpectedEvents = {};
-  if (gExpectedInstalls)
+  if (gExpectedInstalls) {
     Assert.equal(gExpectedInstalls.length, 0);
+  }
 }
 
 /**
  * A helper method to install an array of AddonInstall to completion and then
  * call a provided callback.
  *
  * @param   aInstalls
  *          The array of AddonInstalls to install
@@ -1125,34 +1299,35 @@ function installAllFiles(aFiles, aCallba
 
 const EXTENSIONS_DB = "extensions.json";
 var gExtensionsJSON = gProfD.clone();
 gExtensionsJSON.append(EXTENSIONS_DB);
 
 async function promiseInstallWebExtension(aData) {
   let addonFile = createTempWebExtensionFile(aData);
 
-  let {addon} = await promiseInstallFile(addonFile);
+  let { addon } = await promiseInstallFile(addonFile);
   return addon;
 }
 
 // By default use strict compatibility.
 Services.prefs.setBoolPref("extensions.strictCompatibility", true);
 
 // Ensure signature checks are enabled by default.
 Services.prefs.setBoolPref(PREF_XPI_SIGNATURES_REQUIRED, false);
 
 Services.prefs.setBoolPref("extensions.legacy.enabled", true);
 
 // Copies blocklistFile (an nsIFile) to gProfD/blocklist.xml.
 function copyBlocklistToProfile(blocklistFile) {
   var dest = gProfD.clone();
   dest.append("blocklist.xml");
-  if (dest.exists())
+  if (dest.exists()) {
     dest.remove(false);
+  }
   blocklistFile.copyTo(gProfD, "blocklist.xml");
   dest.lastModifiedTime = Date.now();
 }
 
 // Make sure that a given path does not exist.
 function pathShouldntExist(file) {
   if (file.exists()) {
     do_throw(`Test cleanup: path ${file.path} exists when it should not`);
@@ -1196,56 +1371,67 @@ async function loadJSON(aFile) {
   return JSON.parse(data);
 }
 
 /**
  * Raw save of a JSON blob to file.
  */
 async function saveJSON(aData, aFile) {
   info("Starting to save JSON file " + aFile);
-  await OS.File.writeAtomic(aFile, new TextEncoder().encode(JSON.stringify(aData, null, 2)));
+  await OS.File.writeAtomic(
+    aFile,
+    new TextEncoder().encode(JSON.stringify(aData, null, 2))
+  );
   info("Done saving JSON file " + aFile.path);
 }
 
 /**
  * Create a callback function that calls do_execute_soon on an actual callback and arguments.
  */
 function callback_soon(aFunction) {
   return function(...args) {
-    executeSoon(function() {
-      aFunction.apply(null, args);
-    }, aFunction.name ? "delayed callback " + aFunction.name : "delayed callback");
+    executeSoon(
+      function() {
+        aFunction.apply(null, args);
+      },
+      aFunction.name ? "delayed callback " + aFunction.name : "delayed callback"
+    );
   };
 }
 
-XPCOMUtils.defineLazyServiceGetter(this, "pluginHost",
-                                  "@mozilla.org/plugin/host;1", "nsIPluginHost");
+XPCOMUtils.defineLazyServiceGetter(
+  this,
+  "pluginHost",
+  "@mozilla.org/plugin/host;1",
+  "nsIPluginHost"
+);
 
 class MockPluginTag {
   constructor(opts, enabledState = Ci.nsIPluginTag.STATE_ENABLED) {
     this.pluginTag = pluginHost.createFakePlugin({
       handlerURI: "resource://fake-plugin/${Math.random()}.xhtml",
-      mimeEntries: [{type: "application/x-fake-plugin"}],
+      mimeEntries: [{ type: "application/x-fake-plugin" }],
       fileName: `${opts.name}.so`,
       ...opts,
     });
     this.pluginTag.enabledState = enabledState;
 
     this.name = opts.name;
     this.version = opts.version;
   }
   async isBlocklisted() {
     let state = await Blocklist.getPluginBlocklistState(this.pluginTag);
     return state == Services.blocklist.STATE_BLOCKED;
   }
   get disabled() {
     return this.pluginTag.enabledState == Ci.nsIPluginTag.STATE_DISABLED;
   }
   set disabled(val) {
-    this.enabledState = Ci.nsIPluginTag[val ? "STATE_DISABLED" : "STATE_ENABLED"];
+    this.enabledState =
+      Ci.nsIPluginTag[val ? "STATE_DISABLED" : "STATE_ENABLED"];
   }
   get enabledState() {
     return this.pluginTag.enabledState;
   }
   set enabledState(val) {
     this.pluginTag.enabledState = val;
   }
 }
@@ -1274,17 +1460,23 @@ async function setInitialState(addon, in
 /**
  * Escapes any occurrences of &, ", < or > with XML entities.
  *
  * @param {string} str
  *        The string to escape.
  * @returns {string} The escaped string.
  */
 function escapeXML(str) {
-  let replacements = {"&": "&amp;", '"': "&quot;", "'": "&apos;", "<": "&lt;", ">": "&gt;"};
+  let replacements = {
+    "&": "&amp;",
+    '"': "&quot;",
+    "'": "&apos;",
+    "<": "&lt;",
+    ">": "&gt;",
+  };
   return String(str).replace(/[&"''<>]/g, m => replacements[m]);
 }
 
 /**
  * A tagged template function which escapes any XML metacharacters in
  * interpolated values.
  *
  * @param {Array<string>} strings
@@ -1306,31 +1498,37 @@ function escaped(strings, ...values) {
   }
 
   return result.join("");
 }
 
 function _writeProps(obj, props, indent = "  ") {
   let items = [];
   for (let prop of props) {
-    if (obj[prop] !== undefined)
+    if (obj[prop] !== undefined) {
       items.push(escaped`${indent}<em:${prop}>${obj[prop]}</em:${prop}>\n`);
+    }
   }
   return items.join("");
 }
 
 function _writeArrayProps(obj, props, indent = "  ") {
   let items = [];
   for (let prop of props) {
-    for (let val of obj[prop] || [])
+    for (let val of obj[prop] || []) {
       items.push(escaped`${indent}<em:${prop}>${val}</em:${prop}>\n`);
+    }
   }
   return items.join("");
 }
 
 function _writeLocaleStrings(data) {
   let items = [];
 
-  items.push(this._writeProps(data, ["name", "description", "creator", "homepageURL"]));
-  items.push(this._writeArrayProps(data, ["developer", "translator", "contributor"]));
+  items.push(
+    this._writeProps(data, ["name", "description", "creator", "homepageURL"])
+  );
+  items.push(
+    this._writeArrayProps(data, ["developer", "translator", "contributor"])
+  );
 
   return items.join("");
 }
--- a/common/test/xpcshell/test_bootstrap.js
+++ b/common/test/xpcshell/test_bootstrap.js
@@ -1,30 +1,32 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-const APP_STARTUP                     = 1;
-const APP_SHUTDOWN                    = 2;
-const ADDON_ENABLE                    = 3;
-const ADDON_DISABLE                   = 4;
-const ADDON_INSTALL                   = 5;
-const ADDON_UNINSTALL                 = 6;
-const ADDON_UPGRADE                   = 7;
-const ADDON_DOWNGRADE                 = 8;
+const APP_STARTUP = 1;
+const APP_SHUTDOWN = 2;
+const ADDON_ENABLE = 3;
+const ADDON_DISABLE = 4;
+const ADDON_INSTALL = 5;
+const ADDON_UNINSTALL = 6;
+const ADDON_UPGRADE = 7;
+const ADDON_DOWNGRADE = 8;
 
 const ID1 = "bootstrap1@tests.mozilla.org";
 const ID2 = "bootstrap2@tests.mozilla.org";
 
 // This verifies that bootstrappable add-ons can be used without restarts.
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // Enable loading extensions from the user scopes
-Services.prefs.setIntPref("extensions.enabledScopes",
-                          AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_USER);
+Services.prefs.setIntPref(
+  "extensions.enabledScopes",
+  AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_USER
+);
 
 BootstrapMonitor.init();
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
 
 const profileDir = gProfD.clone();
 profileDir.append("extensions");
 const userExtDir = gProfD.clone();
@@ -77,28 +79,31 @@ const ADDONS = {
       legacy: {
         type: "bootstrap",
       },
       manifest_version: 2,
       version: "3.0",
 
       name: "Test Bootstrap 1",
 
-      targetApplications: [{
-        applications: {
-          gecko: {
-            id: "undefined",
+      targetApplications: [
+        {
+          applications: {
+            gecko: {
+              id: "undefined",
+            },
           },
+          legacy: {
+            type: "bootstrap",
+          },
+          manifest_version: 2,
+          minVersion: "1",
+          maxVersion: "1",
         },
-        legacy: {
-          type: "bootstrap",
-        },
-        manifest_version: 2,
-        minVersion: "1",
-        maxVersion: "1"}],
+      ],
     }),
     "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS,
   },
   test_bootstrap2_1: {
     "manifest.json": JSON.stringify({
       applications: {
         gecko: {
           id: "bootstrap2@tests.mozilla.org",
@@ -121,25 +126,24 @@ var startupCacheMonitor = {
   // Checks that the notification has been fired since the last time this was called.
   check(expected) {
     equal(this.notificationFired, expected);
     this.notificationFired = false;
   },
 };
 Services.obs.addObserver(startupCacheMonitor, "startupcache-invalidate");
 
-var testserver = AddonTestUtils.createHttpServer({hosts: ["example.com"]});
+var testserver = AddonTestUtils.createHttpServer({ hosts: ["example.com"] });
 
 const XPIS = {};
 for (let [name, addon] of Object.entries(ADDONS)) {
   XPIS[name] = AddonTestUtils.createTempXPIFile(addon);
   testserver.registerFile(`/addons/${name}.xpi`, XPIS[name]);
 }
 
-
 function getStartupReason() {
   let info = BootstrapMonitor.started.get(ID1);
   return info ? info.reason : undefined;
 }
 
 function getShutdownReason() {
   let info = BootstrapMonitor.stopped.get(ID1);
   return info ? info.reason : undefined;
@@ -171,31 +175,39 @@ function getInstallOldVersion() {
 }
 
 function getUninstallNewVersion() {
   let info = BootstrapMonitor.uninstalled.get(ID1);
   return info ? info.data.newVersion : undefined;
 }
 
 async function checkBootstrappedPref() {
-  let XPIScope = ChromeUtils.import("resource://gre/modules/addons/XPIProvider.jsm", null);
+  let XPIScope = ChromeUtils.import(
+    "resource://gre/modules/addons/XPIProvider.jsm",
+    null
+  );
 
   let data = new Map();
   for (let entry of XPIScope.XPIStates.enabledAddons()) {
     data.set(entry.id, entry);
   }
 
   let addons = await AddonManager.getAddonsByTypes(["extension"]);
   for (let addon of addons) {
-    if (!addon.id.endsWith("@tests.mozilla.org"))
+    if (!addon.id.endsWith("@tests.mozilla.org")) {
+      continue;
+    }
+    if (!addon.isActive) {
       continue;
-    if (!addon.isActive)
+    }
+    if (
+      addon.operationsRequiringRestart != AddonManager.OP_NEEDS_RESTART_NONE
+    ) {
       continue;
-    if (addon.operationsRequiringRestart != AddonManager.OP_NEEDS_RESTART_NONE)
-      continue;
+    }
 
     ok(data.has(addon.id));
     let addonData = data.get(addon.id);
     data.delete(addon.id);
 
     equal(addonData.version, addon.version);
     equal(addonData.type, addon.type);
 
@@ -213,51 +225,50 @@ add_task(async function run_test() {
   promiseStartupManager();
 
   ok(!gExtensionsJSON.exists());
   ok(!gAddonStartup.exists());
 });
 
 // Tests that installing doesn't require a restart
 add_task(async function test_1() {
-  prepare_test({}, [
-    "onNewInstall",
-  ]);
+  prepare_test({}, ["onNewInstall"]);
 
   let install = await AddonManager.getInstallForFile(XPIS.test_bootstrap1_1);
   ensure_test_completed();
 
   notEqual(install, null);
   equal(install.type, "extension");
   equal(install.version, "1.0");
   equal(install.name, "Test Bootstrap 1");
   equal(install.state, AddonManager.STATE_DOWNLOADED);
   notEqual(install.addon.syncGUID, null);
-  equal(install.addon.operationsRequiringRestart &
-               AddonManager.OP_NEEDS_RESTART_INSTALL, 0);
+  equal(
+    install.addon.operationsRequiringRestart &
+      AddonManager.OP_NEEDS_RESTART_INSTALL,
+    0
+  );
   do_check_not_in_crash_annotation(ID1, "1.0");
 
   let addon = install.addon;
 
   await Promise.all([
     BootstrapMonitor.promiseAddonStartup(ID1),
     new Promise(resolve => {
-      prepare_test({
-        [ID1]: [
-          ["onInstalling", false],
-          "onInstalled",
-        ],
-      }, [
-        "onInstallStarted",
-        "onInstallEnded",
-      ], function() {
-        // startup should not have been called yet.
-        BootstrapMonitor.checkAddonNotStarted(ID1);
-        resolve();
-      });
+      prepare_test(
+        {
+          [ID1]: [["onInstalling", false], "onInstalled"],
+        },
+        ["onInstallStarted", "onInstallEnded"],
+        function() {
+          // startup should not have been called yet.
+          BootstrapMonitor.checkAddonNotStarted(ID1);
+          resolve();
+        }
+      );
       install.install();
     }),
   ]);
 
   await checkBootstrappedPref();
   let installSyncGUID = addon.syncGUID;
 
   let installs = await AddonManager.getAllInstalls();
@@ -285,24 +296,23 @@ add_task(async function test_1() {
 
   startupCacheMonitor.check(false);
 });
 
 // Tests that disabling doesn't require a restart
 add_task(async function test_2() {
   let b1 = await AddonManager.getAddonByID(ID1);
   prepare_test({
-    [ID1]: [
-      ["onDisabling", false],
-      "onDisabled",
-    ],
+    [ID1]: [["onDisabling", false], "onDisabled"],
   });
 
-  equal(b1.operationsRequiringRestart &
-        AddonManager.OP_NEEDS_RESTART_DISABLE, 0);
+  equal(
+    b1.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_DISABLE,
+    0
+  );
   await b1.disable();
   ensure_test_completed();
 
   await new Promise(executeSoon);
 
   notEqual(b1, null);
   equal(b1.version, "1.0");
   ok(!b1.appDisabled);
@@ -354,24 +364,23 @@ add_task(async function test_3() {
   await checkBootstrappedPref();
   startupCacheMonitor.check(false);
 });
 
 // Tests that enabling doesn't require a restart
 add_task(async function test_4() {
   let b1 = await AddonManager.getAddonByID(ID1);
   prepare_test({
-    [ID1]: [
-      ["onEnabling", false],
-      "onEnabled",
-    ],
+    [ID1]: [["onEnabling", false], "onEnabled"],
   });
 
-  equal(b1.operationsRequiringRestart &
-               AddonManager.OP_NEEDS_RESTART_ENABLE, 0);
+  equal(
+    b1.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_ENABLE,
+    0
+  );
   await b1.enable();
   ensure_test_completed();
 
   notEqual(b1, null);
   equal(b1.version, "1.0");
   ok(!b1.appDisabled);
   ok(!b1.userDisabled);
   ok(b1.isActive);
@@ -420,41 +429,37 @@ add_task(async function test_5() {
   ok(!b1.isSystem);
 
   await checkBootstrappedPref();
   startupCacheMonitor.check(false);
 });
 
 // Tests that installing an upgrade doesn't require a restart
 add_task(async function test_6() {
-  prepare_test({}, [
-    "onNewInstall",
-  ]);
+  prepare_test({}, ["onNewInstall"]);
 
   let install = await AddonManager.getInstallForFile(XPIS.test_bootstrap1_2);
   ensure_test_completed();
 
   notEqual(install, null);
   equal(install.type, "extension");
   equal(install.version, "2.0");
   equal(install.name, "Test Bootstrap 1");
   equal(install.state, AddonManager.STATE_DOWNLOADED);
 
   await Promise.all([
     BootstrapMonitor.promiseAddonStartup(ID1),
     new Promise(resolve => {
-      prepare_test({
-        [ID1]: [
-          ["onInstalling", false],
-          "onInstalled",
-        ],
-      }, [
-        "onInstallStarted",
-        "onInstallEnded",
-      ], resolve);
+      prepare_test(
+        {
+          [ID1]: [["onInstalling", false], "onInstalled"],
+        },
+        ["onInstallStarted", "onInstallEnded"],
+        resolve
+      );
       install.install();
     }),
   ]);
 
   startupCacheMonitor.check(true);
 
   let b1 = await AddonManager.getAddonByID(ID1);
   notEqual(b1, null);
@@ -476,24 +481,23 @@ add_task(async function test_6() {
 
   await checkBootstrappedPref();
 });
 
 // Tests that uninstalling doesn't require a restart
 add_task(async function test_7() {
   let b1 = await AddonManager.getAddonByID(ID1);
   prepare_test({
-    [ID1]: [
-      ["onUninstalling", false],
-      "onUninstalled",
-    ],
+    [ID1]: [["onUninstalling", false], "onUninstalled"],
   });
 
-  equal(b1.operationsRequiringRestart &
-        AddonManager.OP_NEEDS_RESTART_UNINSTALL, 0);
+  equal(
+    b1.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_UNINSTALL,
+    0
+  );
   await b1.uninstall();
 
   await checkBootstrappedPref();
   startupCacheMonitor.check(true);
 
   ensure_test_completed();
   BootstrapMonitor.checkAddonNotInstalled(ID1);
   BootstrapMonitor.checkAddonNotStarted(ID1);
@@ -551,45 +555,40 @@ add_task(async function test_9() {
   let b1 = await AddonManager.getAddonByID(ID1);
   equal(b1, null);
   do_check_not_in_crash_annotation(ID1, "1.0");
 
   await checkBootstrappedPref();
   startupCacheMonitor.check(false);
 });
 
-
 // Tests that installing a downgrade sends the right reason
 add_task(async function test_10() {
-  prepare_test({}, [
-    "onNewInstall",
-  ]);
+  prepare_test({}, ["onNewInstall"]);
 
   let install = await AddonManager.getInstallForFile(XPIS.test_bootstrap1_2);
   ensure_test_completed();
 
   notEqual(install, null);
   equal(install.type, "extension");
   equal(install.version, "2.0");
   equal(install.name, "Test Bootstrap 1");
   equal(install.state, AddonManager.STATE_DOWNLOADED);
   do_check_not_in_crash_annotation(ID1, "2.0");
 
   await Promise.all([
     BootstrapMonitor.promiseAddonStartup(ID1),
     new Promise(resolve => {
-      prepare_test({
-        [ID1]: [
-          ["onInstalling", false],
-          "onInstalled",
-        ],
-      }, [
-        "onInstallStarted",
-        "onInstallEnded",
-      ], resolve);
+      prepare_test(
+        {
+          [ID1]: [["onInstalling", false], "onInstalled"],
+        },
+        ["onInstallStarted", "onInstallEnded"],
+        resolve
+      );
       install.install();
     }),
   ]);
 
   startupCacheMonitor.check(false);
 
   let b1 = await AddonManager.getAddonByID(ID1);
   notEqual(b1, null);
@@ -599,41 +598,37 @@ add_task(async function test_10() {
   ok(b1.isActive);
   ok(!b1.isSystem);
   BootstrapMonitor.checkAddonInstalled(ID1, "2.0");
   BootstrapMonitor.checkAddonStarted(ID1, "2.0");
   equal(getStartupReason(), ADDON_INSTALL);
   equal(getStartupOldVersion(), undefined);
   do_check_in_crash_annotation(ID1, "2.0");
 
-  prepare_test({}, [
-    "onNewInstall",
-  ]);
+  prepare_test({}, ["onNewInstall"]);
 
   install = await AddonManager.getInstallForFile(XPIS.test_bootstrap1_1);
   ensure_test_completed();
 
   notEqual(install, null);
   equal(install.type, "extension");
   equal(install.version, "1.0");
   equal(install.name, "Test Bootstrap 1");
   equal(install.state, AddonManager.STATE_DOWNLOADED);
 
   await Promise.all([
     BootstrapMonitor.promiseAddonStartup(ID1),
     new Promise(resolve => {
-      prepare_test({
-        [ID1]: [
-          ["onInstalling", false],
-          "onInstalled",
-        ],
-      }, [
-        "onInstallStarted",
-        "onInstallEnded",
-      ], resolve);
+      prepare_test(
+        {
+          [ID1]: [["onInstalling", false], "onInstalled"],
+        },
+        ["onInstallStarted", "onInstallEnded"],
+        resolve
+      );
       install.install();
     }),
   ]);
 
   startupCacheMonitor.check(true);
 
   b1 = await AddonManager.getAddonByID(ID1);
   notEqual(b1, null);
@@ -770,24 +765,28 @@ add_task(async function test_18() {
   startupCacheMonitor.check(false);
 });
 
 // Check that uninstalling the profile version reveals the non-profile one
 add_task(async function test_19() {
   let b1 = await AddonManager.getAddonByID(ID1);
   // The revealed add-on gets activated asynchronously
   await new Promise(resolve => {
-    prepare_test({
-      [ID1]: [
-        ["onUninstalling", false],
-        "onUninstalled",
-        ["onInstalling", false],
-        "onInstalled",
-      ],
-    }, [], resolve);
+    prepare_test(
+      {
+        [ID1]: [
+          ["onUninstalling", false],
+          "onUninstalled",
+          ["onInstalling", false],
+          "onInstalled",
+        ],
+      },
+      [],
+      resolve
+    );
 
     b1.uninstall();
   });
 
   startupCacheMonitor.check(true);
 
   b1 = await AddonManager.getAddonByID(ID1);
   // Should have reverted to the older version
--- a/common/test/xpcshell/test_bootstrap_const.js
+++ b/common/test/xpcshell/test_bootstrap_const.js
@@ -14,17 +14,18 @@ const ADDONS = {
       },
       legacy: {
         type: "bootstrap",
       },
       manifest_version: 2,
       name: "Test Bootstrap 1",
       version: "1.0",
     }),
-    "bootstrap.js": "var {Services} = ChromeUtils.import(\"resource://gre/modules/Services.jsm\");\n\nconst install = function() {\n  Services.obs.notifyObservers(null, \"addon-install\");\n};\n",
+    "bootstrap.js":
+      'var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");\n\nconst install = function() {\n  Services.obs.notifyObservers(null, "addon-install");\n};\n',
   },
 };
 
 add_task(async function() {
   await promiseStartupManager();
 
   let sawInstall = false;
   Services.obs.addObserver(function() {
--- a/common/test/xpcshell/test_bootstrap_globals.js
+++ b/common/test/xpcshell/test_bootstrap_globals.js
@@ -1,14 +1,14 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // This verifies that bootstrap.js has the expected globals defined
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1");
 
 const ADDONS = {
   bootstrap_globals: {
     "manifest.json": JSON.stringify({
       applications: {
         gecko: {
@@ -43,33 +43,31 @@ function startup(data, reason) {
 
 function install(data, reason) {}
 function shutdown(data, reason) {}
 function uninstall(data, reason) {}
 `,
   },
 };
 
-
-const EXPECTED_GLOBALS = [
-  ["console", "object"],
-];
+const EXPECTED_GLOBALS = [["console", "object"]];
 
 async function run_test() {
   do_test_pending();
   await promiseStartupManager();
   let sawGlobals = false;
 
   Services.obs.addObserver(function(subject) {
     subject.wrappedJSObject.expectedGlobals = EXPECTED_GLOBALS;
   }, "bootstrap-request-globals");
 
   Services.obs.addObserver(function({ wrappedJSObject: seenGlobals }) {
-    for (let [name ] of EXPECTED_GLOBALS)
+    for (let [name] of EXPECTED_GLOBALS) {
       Assert.ok(seenGlobals.has(name));
+    }
 
     sawGlobals = true;
   }, "bootstrap-seen-globals");
 
   await AddonTestUtils.promiseInstallXPI(ADDONS.bootstrap_globals);
   Assert.ok(sawGlobals);
   await promiseShutdownManager();
   do_test_finished();
--- a/common/test/xpcshell/test_bootstrapped_chrome_manifest.js
+++ b/common/test/xpcshell/test_bootstrapped_chrome_manifest.js
@@ -23,29 +23,32 @@ const ADDON = {
 add_task(async function run_test() {
   createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
   await promiseStartupManager();
 });
 
 function checkActive(expected) {
   let target = { active: false };
   let load = () => {
-    Services.scriptloader.loadSubScript("chrome://bug675371/content/test.js", target);
+    Services.scriptloader.loadSubScript(
+      "chrome://bug675371/content/test.js",
+      target
+    );
   };
 
   if (expected) {
     load();
   } else {
     Assert.throws(load, /Error opening input stream/);
   }
   equal(target.active, expected, "Manifest is active?");
 }
 
 add_task(async function test() {
-  let {addon} = await AddonTestUtils.promiseInstallXPI(ADDON);
+  let { addon } = await AddonTestUtils.promiseInstallXPI(ADDON);
 
   Assert.ok(addon.isActive);
 
   // Tests that chrome.manifest is registered when the addon is installed.
   checkActive(true);
 
   await addon.disable();
   checkActive(false);
--- a/ldap/xpcom/src/nsLDAPProtocolHandler.js
+++ b/ldap/xpcom/src/nsLDAPProtocolHandler.js
@@ -1,48 +1,62 @@
 /* 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 {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+var { XPCOMUtils } = ChromeUtils.import(
+  "resource://gre/modules/XPCOMUtils.jsm"
+);
 
 const kNetworkProtocolCIDPrefix = "@mozilla.org/network/protocol;1?name=";
 const nsIProtocolHandler = Ci.nsIProtocolHandler;
 
 function makeProtocolHandler(aCID, aProtocol, aDefaultPort) {
   return {
     classID: Components.ID(aCID),
     QueryInterface: ChromeUtils.generateQI([nsIProtocolHandler]),
 
     scheme: aProtocol,
     defaultPort: aDefaultPort,
-    protocolFlags: nsIProtocolHandler.URI_NORELATIVE |
-                   nsIProtocolHandler.URI_DANGEROUS_TO_LOAD |
-                   nsIProtocolHandler.ALLOWS_PROXY,
+    protocolFlags:
+      nsIProtocolHandler.URI_NORELATIVE |
+      nsIProtocolHandler.URI_DANGEROUS_TO_LOAD |
+      nsIProtocolHandler.ALLOWS_PROXY,
 
     newChannel(aURI, aLoadInfo) {
       if ("@mozilla.org/network/ldap-channel;1" in Cc) {
-        var channel = Cc["@mozilla.org/network/ldap-channel;1"]
-                        .createInstance(Ci.nsIChannel);
+        var channel = Cc["@mozilla.org/network/ldap-channel;1"].createInstance(
+          Ci.nsIChannel
+        );
         channel.init(aURI);
         channel.loadInfo = aLoadInfo;
         return channel;
       }
 
       throw Cr.NS_ERROR_NOT_IMPLEMENTED;
     },
 
     allowPort(port, scheme) {
       return port == aDefaultPort;
     },
   };
 }
 
 function nsLDAPProtocolHandler() {}
 
-nsLDAPProtocolHandler.prototype = makeProtocolHandler("{b3de9249-b0e5-4c12-8d91-c9a434fd80f5}", "ldap", 389);
+nsLDAPProtocolHandler.prototype = makeProtocolHandler(
+  "{b3de9249-b0e5-4c12-8d91-c9a434fd80f5}",
+  "ldap",
+  389
+);
 
 function nsLDAPSProtocolHandler() {}
 
-nsLDAPSProtocolHandler.prototype = makeProtocolHandler("{c85a5ef2-9c56-445f-b029-76889f2dd29b}", "ldaps", 636);
+nsLDAPSProtocolHandler.prototype = makeProtocolHandler(
+  "{c85a5ef2-9c56-445f-b029-76889f2dd29b}",
+  "ldaps",
+  636
+);
 
-const NSGetFactory = XPCOMUtils.generateNSGetFactory([nsLDAPProtocolHandler,
-                                                      nsLDAPSProtocolHandler]);
+const NSGetFactory = XPCOMUtils.generateNSGetFactory([
+  nsLDAPProtocolHandler,
+  nsLDAPSProtocolHandler,
+]);
--- a/ldap/xpcom/tests/unit/test_nsLDAPURL.js
+++ b/ldap/xpcom/tests/unit/test_nsLDAPURL.js
@@ -1,14 +1,14 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /*
  * Test suite for nsLDAPURL functions.
  */
 
-var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 // If we are still using the wallet service, then default port numbers
 // are still visible in the password manager, and therefore we need to have
 // them in the url. The toolkit login manager doesn't do this.
 const usingWallet = "nsIWalletService" in Ci;
 const portAdpt = usingWallet ? ":389" : "";
 
 const ldapURLs = [
@@ -26,55 +26,66 @@ const ldapURLs = [
     displaySpec: "ldap://localhost/dc=test",
     displayPrePath: "ldap://localhost",
     displayHost: "localhost",
     displayHostPort: "localhost",
     dn: "dc=test",
     scope: Ci.nsILDAPURL.SCOPE_BASE,
     filter: "(objectclass=*)",
     options: 0,
-  }, {
+  },
+  {
     url: "ldap://localhost:389/dc=test,dc=abc??sub?(objectclass=*)",
-    spec: "ldap://localhost" + portAdpt + "/dc=test,dc=abc??sub?(objectclass=*)",
-    asciiSpec: "ldap://localhost" + portAdpt + "/dc=test,dc=abc??sub?(objectclass=*)",
+    spec:
+      "ldap://localhost" + portAdpt + "/dc=test,dc=abc??sub?(objectclass=*)",
+    asciiSpec:
+      "ldap://localhost" + portAdpt + "/dc=test,dc=abc??sub?(objectclass=*)",
     host: "localhost",
     asciiHost: "localhost",
     port: usingWallet ? 389 : -1,
     scheme: "ldap",
     path: "/dc=test,dc=abc??sub?(objectclass=*)",
     prePath: "ldap://localhost" + portAdpt,
     hostPort: "localhost" + portAdpt,
-    displaySpec: "ldap://localhost" + portAdpt + "/dc=test,dc=abc??sub?(objectclass=*)",
+    displaySpec:
+      "ldap://localhost" + portAdpt + "/dc=test,dc=abc??sub?(objectclass=*)",
     displayPrePath: "ldap://localhost",
     displayHost: "localhost",
     displayHostPort: "localhost" + portAdpt,
     dn: "dc=test,dc=abc",
     scope: Ci.nsILDAPURL.SCOPE_SUBTREE,
     filter: "(objectclass=*)",
     options: 0,
-  }, {
+  },
+  {
     url: "ldap://\u65e5\u672c\u8a93.jp:389/dc=tes\u65e5t??one?(oc=xyz)",
-    spec: "ldap://xn--wgv71a309e.jp" + portAdpt + "/dc=tes%E6%97%A5t??one?(oc=xyz)",
-    asciiSpec: "ldap://xn--wgv71a309e.jp" + portAdpt + "/dc=tes%E6%97%A5t??one?(oc=xyz)",
+    spec:
+      "ldap://xn--wgv71a309e.jp" + portAdpt + "/dc=tes%E6%97%A5t??one?(oc=xyz)",
+    asciiSpec:
+      "ldap://xn--wgv71a309e.jp" + portAdpt + "/dc=tes%E6%97%A5t??one?(oc=xyz)",
     host: "xn--wgv71a309e.jp",
     asciiHost: "xn--wgv71a309e.jp",
     port: usingWallet ? 389 : -1,
     scheme: "ldap",
     path: "/dc=tes%E6%97%A5t??one?(oc=xyz)",
     prePath: "ldap://xn--wgv71a309e.jp" + portAdpt,
     hostPort: "xn--wgv71a309e.jp" + portAdpt,
-    displaySpec: "ldap://\u65e5\u672c\u8a93.jp" + portAdpt + "/dc=tes%E6%97%A5t??one?(oc=xyz)",
+    displaySpec:
+      "ldap://\u65e5\u672c\u8a93.jp" +
+      portAdpt +
+      "/dc=tes%E6%97%A5t??one?(oc=xyz)",
     displayPrePath: "ldap://\u65e5\u672c\u8a93.jp" + portAdpt,
     displayHost: "\u65e5\u672c\u8a93.jp",
     displayHostPort: "\u65e5\u672c\u8a93.jp" + portAdpt,
     dn: "dc=tes\u65e5t",
     scope: Ci.nsILDAPURL.SCOPE_ONELEVEL,
     filter: "(oc=xyz)",
     options: 0,
-  }, {
+  },
+  {
     url: "ldaps://localhost/dc=test",
     spec: "ldaps://localhost/dc=test",
     asciiSpec: "ldaps://localhost/dc=test",
     host: "localhost",
     asciiHost: "localhost",
     port: -1,
     scheme: "ldaps",
     path: "/dc=test",
@@ -129,116 +140,183 @@ function run_test() {
 
   url = Services.io.newURI(kBaseURL).QueryInterface(Ci.nsILDAPURL);
 
   // Test - dn
 
   url.dn = "dc=short";
 
   Assert.equal(url.dn, "dc=short");
-  Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short??sub?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" + portAdpt + "/dc=short??sub?(objectclass=*)"
+  );
 
   // Test - scope
 
   url.scope = Ci.nsILDAPURL.SCOPE_BASE;
 
   Assert.equal(url.scope, Ci.nsILDAPURL.SCOPE_BASE);
-  Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short???(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" + portAdpt + "/dc=short???(objectclass=*)"
+  );
 
   url.scope = Ci.nsILDAPURL.SCOPE_ONELEVEL;
 
   Assert.equal(url.scope, Ci.nsILDAPURL.SCOPE_ONELEVEL);
-  Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)"
+  );
 
   // Test - filter
 
   url.filter = "(oc=ygh)";
 
   Assert.equal(url.filter, "(oc=ygh)");
-  Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short??one?(oc=ygh)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" + portAdpt + "/dc=short??one?(oc=ygh)"
+  );
 
   url.filter = "";
 
   Assert.equal(url.filter, "(objectclass=*)");
-  Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)"
+  );
 
   // Test - scheme
 
   // An old version used to have a bug whereby if you set the scheme to the
   // same thing twice, you'd get the options set wrongly.
-  url = url.mutate().setScheme("ldaps").finalize().QueryInterface(Ci.nsILDAPURL);
+  url = url
+    .mutate()
+    .setScheme("ldaps")
+    .finalize()
+    .QueryInterface(Ci.nsILDAPURL);
   Assert.equal(url.options, 1);
-  Assert.equal(url.spec, "ldaps://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
-  url = url.mutate().setScheme("ldaps").finalize().QueryInterface(Ci.nsILDAPURL);
+  Assert.equal(
+    url.spec,
+    "ldaps://localhost" + portAdpt + "/dc=short??one?(objectclass=*)"
+  );
+  url = url
+    .mutate()
+    .setScheme("ldaps")
+    .finalize()
+    .QueryInterface(Ci.nsILDAPURL);
   Assert.equal(url.options, 1);
-  Assert.equal(url.spec, "ldaps://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldaps://localhost" + portAdpt + "/dc=short??one?(objectclass=*)"
+  );
 
   Assert.ok(url.schemeIs("ldaps"));
   Assert.ok(!url.schemeIs("ldap"));
 
-  url = url.mutate().setScheme("ldap").finalize().QueryInterface(Ci.nsILDAPURL);
+  url = url
+    .mutate()
+    .setScheme("ldap")
+    .finalize()
+    .QueryInterface(Ci.nsILDAPURL);
   Assert.equal(url.options, 0);
-  Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
-  url = url.mutate().setScheme("ldap").finalize().QueryInterface(Ci.nsILDAPURL);
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)"
+  );
+  url = url
+    .mutate()
+    .setScheme("ldap")
+    .finalize()
+    .QueryInterface(Ci.nsILDAPURL);
   Assert.equal(url.options, 0);
-  Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)"
+  );
 
   Assert.ok(url.schemeIs("ldap"));
   Assert.ok(!url.schemeIs("ldaps"));
 
   // Test - Options
 
   url.options = Ci.nsILDAPURL.OPT_SECURE;
 
   Assert.equal(url.options, Ci.nsILDAPURL.OPT_SECURE);
-  Assert.equal(url.spec, "ldaps://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldaps://localhost" + portAdpt + "/dc=short??one?(objectclass=*)"
+  );
 
   url.options = 0;
 
   Assert.equal(url.options, 0);
-  Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)"
+  );
 
   // Test - Equals
 
-  var url2 = Services.io.newURI("ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)")
-                        .QueryInterface(Ci.nsILDAPURL);
+  var url2 = Services.io
+    .newURI("ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)")
+    .QueryInterface(Ci.nsILDAPURL);
 
   Assert.ok(url.equals(url2));
 
-  url2 = url2.mutate().setSpec("ldap://localhost:389/dc=short??sub?(objectclass=*)").finalize();
+  url2 = url2
+    .mutate()
+    .setSpec("ldap://localhost:389/dc=short??sub?(objectclass=*)")
+    .finalize();
 
   Assert.ok(!url.equals(url2));
 
   // Test Attributes
 
   Assert.equal(url.attributes.length, 0);
 
   // Nothing should happen if the attribute doesn't exist
   url.removeAttribute("abc");
 
   Assert.equal(url.attributes.length, 0);
-  Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)"
+  );
 
   url.addAttribute("dn");
-  Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short?dn?one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" + portAdpt + "/dc=short?dn?one?(objectclass=*)"
+  );
 
   Assert.equal(url.attributes, "dn");
 
   url.removeAttribute("dn");
 
   Assert.equal(url.attributes.length, 0);
-  Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)"
+  );
 
   var newAttrs = "abc,def,ghi,jkl";
   url.attributes = newAttrs;
 
   Assert.equal(url.attributes, newAttrs);
-  Assert.equal(url.spec,
-               "ldap://localhost" + portAdpt + "/dc=short?" +
-               newAttrs + "?one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" +
+      portAdpt +
+      "/dc=short?" +
+      newAttrs +
+      "?one?(objectclass=*)"
+  );
 
   // Try adding an existing attribute - should do nothing
   url.addAttribute("def");
   Assert.equal(url.attributes, newAttrs);
 
   //  url.addAttribute("jk");
 
   Assert.ok(url.hasAttribute("jkl"));
@@ -254,44 +332,65 @@ function run_test() {
   url.removeAttribute("jk");
   url.removeAttribute("ef");
   Assert.equal(url.attributes, newAttrs);
 
   url.removeAttribute("abc");
   newAttrs = newAttrs.substring(4);
 
   Assert.equal(url.attributes, newAttrs);
-  Assert.equal(url.spec,
-               "ldap://localhost" + portAdpt + "/dc=short?" +
-               newAttrs + "?one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" +
+      portAdpt +
+      "/dc=short?" +
+      newAttrs +
+      "?one?(objectclass=*)"
+  );
 
   // This shouldn't fail, just clear the list
   url.attributes = "";
 
   Assert.equal(url.attributes.length, 0);
-  Assert.equal(url.spec, "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost" + portAdpt + "/dc=short??one?(objectclass=*)"
+  );
 
   // Set attributes via the url spec
 
   newAttrs = "abc,def,ghi,jkl";
-  url = url.mutate().setSpec("ldap://localhost/dc=short?" + newAttrs + "?one?(objectclass=*)")
-                    .finalize().QueryInterface(Ci.nsILDAPURL);
+  url = url
+    .mutate()
+    .setSpec("ldap://localhost/dc=short?" + newAttrs + "?one?(objectclass=*)")
+    .finalize()
+    .QueryInterface(Ci.nsILDAPURL);
 
   Assert.equal(url.attributes, newAttrs);
-  Assert.equal(url.spec,
-               "ldap://localhost/dc=short?" + newAttrs + "?one?(objectclass=*)");
+  Assert.equal(
+    url.spec,
+    "ldap://localhost/dc=short?" + newAttrs + "?one?(objectclass=*)"
+  );
 
-  url = url.mutate().setSpec("ldap://localhost/dc=short??one?(objectclass=*)")
-                    .finalize().QueryInterface(Ci.nsILDAPURL);
+  url = url
+    .mutate()
+    .setSpec("ldap://localhost/dc=short??one?(objectclass=*)")
+    .finalize()
+    .QueryInterface(Ci.nsILDAPURL);
 
   var attrs = url.attributes;
   Assert.equal(attrs.length, 0);
   Assert.equal(url.spec, "ldap://localhost/dc=short??one?(objectclass=*)");
 
   // Test - clone
 
-  url = url.mutate().setSpec("ldap://localhost/dc=short?abc,def,ghi,jkl?one?(objectclass=*)").finalize();
+  url = url
+    .mutate()
+    .setSpec("ldap://localhost/dc=short?abc,def,ghi,jkl?one?(objectclass=*)")
+    .finalize();
 
   var newUrl = url.mutate().finalize();
 
-  Assert.equal(newUrl.spec,
-               "ldap://localhost/dc=short?abc,def,ghi,jkl?one?(objectclass=*)");
+  Assert.equal(
+    newUrl.spec,
+    "ldap://localhost/dc=short?abc,def,ghi,jkl?one?(objectclass=*)"
+  );
 }