Merge inbound to m-c a=merge CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Wed, 16 Nov 2016 17:07:26 -0800
changeset 367856 c27117f67fa3ff30bbd34bcd6c7536c0d10bd4ad
parent 367686 830ce59e0a13e1e0544a1d36bff5f053ac315c21 (current diff)
parent 367855 8df58dfdea13c9c79975abb4e0c6514b1b4da5f6 (diff)
child 367857 13f49da109ea460665ad27c8497cb1489548450c
child 367870 e4334bf84ced87715b3c532a60f8613afcbb9d77
child 367930 e79cc7c6e7a711948f84c034ffd94e1b30e4f7fd
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge inbound to m-c a=merge CLOSED TREE
browser/base/content/test/urlbar/browser_urlbarTrimURLs.js
browser/components/migration/IEProfileMigrator.js
browser/components/search/content/search.xml
caps/tests/mochitest/test_app_principal_equality.html
dom/base/nsContentUtils.cpp
dom/browser-element/BrowserElementProxy.js
dom/browser-element/BrowserElementProxy.manifest
dom/browser-element/mochitest/browserElement_Proxy.js
dom/browser-element/mochitest/priority/test_Preallocated.html
dom/browser-element/mochitest/test_browserElement_inproc_Proxy.html
dom/browser-element/mochitest/test_browserElement_oop_Proxy.html
dom/html/test/test_img_complete.html
dom/imptests/failures/webapps/WebStorage/tests/submissions/Infraware/mochitest.ini
dom/imptests/failures/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_security.html.json
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_change_item_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_security_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_set_item_clear_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/local_set_item_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_change_item_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_set_item_clear_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/iframe/session_set_item_iframe.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_constructor.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_key.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_newvalue.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_oldvalue.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_storagearea.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_storageeventinit.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_local_url.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_key.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_newvalue.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_oldvalue.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_storagearea.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_storageeventinit.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_event_session_url.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_clear.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_getitem.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_key.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_length.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_removeitem.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_security.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_local_setitem.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_clear.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_getitem.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_key.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_length.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_removeitem.html
dom/imptests/webapps/WebStorage/tests/submissions/Infraware/test_storage_session_setitem.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/storage_builtins.js
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_event_constructor_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_missing_arguments.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_builtins.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_clear_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_getitem_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_in_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_index_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_length_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_removeitem_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_local_setitem_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_builtins.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_clear_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_getitem_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_in_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_index_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_length_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_removeitem_js.html
dom/imptests/webapps/WebStorage/tests/submissions/Ms2ger/test_storage_session_setitem_js.html
dom/indexedDB/test/file_app_isolation.html
dom/indexedDB/test/file_app_isolation.js
dom/indexedDB/test/test_app_isolation_inproc.html
dom/indexedDB/test/test_app_isolation_oop.html
dom/ipc/AppProcessChecker.cpp
dom/ipc/AppProcessChecker.h
dom/ipc/PreallocatedProcessManager.cpp
dom/ipc/PreallocatedProcessManager.h
dom/ipc/preload.js
dom/permission/tests/test_embed-apps.html
dom/webidl/BrowserElementProxy.webidl
dom/workers/test/script_bug1301094.js
gfx/2d/DrawTargetSkia.cpp
gfx/layers/ipc/GonkNativeHandle.cpp
gfx/layers/ipc/GonkNativeHandle.h
gfx/layers/ipc/GonkNativeHandleUtils.cpp
gfx/layers/ipc/GonkNativeHandleUtils.h
image/test/reftest/blob/blob-uri-with-ref-param-notref.html
image/test/reftest/blob/blob-uri-with-ref-param.html
image/test/reftest/blob/image.png
image/test/reftest/blob/reftest-stylo.list
image/test/reftest/blob/reftest.list
media/libcubeb/tests/common.h
media/libcubeb/tests/moz.build
media/libcubeb/tests/test_audio.cpp
media/libcubeb/tests/test_devices.cpp
media/libcubeb/tests/test_duplex.cpp
media/libcubeb/tests/test_latency.cpp
media/libcubeb/tests/test_record.cpp
media/libcubeb/tests/test_resampler.cpp
media/libcubeb/tests/test_sanity.cpp
media/libcubeb/tests/test_tone.cpp
media/libcubeb/tests/test_utils.cpp
media/webrtc/signaling/test/sdp_unittests.cpp
modules/libpref/init/all.js
netwerk/cookie/nsCookieService.cpp
netwerk/test/unit_ipc/child_app_offline_notifications.js
security/nss/cmd/pk11ectest/testvecs.h
security/nss/coreconf/pkg_config.py
security/nss/fuzz/Makefile
security/nss/fuzz/common.mk
security/nss/fuzz/libFuzzer/Makefile
security/nss/fuzz/libFuzzer/config.mk
security/nss/fuzz/libFuzzer/manifest.mn
security/nss/fuzz/manifest.mn
security/nss/fuzz/nssfuzz/Makefile
security/nss/fuzz/nssfuzz/cert_target.cc
security/nss/fuzz/nssfuzz/manifest.mn
security/nss/fuzz/nssfuzz/nssfuzz.cc
security/nss/fuzz/nssfuzz/pkcs8_target.cc
security/nss/fuzz/nssfuzz/registry.h
security/nss/fuzz/nssfuzz/shared.h
security/nss/fuzz/nssfuzz/spki_target.cc
security/nss/lib/freebl/mpi/mpi-test.c
security/nss/lib/freebl/mpi/test-info.c
security/nss/tests/run.sh
startupcache/test/TestStartupCacheTelemetry.js
startupcache/test/TestStartupCacheTelemetry.manifest
testing/web-platform/meta/dom/events/Event-subclasses-constructors.html.ini
toolkit/components/extensions/test/mochitest/test_ext_cookies_permissions.html
xpcom/components/nsNativeModuleLoader.cpp
xpcom/components/nsNativeModuleLoader.h
xpcom/tests/bug656331_component/TestComponent.cpp
xpcom/tests/bug656331_component/bug656331.manifest
xpcom/tests/bug656331_component/moz.build
xpcom/tests/component/TestComponent.cpp
xpcom/tests/component/moz.build
xpcom/tests/component/testcomponent.manifest
xpcom/tests/component_no_aslr/Makefile.in
xpcom/tests/component_no_aslr/TestComponent.cpp
xpcom/tests/component_no_aslr/moz.build
xpcom/tests/component_no_aslr/testcompnoaslr.manifest
xpcom/tests/unit/test_comp_no_aslr.js
xpcom/tests/unit/test_compmgr_warnings.js
--- a/.gdbinit
+++ b/.gdbinit
@@ -11,16 +11,17 @@ handle SIG32 noprint nostop pass
 handle SIG33 noprint nostop pass
 handle SIGPIPE noprint nostop pass
 
 # Don't stop for certain other signals where it's not useful,
 # such as the SIG64 signals triggered by the Linux
 # sandboxing code on older kernels.
 handle SIG38 noprint nostop pass
 handle SIG64 noprint nostop pass
+handle SIGSYS noprint nostop pass
 
 # Show the concrete types behind nsIFoo
 set print object on
 
 # run when using the auto-solib-add trick
 def prun
         tbreak main
         run
--- a/accessible/base/AccEvent.h
+++ b/accessible/base/AccEvent.h
@@ -46,20 +46,16 @@ public:
     //    This event will always be emitted. This flag is used for events that
     //    don't support coalescence.
     eAllowDupes,
 
      // eCoalesceReorder : For reorder events from the same subtree or the same
      //    node, only the umbrella event on the ancestor will be emitted.
     eCoalesceReorder,
 
-     // eCoalesceMutationTextChange : coalesce text change events caused by
-     // tree mutations of the same tree level.
-    eCoalesceMutationTextChange,
-
     // eCoalesceOfSameType : For events of the same type, only the newest event
     // will be processed.
     eCoalesceOfSameType,
 
     // eCoalesceSelectionChange: coalescence of selection change events.
     eCoalesceSelectionChange,
 
     // eCoalesceStateChange: coalesce state change events.
@@ -209,17 +205,17 @@ private:
 
 /**
  * Base class for show and hide accessible events.
  */
 class AccMutationEvent: public AccEvent
 {
 public:
   AccMutationEvent(uint32_t aEventType, Accessible* aTarget) :
-    AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceMutationTextChange)
+    AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceReorder)
   {
     // Don't coalesce these since they are coalesced by reorder event. Coalesce
     // contained text change events.
     mParent = mAccessible->Parent();
   }
   virtual ~AccMutationEvent() { }
 
   // Event
--- a/accessible/base/EventQueue.cpp
+++ b/accessible/base/EventQueue.cpp
@@ -85,21 +85,25 @@ void
 EventQueue::CoalesceEvents()
 {
   NS_ASSERTION(mEvents.Length(), "There should be at least one pending event!");
   uint32_t tail = mEvents.Length() - 1;
   AccEvent* tailEvent = mEvents[tail];
 
   switch(tailEvent->mEventRule) {
     case AccEvent::eCoalesceReorder:
-      MOZ_ASSERT(tailEvent->mAccessible->IsApplication() ||
-                 tailEvent->mAccessible->IsOuterDoc() ||
-                 tailEvent->mAccessible->IsXULTree(),
+    {
+      DebugOnly<Accessible*> target = tailEvent->mAccessible.get();
+      MOZ_ASSERT(target->IsApplication() ||
+                 target->IsOuterDoc() ||
+                 target->IsXULTree(),
                  "Only app or outerdoc accessible reorder events are in the queue");
+      MOZ_ASSERT(tailEvent->GetEventType() == nsIAccessibleEvent::EVENT_REORDER, "only reorder events should be queued");
       break; // case eCoalesceReorder
+    }
 
     case AccEvent::eCoalesceOfSameType:
     {
       // Coalesce old events by newer event.
       for (uint32_t index = tail - 1; index < tail; index--) {
         AccEvent* accEvent = mEvents[index];
         if (accEvent->mEventType == tailEvent->mEventType &&
           accEvent->mEventRule == tailEvent->mEventRule) {
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -2268,18 +2268,25 @@ DocAccessible::CacheChildrenInSubtree(Ac
 
 void
 DocAccessible::UncacheChildrenInSubtree(Accessible* aRoot)
 {
   aRoot->mStateFlags |= eIsNotInDocument;
   RemoveDependentIDsFor(aRoot);
 
   uint32_t count = aRoot->ContentChildCount();
-  for (uint32_t idx = 0; idx < count; idx++)
-    UncacheChildrenInSubtree(aRoot->ContentChildAt(idx));
+  for (uint32_t idx = 0; idx < count; idx++) {
+    Accessible* child = aRoot->ContentChildAt(idx);
+
+    // Removing this accessible from the document doesn't mean anything about
+    // accessibles for subdocuments, so skip removing those from the tree.
+    if (!child->IsDoc()) {
+      UncacheChildrenInSubtree(child);
+    }
+  }
 
   if (aRoot->IsNodeMapEntry() &&
       mNodeToAccessibleMap.Get(aRoot->GetNode()) == aRoot)
     mNodeToAccessibleMap.Remove(aRoot->GetNode());
 }
 
 void
 DocAccessible::ShutdownChildrenInSubtree(Accessible* aAccessible)
--- a/accessible/html/HTMLFormControlAccessible.cpp
+++ b/accessible/html/HTMLFormControlAccessible.cpp
@@ -346,18 +346,21 @@ HTMLTextFieldAccessible::Value(nsString&
 
   nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea(do_QueryInterface(mContent));
   if (textArea) {
     textArea->GetValue(aValue);
     return;
   }
 
   HTMLInputElement* input = HTMLInputElement::FromContent(mContent);
-  if (input)
-    input->GetValue(aValue);
+  if (input) {
+    // Pass NonSystem as the caller type, to be safe.  We don't expect to have a
+    // file input here.
+    input->GetValue(aValue, CallerType::NonSystem);
+  }
 }
 
 void
 HTMLTextFieldAccessible::ApplyARIAState(uint64_t* aState) const
 {
   HyperTextAccessibleWrap::ApplyARIAState(aState);
   aria::MapToState(aria::eARIAAutoComplete, mContent->AsElement(), aState);
 
@@ -547,17 +550,20 @@ HTMLSpinnerAccessible::NativeRole()
 
 void
 HTMLSpinnerAccessible::Value(nsString& aValue)
 {
   AccessibleWrap::Value(aValue);
   if (!aValue.IsEmpty())
     return;
 
-  HTMLInputElement::FromContent(mContent)->GetValue(aValue);
+  // Pass NonSystem as the caller type, to be safe.  We don't expect to have a
+  // file input here.
+  HTMLInputElement::FromContent(mContent)->GetValue(aValue,
+                                                    CallerType::NonSystem);
 }
 
 double
 HTMLSpinnerAccessible::MaxValue() const
 {
   double value = AccessibleWrap::MaxValue();
   if (!IsNaN(value))
     return value;
@@ -623,17 +629,20 @@ HTMLRangeAccessible::IsWidget() const
 
 void
 HTMLRangeAccessible::Value(nsString& aValue)
 {
   LeafAccessible::Value(aValue);
   if (!aValue.IsEmpty())
     return;
 
-  HTMLInputElement::FromContent(mContent)->GetValue(aValue);
+  // Pass NonSystem as the caller type, to be safe.  We don't expect to have a
+  // file input here.
+  HTMLInputElement::FromContent(mContent)->GetValue(aValue,
+                                                    CallerType::NonSystem);
 }
 
 double
 HTMLRangeAccessible::MaxValue() const
 {
   double value = LeafAccessible::MaxValue();
   if (!IsNaN(value))
     return value;
--- a/accessible/jsat/AccessFu.jsm
+++ b/accessible/jsat/AccessFu.jsm
@@ -337,19 +337,19 @@ this.AccessFu = { // jshint ignore:line
         }
         break;
       case 'Accessibility:MoveByGranularity':
         this.Input.moveByGranularity(JSON.parse(aData));
         break;
       case 'remote-browser-shown':
       case 'inprocess-browser-shown':
       {
-        // Ignore notifications that aren't from a BrowserOrApp
+        // Ignore notifications that aren't from a Browser
         let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader);
-        if (!frameLoader.ownerIsMozBrowserOrAppFrame) {
+        if (!frameLoader.ownerIsMozBrowserFrame) {
           return;
         }
         this._handleMessageManager(frameLoader.messageManager);
         break;
       }
     }
   },
 
--- a/accessible/tests/mochitest/events.js
+++ b/accessible/tests/mochitest/events.js
@@ -531,33 +531,52 @@ function eventQueue(aEventType)
         if (eventQueue.compareEvents(nextChecker, aEvent)) {
           this.processMatchedChecker(aEvent, nextChecker, scnIdx, eventSeq.idx);
           hasMatchedCheckers = true;
           continue;
         }
       }
 
       // Check if handled event matches any expected async events.
+      var haveUnmatchedAsync = false;
       for (idx = 0; idx < eventSeq.length; idx++) {
+        if (eventSeq[idx] instanceof orderChecker && haveUnmatchedAsync) {
+            break;
+        }
+
+        if (!eventSeq[idx].wasCaught) {
+          haveUnmatchedAsync = true;
+        }
+
         if (!eventSeq[idx].unexpected && eventSeq[idx].async) {
           if (eventQueue.compareEvents(eventSeq[idx], aEvent)) {
             this.processMatchedChecker(aEvent, eventSeq[idx], scnIdx, idx);
             hasMatchedCheckers = true;
             break;
           }
         }
       }
     }
 
     if (hasMatchedCheckers) {
       var invoker = this.getInvoker();
       if ("check" in invoker)
         invoker.check(aEvent);
     }
 
+    for (idx = 0; idx < eventSeq.length; idx++) {
+      if (!eventSeq[idx].wasCaught) {
+        if (eventSeq[idx] instanceof orderChecker) {
+          eventSeq[idx].wasCaught++;
+        } else {
+          break;
+        }
+      }
+    }
+
     // If we don't have more events to wait then schedule next invoker.
     if (this.hasMatchedScenario()) {
       if (this.mNextInvokerStatus == kInvokerNotScheduled) {
         this.processNextInvokerInTimeout();
 
       } else if (this.mNextInvokerStatus == kInvokerCanceled) {
         this.setInvokerStatus(kInvokerPending,
                               "Full match. Void the cancelation of next invoker processing");
@@ -591,33 +610,34 @@ function eventQueue(aEventType)
   {
     if (!("idx" in aEventSeq))
       aEventSeq.idx = 0;
 
     while (aEventSeq.idx < aEventSeq.length &&
            (aEventSeq[aEventSeq.idx].unexpected ||
             aEventSeq[aEventSeq.idx].todo ||
             aEventSeq[aEventSeq.idx].async ||
+            aEventSeq[aEventSeq.idx] instanceof orderChecker ||
             aEventSeq[aEventSeq.idx].wasCaught > 0)) {
       aEventSeq.idx++;
     }
 
     return aEventSeq.idx != aEventSeq.length ? aEventSeq[aEventSeq.idx] : null;
   }
 
   this.areExpectedEventsLeft =
     function eventQueue_areExpectedEventsLeft(aScenario)
   {
     function scenarioHasUnhandledExpectedEvent(aEventSeq)
     {
       // Check if we have unhandled async (can be anywhere in the sequance) or
       // sync expcected events yet.
       for (var idx = 0; idx < aEventSeq.length; idx++) {
         if (!aEventSeq[idx].unexpected && !aEventSeq[idx].todo &&
-            !aEventSeq[idx].wasCaught)
+            !aEventSeq[idx].wasCaught && !(aEventSeq[idx] instanceof orderChecker))
           return true;
       }
 
       return false;
     }
 
     if (aScenario)
       return scenarioHasUnhandledExpectedEvent(aScenario);
@@ -1675,16 +1695,25 @@ function invokerChecker(aEventType, aTar
     return prettyName(this.mTarget);
   }
 
   this.mTarget = aTargetOrFunc;
   this.mTargetFuncArg = aTargetFuncArg;
 }
 
 /**
+ * event checker that forces preceeding async events to happen before this
+ * checker.
+ */
+function orderChecker()
+{
+  this.__proto__ = new invokerChecker(null, null, null, false);
+}
+
+/**
  * Generic invoker checker for todo events.
  */
 function todo_invokerChecker(aEventType, aTargetOrFunc, aTargetFuncArg)
 {
   this.__proto__ = new invokerChecker(aEventType, aTargetOrFunc,
                                       aTargetFuncArg, true);
   this.todo = true;
 }
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -608,19 +608,16 @@ pref("dom.ipc.processPriorityManager.BAC
 // The kernel can only accept 6 (OomScoreAdjust, KillUnderKB) pairs. But it is
 // okay, kernel will still kill processes with larger OomScoreAdjust first even
 // its OomScoreAdjust don't have a corresponding KillUnderKB.
 
 pref("hal.processPriorityManager.gonk.MASTER.OomScoreAdjust", 0);
 pref("hal.processPriorityManager.gonk.MASTER.KillUnderKB", 4096);
 pref("hal.processPriorityManager.gonk.MASTER.cgroup", "");
 
-pref("hal.processPriorityManager.gonk.PREALLOC.OomScoreAdjust", 67);
-pref("hal.processPriorityManager.gonk.PREALLOC.cgroup", "apps/bg_non_interactive");
-
 pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.OomScoreAdjust", 67);
 pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.KillUnderKB", 5120);
 pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.cgroup", "apps/critical");
 
 pref("hal.processPriorityManager.gonk.FOREGROUND.OomScoreAdjust", 134);
 pref("hal.processPriorityManager.gonk.FOREGROUND.KillUnderKB", 6144);
 pref("hal.processPriorityManager.gonk.FOREGROUND.cgroup", "apps");
 
@@ -688,22 +685,16 @@ pref("gonk.notifyHardLowMemUnderKB", 143
 // placed above the BACKGROUND priority class.
 pref("gonk.notifySoftLowMemUnderKB", 43008);
 
 // We wait this long before polling the memory-pressure fd after seeing one
 // memory pressure event.  (When we're not under memory pressure, we sit
 // blocked on a poll(), and this pref has no effect.)
 pref("gonk.systemMemoryPressureRecoveryPollMS", 5000);
 
-// Enable pre-launching content processes for improved startup time
-// (hiding latency).
-pref("dom.ipc.processPrelaunch.enabled", true);
-// Wait this long before pre-launching a new subprocess.
-pref("dom.ipc.processPrelaunch.delayMs", 5000);
-
 pref("dom.ipc.reuse_parent_app", false);
 
 // When a process receives a system message, we hold a CPU wake lock on its
 // behalf for this many seconds, or until it handles the system message,
 // whichever comes first.
 pref("dom.ipc.systemMessageCPULockTimeoutSec", 30);
 
 // Ignore the "dialog=1" feature in window.open.
--- a/b2g/chrome/content/devtools/hud.js
+++ b/b2g/chrome/content/devtools/hud.js
@@ -31,35 +31,32 @@ XPCOMUtils.defineLazyGetter(this, 'Event
 XPCOMUtils.defineLazyGetter(this, 'PerformanceEntriesFront', function() {
   return devtools.require('devtools/server/actors/performance-entries').PerformanceEntriesFront;
 });
 
 XPCOMUtils.defineLazyGetter(this, 'MemoryFront', function() {
   return devtools.require('devtools/server/actors/memory').MemoryFront;
 });
 
-Cu.import('resource://gre/modules/Frames.jsm');
-
 var _telemetryDebug = false;
 
 function telemetryDebug(...args) {
   if (_telemetryDebug) {
     args.unshift('[AdvancedTelemetry]');
     console.log(...args);
   }
 }
 
 /**
  * The Developer HUD is an on-device developer tool that displays widgets,
  * showing visual debug information about apps. Each widget corresponds to a
  * metric as tracked by a metric watcher (e.g. consoleWatcher).
  */
 var developerHUD = {
 
-  _targets: new Map(),
   _histograms: new Set(),
   _customHistograms: new Set(),
   _client: null,
   _conn: null,
   _watchers: [],
   _logging: true,
   _telemetry: false,
 
@@ -94,23 +91,16 @@ var developerHUD = {
     this._client = new DebuggerClient(transport);
 
     for (let w of this._watchers) {
       if (w.init) {
         w.init(this._client);
       }
     }
 
-    Frames.addObserver(this);
-
-    let appFrames = Frames.list().filter(frame => frame.getAttribute('mozapp'));
-    for (let frame of appFrames) {
-      this.trackFrame(frame);
-    }
-
     SettingsListener.observe('hud.logging', this._logging, enabled => {
       this._logging = enabled;
     });
 
     SettingsListener.observe('hud.telemetry.logging', _telemetryDebug, enabled => {
       _telemetryDebug = enabled;
     });
 
@@ -119,73 +109,20 @@ var developerHUD = {
     });
   },
 
   uninit() {
     if (!this._client) {
       return;
     }
 
-    for (let frame of this._targets.keys()) {
-      this.untrackFrame(frame);
-    }
-
-    Frames.removeObserver(this);
-
     this._client.close();
     delete this._client;
   },
 
-  /**
-   * This method will ask all registered watchers to track and update metrics
-   * on an app frame.
-   */
-  trackFrame(frame) {
-    if (this._targets.has(frame)) {
-      return;
-    }
-
-    DebuggerServer.connectToChild(this._conn, frame).then(actor => {
-      let target = new Target(frame, actor);
-      this._targets.set(frame, target);
-
-      for (let w of this._watchers) {
-        w.trackTarget(target);
-      }
-    });
-  },
-
-  untrackFrame(frame) {
-    let target = this._targets.get(frame);
-    if (target) {
-      for (let w of this._watchers) {
-        w.untrackTarget(target);
-      }
-
-      target.destroy();
-      this._targets.delete(frame);
-    }
-  },
-
-  onFrameCreated(frame, isFirstAppFrame) {
-    let mozapp = frame.getAttribute('mozapp');
-    if (!mozapp) {
-      return;
-    }
-    this.trackFrame(frame);
-  },
-
-  onFrameDestroyed(frame, isLastAppFrame) {
-    let mozapp = frame.getAttribute('mozapp');
-    if (!mozapp) {
-      return;
-    }
-    this.untrackFrame(frame);
-  },
-
   log(message) {
     if (this._logging) {
       dump(DEVELOPER_HUD_LOG_PREFIX + ': ' + message + '\n');
     }
   }
 
 };
 
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -353,17 +353,16 @@ var shell = {
     // <html:iframe id="systemapp"
     //              mozbrowser="true" allowfullscreen="true"
     //              style="overflow: hidden; height: 100%; width: 100%; border: none;"
     //              src="data:text/html;charset=utf-8,%3C!DOCTYPE html>%3Cbody style='background:black;'>"/>
     let systemAppFrame =
       document.createElementNS('http://www.w3.org/1999/xhtml', 'html:iframe');
     systemAppFrame.setAttribute('id', 'systemapp');
     systemAppFrame.setAttribute('mozbrowser', 'true');
-    systemAppFrame.setAttribute('mozapp', manifestURL);
     systemAppFrame.setAttribute('allowfullscreen', 'true');
     systemAppFrame.setAttribute('src', 'blank.html');
     let container = document.getElementById('container');
 
     if (AppConstants.platform == 'macosx') {
       // See shell.html
       let hotfix = document.getElementById('placeholder');
       if (hotfix) {
--- a/b2g/chrome/content/shell_remote.js
+++ b/b2g/chrome/content/shell_remote.js
@@ -48,17 +48,16 @@ var remoteShell = {
     // <html:iframe id="this.id"
     //              mozbrowser="true"
     //              allowfullscreen="true"
     //              src="blank.html"/>
     let systemAppFrame =
       document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe");
     systemAppFrame.setAttribute("id", this.id);
     systemAppFrame.setAttribute("mozbrowser", "true");
-    systemAppFrame.setAttribute("mozapp", manifestURL);
     systemAppFrame.setAttribute("allowfullscreen", "true");
     systemAppFrame.setAttribute("src", "blank.html");
 
     let container = document.getElementById("container");
     this.contentBrowser = container.appendChild(systemAppFrame);
     this.contentBrowser.src = homeURL + window.location.hash;
 
     window.addEventListener("unload", this);
--- a/b2g/components/AlertsHelper.jsm
+++ b/b2g/components/AlertsHelper.jsm
@@ -35,18 +35,16 @@ XPCOMUtils.defineLazyGetter(this, "ppmm"
 });
 
 function debug(str) {
   //dump("=*= AlertsHelper.jsm : " + str + "\n");
 }
 
 const kNotificationIconSize = 128;
 
-const kDesktopNotificationPerm = "desktop-notification";
-
 const kNotificationSystemMessageName = "notification";
 
 const kDesktopNotification      = "desktop-notification";
 const kDesktopNotificationShow  = "desktop-notification-show";
 const kDesktopNotificationClick = "desktop-notification-click";
 const kDesktopNotificationClose = "desktop-notification-close";
 
 const kTopicAlertClickCallback = "alertclickcallback";
@@ -251,23 +249,16 @@ var AlertsHelper = {
   closeAlert: function(name) {
     SystemAppProxy._sendCustomEvent(kMozChromeNotificationEvent, {
       type: kDesktopNotificationClose,
       id: name
     });
   },
 
   receiveMessage: function(aMessage) {
-    if (!aMessage.target.assertAppHasPermission(kDesktopNotificationPerm)) {
-      Cu.reportError("Desktop-notification message " + aMessage.name +
-                     " from a content process with no " + kDesktopNotificationPerm +
-                     " privileges.");
-      return;
-    }
-
     switch(aMessage.name) {
       case kMessageAlertNotificationSend:
         this.showAlertNotification(aMessage);
         break;
 
       case kMessageAlertNotificationClose:
         this.closeAlert(aMessage.data.name);
         break;
--- a/b2g/components/DebuggerActors.js
+++ b/b2g/components/DebuggerActors.js
@@ -25,20 +25,17 @@ XPCOMUtils.defineLazyGetter(this, "Frame
 function B2GTabList(connection) {
   BrowserTabList.call(this, connection);
   this._listening = false;
 }
 
 B2GTabList.prototype = Object.create(BrowserTabList.prototype);
 
 B2GTabList.prototype._getBrowsers = function() {
-  return Frames.list().filter(frame => {
-    // Ignore app frames
-    return !frame.getAttribute("mozapp");
-  });
+  return Frames.list();
 };
 
 B2GTabList.prototype._getSelectedBrowser = function() {
   return this._getBrowsers().find(frame => {
     // Find the one visible browser (if any)
     return !frame.classList.contains("hidden");
   });
 };
@@ -54,30 +51,20 @@ B2GTabList.prototype._listenForEventsIf 
   if (this._listening != shouldListen) {
     let op = shouldListen ? "addObserver" : "removeObserver";
     Frames[op](this);
     this._listening = shouldListen;
   }
 };
 
 B2GTabList.prototype.onFrameCreated = function(frame) {
-  let mozapp = frame.getAttribute("mozapp");
-  if (mozapp) {
-    // Ignore app frames
-    return;
-  }
   this._notifyListChanged();
   this._checkListening();
 };
 
 B2GTabList.prototype.onFrameDestroyed = function(frame) {
-  let mozapp = frame.getAttribute("mozapp");
-  if (mozapp) {
-    // Ignore app frames
-    return;
-  }
   let actor = this._actorByBrowser.get(frame);
   if (actor) {
     this._handleActorClose(actor, frame);
   }
 };
 
 exports.B2GTabList = B2GTabList;
--- a/b2g/components/ErrorPage.jsm
+++ b/b2g/components/ErrorPage.jsm
@@ -171,17 +171,17 @@ var ErrorPage = {
 
   init: function errorPageInit() {
     Services.obs.addObserver(this, 'inprocess-browser-shown', false);
     Services.obs.addObserver(this, 'remote-browser-shown', false);
   },
 
   observe: function errorPageObserve(aSubject, aTopic, aData) {
     let frameLoader = aSubject.QueryInterface(Ci.nsIFrameLoader);
-    // Ignore notifications that aren't from a BrowserOrApp
-    if (!frameLoader.ownerIsMozBrowserOrAppFrame) {
+    // Ignore notifications that aren't from a Browser
+    if (!frameLoader.ownerIsMozBrowserFrame) {
       return;
     }
     this._listenError(frameLoader);
   }
 };
 
 ErrorPage.init();
--- a/b2g/components/Frames.jsm
+++ b/b2g/components/Frames.jsm
@@ -14,40 +14,32 @@ Cu.import('resource://gre/modules/System
 
 const listeners = [];
 
 const Observer = {
   // Save a map of (MessageManager => Frame) to be able to dispatch
   // the FrameDestroyed event with a frame reference.
   _frames: new Map(),
 
-  // Also save current number of iframes opened by app
-  _apps: new Map(),
-
   start: function () {
     Services.obs.addObserver(this, 'remote-browser-shown', false);
     Services.obs.addObserver(this, 'inprocess-browser-shown', false);
     Services.obs.addObserver(this, 'message-manager-close', false);
 
     SystemAppProxy.getFrames().forEach(frame => {
       let mm = frame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager;
       this._frames.set(mm, frame);
-      let mozapp = frame.getAttribute('mozapp');
-      if (mozapp) {
-        this._apps.set(mozapp, (this._apps.get(mozapp) || 0) + 1);
-      }
     });
   },
 
   stop: function () {
     Services.obs.removeObserver(this, 'remote-browser-shown');
     Services.obs.removeObserver(this, 'inprocess-browser-shown');
     Services.obs.removeObserver(this, 'message-manager-close');
     this._frames.clear();
-    this._apps.clear();
   },
 
   observe: function (subject, topic, data) {
     switch(topic) {
 
       // Listen for frame creation in OOP (device) as well as in parent process (b2g desktop)
       case 'remote-browser-shown':
       case 'inprocess-browser-shown':
@@ -65,54 +57,38 @@ const Observer = {
         this.onMessageManagerDestroyed(subject);
         break;
     }
   },
 
   onMessageManagerCreated: function (mm, frame) {
     this._frames.set(mm, frame);
 
-    let isFirstAppFrame = null;
-    let mozapp = frame.getAttribute('mozapp');
-    if (mozapp) {
-      let count = (this._apps.get(mozapp) || 0) + 1;
-      this._apps.set(mozapp, count);
-      isFirstAppFrame = (count === 1);
-    }
-
     listeners.forEach(function (listener) {
       try {
-        listener.onFrameCreated(frame, isFirstAppFrame);
+        listener.onFrameCreated(frame);
       } catch(e) {
         dump('Exception while calling Frames.jsm listener:' + e + '\n' +
              e.stack + '\n');
       }
     });
   },
 
   onMessageManagerDestroyed: function (mm) {
     let frame = this._frames.get(mm);
     if (!frame) {
       // We received an event for an unknown message manager
       return;
     }
 
     this._frames.delete(mm);
 
-    let isLastAppFrame = null;
-    let mozapp = frame.getAttribute('mozapp');
-    if (mozapp) {
-      let count = (this._apps.get(mozapp) || 0) - 1;
-      this._apps.set(mozapp, count);
-      isLastAppFrame = (count === 0);
-    }
-
     listeners.forEach(function (listener) {
       try {
-        listener.onFrameDestroyed(frame, isLastAppFrame);
+        listener.onFrameDestroyed(frame);
       } catch(e) {
         dump('Exception while calling Frames.jsm listener:' + e + '\n' +
              e.stack + '\n');
       }
     });
   }
 
 };
--- a/b2g/components/SafeMode.jsm
+++ b/b2g/components/SafeMode.jsm
@@ -71,17 +71,16 @@ this.SafeMode = {
     let document = SafeMode.window.document;
     SafeMode.window.screen.mozLockOrientation("portrait");
 
     let url = Services.io.newURI(shell.homeURL, null, null)
                          .resolve(kSafeModePage);
     debug("Registry is ready, loading " + url);
     let frame = document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe");
     frame.setAttribute("mozbrowser", "true");
-    frame.setAttribute("mozapp", shell.manifestURL);
     frame.setAttribute("id", "systemapp"); // To keep screen.js happy.
     let contentBrowser = document.body.appendChild(frame);
 
     return new Promise((aResolve, aReject) => {
       let content = contentBrowser.contentWindow;
 
       // Stripped down version of the system app bootstrap.
       function handleEvent(e) {
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -326,18 +326,16 @@
 @RESPATH@/components/xultmpl.xpt
 @RESPATH@/components/zipwriter.xpt
 
 ; JavaScript components
 @RESPATH@/components/ConsoleAPI.manifest
 @RESPATH@/components/ConsoleAPIStorage.js
 @RESPATH@/components/BrowserElementParent.manifest
 @RESPATH@/components/BrowserElementParent.js
-@RESPATH@/components/BrowserElementProxy.manifest
-@RESPATH@/components/BrowserElementProxy.js
 @RESPATH@/components/PhoneNumberService.js
 @RESPATH@/components/PhoneNumberService.manifest
 @RESPATH@/components/NotificationStorage.js
 @RESPATH@/components/NotificationStorage.manifest
 @RESPATH@/components/PermissionSettings.js
 @RESPATH@/components/PermissionSettings.manifest
 @RESPATH@/components/PermissionPromptService.js
 @RESPATH@/components/PermissionPromptService.manifest
--- a/b2g/simulator/custom-prefs.js
+++ b/b2g/simulator/custom-prefs.js
@@ -1,8 +1,7 @@
 user_pref("devtools.debugger.prompt-connection", false);
 user_pref("devtools.debugger.forbid-certified-apps", false);
-user_pref("devtools.apps.forbidden-permissions", "");
 user_pref("b2g.software-buttons", true);
 
 // Required for Mulet in order to run the debugger server from the command line
 user_pref("devtools.debugger.remote-enabled", true);
 user_pref("devtools.chrome.enabled", true);
--- a/browser/.eslintrc.js
+++ b/browser/.eslintrc.js
@@ -5,11 +5,12 @@ module.exports = {
     "../toolkit/.eslintrc.js"
   ],
 
   "rules": {
     "no-unused-vars": ["error", {
       "vars": "local",
       "varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS",
       "args": "none",
-    }]
+    }],
+    "no-shadow": "error"
   }
 };
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -18,16 +18,25 @@ endif
 endif
 
 # This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
 # shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
 NSDISTMODE = copy
 
 include $(topsrcdir)/config/config.mk
 
+# If we are trying to show an error dialog about the lack of SSE2 support,
+# make sure that code itself doesn't use SSE2.
+ifdef MOZ_LINUX_32_SSE2_STARTUP_ERROR
+CXXFLAGS := $(filter-out -march=% -msse -msse2 -mfpmath=sse,$(CXXFLAGS))
+CXX := $(filter-out -march=% -msse -msse2 -mfpmath=sse,$(CXX))
+CXXFLAGS += -mno-sse -mno-sse2 -mfpmath=387
+CXX += -march=pentiumpro
+endif
+
 ifeq ($(OS_ARCH),WINNT)
 # Rebuild firefox.exe if the manifest changes - it's included by splash.rc.
 # (this dependency should really be just for firefox.exe, not other targets)
 # Note the manifest file exists in the tree, so we use the explicit filename
 # here.
 EXTRA_DEPS += firefox.exe.manifest
 endif
 
--- a/browser/app/moz.build
+++ b/browser/app/moz.build
@@ -81,11 +81,14 @@ if CONFIG['MOZ_LINKER']:
     OS_LIBS += CONFIG['MOZ_ZLIB_LIBS']
 
 if CONFIG['HAVE_CLOCK_MONOTONIC']:
     OS_LIBS += CONFIG['REALTIME_LIBS']
 
 if CONFIG['MOZ_GPSD']:
     DEFINES['MOZ_GPSD'] = True
 
+if CONFIG['MOZ_LINUX_32_SSE2_STARTUP_ERROR']:
+    DEFINES['MOZ_LINUX_32_SSE2_STARTUP_ERROR'] = True
+
 for icon in ('firefox', 'document', 'newwindow', 'newtab', 'pbmode'):
     DEFINES[icon.upper() + '_ICO'] = '"%s/dist/branding/%s.ico"' % (
         TOPOBJDIR, icon)
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -38,16 +38,62 @@
 #include "BinaryPath.h"
 
 #include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
 
 #include "mozilla/Sprintf.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/WindowsDllBlocklist.h"
 
+#ifdef MOZ_LINUX_32_SSE2_STARTUP_ERROR
+#include <cpuid.h>
+#include "mozilla/Unused.h"
+
+static bool
+IsSSE2Available()
+{
+  // The rest of the app has been compiled to assume that SSE2 is present
+  // unconditionally, so we can't use the normal copy of SSE.cpp here.
+  // Since SSE.cpp caches the results and we need them only transiently,
+  // instead of #including SSE.cpp here, let's just inline the specific check
+  // that's needed.
+  unsigned int level = 1u;
+  unsigned int eax, ebx, ecx, edx;
+  unsigned int bits = (1u<<26);
+  unsigned int max = __get_cpuid_max(0, nullptr);
+  if (level > max) {
+    return false;
+  }
+  __cpuid_count(level, 0, eax, ebx, ecx, edx);
+  return (edx & bits) == bits;
+}
+
+static const char sSSE2Message[] =
+    "This browser version requires a processor with the SSE2 instruction "
+    "set extension.\nYou may be able to obtain a version that does not "
+    "require SSE2 from your Linux distribution.\n";
+
+__attribute__((constructor))
+static void
+SSE2Check()
+{
+  if (IsSSE2Available()) {
+    return;
+  }
+  // Using write() in order to avoid jemalloc-based buffering. Ignoring return
+  // values, since there isn't much we could do on failure and there is no
+  // point in trying to recover from errors.
+  MOZ_UNUSED(write(STDERR_FILENO,
+                   sSSE2Message,
+                   MOZ_ARRAY_LENGTH(sSSE2Message) - 1));
+  // _exit() instead of exit() to avoid running the usual "at exit" code.
+  _exit(255);
+}
+#endif
+
 #if !defined(MOZ_WIDGET_COCOA) && !defined(MOZ_WIDGET_ANDROID) \
   && !(defined(XP_LINUX) && defined(MOZ_SANDBOX))
 #define MOZ_BROWSER_CAN_BE_CONTENTPROC
 #include "../../ipc/contentproc/plugin-container.cpp"
 #endif
 
 using namespace mozilla;
 
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -431,18 +431,16 @@ pref("browser.tabs.drawInTitlebar", true
 // true   return to the tab that opened this tab (its owner)
 // false  return to the adjacent tab (old default)
 pref("browser.tabs.selectOwnerOnClose", true);
 
 pref("browser.tabs.showAudioPlayingIcon", true);
 // This should match Chromium's audio indicator delay.
 pref("browser.tabs.delayHidingAudioPlayingIconMS", 3000);
 
-pref("browser.tabs.dontfocusfordialogs", true);
-
 pref("browser.ctrlTab.previews", false);
 
 // By default, do not export HTML at shutdown.
 // If true, at shutdown the bookmarks in your menu and toolbar will
 // be exported as HTML to the bookmarks.html file.
 pref("browser.bookmarks.autoExportHTML",          false);
 
 // The maximum number of daily bookmark backups to
--- a/browser/base/content/aboutDialog-appUpdater.js
+++ b/browser/base/content/aboutDialog-appUpdater.js
@@ -362,17 +362,17 @@ appUpdater.prototype =
     case Components.results.NS_BINDING_ABORTED:
       // Do not remove UI listener since the user may resume downloading again.
       break;
     case Components.results.NS_OK:
       this.removeDownloadListener();
       if (this.backgroundUpdateEnabled) {
         this.selectPanel("applying");
         let self = this;
-        Services.obs.addObserver(function (aSubject, aTopic, aData) {
+        Services.obs.addObserver(function(aSubject, aTopic, aData) {
           // Update the UI when the background updater is finished
           let status = aData;
           if (status == "applied" || status == "applied-service" ||
               status == "pending" || status == "pending-service" ||
               status == "pending-elevate") {
             // If the update is successfully applied, or if the updater has
             // fallen back to non-staged updates, show the "Restart to Update"
             // button.
--- a/browser/base/content/aboutNetError.xhtml
+++ b/browser/base/content/aboutNetError.xhtml
@@ -179,24 +179,24 @@
           // error code link in the advanced panel.
           var div = document.getElementById("certificateErrorDebugInformation");
           div.style.display = "none";
         }
 
         document.getElementById("learnMoreContainer").style.display = "block";
 
         var checkbox = document.getElementById("automaticallyReportInFuture");
-        checkbox.addEventListener("change", function ({target: {checked}}) {
+        checkbox.addEventListener("change", function({target: {checked}}) {
           document.dispatchEvent(new CustomEvent("AboutNetErrorSetAutomatic", {
             detail: checked,
             bubbles: true
           }));
         });
 
-        addEventListener("AboutNetErrorOptions", function (event) {
+        addEventListener("AboutNetErrorOptions", function(event) {
           var options = JSON.parse(event.detail);
           if (options && options.enabled) {
             // Display error reporting UI
             document.getElementById("certificateErrorReporting").style.display = "block";
 
             // set the checkbox
             checkbox.checked = !!options.automatic;
           }
@@ -254,17 +254,17 @@
         var ld = document.getElementById("errorLongDesc");
         if (ld)
         {
           ld.innerHTML = errDesc.innerHTML;
         }
 
         if (err == "sslv3Used") {
           document.getElementById("learnMoreContainer").style.display = "block";
-          var learnMoreLink = document.getElementById("learnMoreLink");
+          let learnMoreLink = document.getElementById("learnMoreLink");
           learnMoreLink.href = "https://support.mozilla.org/kb/how-resolve-sslv3-error-messages-firefox";
           document.body.className = "certerror";
         }
 
         if (err == "weakCryptoUsed") {
           document.body.className = "certerror";
         }
 
@@ -300,17 +300,17 @@
           // almost certainly useless. (Bug 553180)
           document.getElementById("netErrorButtonContainer").style.display = "none";
         }
 
         window.addEventListener("AboutNetErrorOptions", function(evt) {
         // Pinning errors are of type nssFailure2
           if (getErrorCode() == "nssFailure2" || getErrorCode() == "weakCryptoUsed") {
             document.getElementById("learnMoreContainer").style.display = "block";
-            var learnMoreLink = document.getElementById("learnMoreLink");
+            let learnMoreLink = document.getElementById("learnMoreLink");
             // nssFailure2 also gets us other non-overrideable errors. Choose
             // a "learn more" link based on description:
             if (getDescription().includes("mozilla_pkix_error_key_pinning_failure")) {
               learnMoreLink.href = "https://support.mozilla.org/kb/certificate-pinning-reports";
             }
             if (getErrorCode() == "weakCryptoUsed") {
               learnMoreLink.href = "https://support.mozilla.org/kb/how-resolve-weak-crypto-error-messages-firefox";
             }
@@ -319,19 +319,20 @@
             if (options && options.enabled) {
               var checkbox = document.getElementById("automaticallyReportInFuture");
               showCertificateErrorReporting();
               if (options.automatic) {
                 // set the checkbox
                 checkbox.checked = true;
               }
 
-              checkbox.addEventListener("change", function(evt) {
+              checkbox.addEventListener("change", function(changeEvt) {
                   var event = new CustomEvent("AboutNetErrorSetAutomatic",
-                    {bubbles:true, detail:evt.target.checked});
+                    {bubbles: true,
+                     detail: changeEvt.target.checked});
                   document.dispatchEvent(event);
                 }, false);
             }
             const hasPrefStyleError = [
               "interrupted", // This happens with subresources that are above the max tls
               "SSL_ERROR_PROTOCOL_VERSION_ALERT",
               "SSL_ERROR_UNSUPPORTED_VERSION",
               "SSL_ERROR_NO_CYPHER_OVERLAP",
--- a/browser/base/content/aboutaccounts/aboutaccounts.js
+++ b/browser/base/content/aboutaccounts/aboutaccounts.js
@@ -24,20 +24,16 @@ const OBSERVER_TOPICS = [
   fxAccountsCommon.ONVERIFIED_NOTIFICATION,
   fxAccountsCommon.ONLOGOUT_NOTIFICATION,
 ];
 
 function log(msg) {
   // dump("FXA: " + msg + "\n");
 }
 
-function error(msg) {
-  console.log("Firefox Account Error: " + msg + "\n");
-}
-
 function getPreviousAccountNameHash() {
   try {
     return Services.prefs.getComplexValue(PREF_LAST_FXA_USER, Ci.nsISupportsString).data;
   } catch (_) {
     return "";
   }
 }
 
@@ -100,17 +96,17 @@ function updateDisplayedEmail(user) {
   if (emailDiv && user) {
     emailDiv.textContent = user.email;
   }
 }
 
 var wrapper = {
   iframe: null,
 
-  init: function (url, urlParams) {
+  init: function(url, urlParams) {
     // If a master-password is enabled, we want to encourage the user to
     // unlock it.  Things still work if not, but the user will probably need
     // to re-auth next startup (in which case we will get here again and
     // re-prompt)
     Utils.ensureMPUnlocked();
 
     let iframe = document.getElementById("remote");
     this.iframe = iframe;
@@ -129,17 +125,17 @@ var wrapper = {
     this.url = url;
     // Set the iframe's location with loadURI/LOAD_FLAGS_REPLACE_HISTORY to
     // avoid having a new history entry being added. REPLACE_HISTORY is used
     // to replace the current entry, which is `about:blank`.
     let webNav = iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
     webNav.loadURI(url, Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY, null, null, null);
   },
 
-  retry: function () {
+  retry: function() {
     let webNav = this.iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
     webNav.loadURI(this.url, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, null, null);
   },
 
   iframeListener: {
     QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
                                          Ci.nsISupportsWeakReference,
                                          Ci.nsISupports]),
@@ -175,17 +171,17 @@ var wrapper = {
       }
     },
 
     onProgressChange: function() {},
     onStatusChange: function() {},
     onSecurityChange: function() {},
   },
 
-  handleEvent: function (evt) {
+  handleEvent: function(evt) {
     switch (evt.type) {
       case "load":
         this.iframe.contentWindow.addEventListener("FirefoxAccountsCommand", this);
         this.iframe.removeEventListener("load", this);
         break;
       case "FirefoxAccountsCommand":
         this.handleRemoteCommand(evt);
         break;
@@ -193,17 +189,17 @@ var wrapper = {
   },
 
   /**
    * onLogin handler receives user credentials from the jelly after a
    * sucessful login and stores it in the fxaccounts service
    *
    * @param accountData the user's account data and credentials
    */
-  onLogin: function (accountData) {
+  onLogin: function(accountData) {
     log("Received: 'login'. Data:" + JSON.stringify(accountData));
 
     if (accountData.customizeSync) {
       Services.prefs.setBoolPref(PREF_SYNC_SHOW_CUSTOMIZATION, true);
     }
     delete accountData.customizeSync;
     // sessionTokenContext is erroneously sent by the content server.
     // https://github.com/mozilla/fxa-content-server/issues/2766
@@ -259,26 +255,26 @@ var wrapper = {
     // We need to confirm a relink - see shouldAllowRelink for more
     let ok = shouldAllowRelink(accountData.email);
     this.injectData("message", { status: "can_link_account", data: { ok: ok } });
   },
 
   /**
    * onSignOut handler erases the current user's session from the fxaccounts service
    */
-  onSignOut: function () {
+  onSignOut: function() {
     log("Received: 'sign_out'.");
 
     fxAccounts.signOut().then(
       () => this.injectData("message", { status: "sign_out" }),
       (err) => this.injectData("message", { status: "error", error: err })
     );
   },
 
-  handleRemoteCommand: function (evt) {
+  handleRemoteCommand: function(evt) {
     log('command: ' + evt.detail.command);
     let data = evt.detail.data;
 
     switch (evt.detail.command) {
       case "login":
         this.onLogin(data);
         break;
       case "can_link_account":
@@ -288,17 +284,17 @@ var wrapper = {
         this.onSignOut(data);
         break;
       default:
         log("Unexpected remote command received: " + evt.detail.command + ". Ignoring command.");
         break;
     }
   },
 
-  injectData: function (type, content) {
+  injectData: function(type, content) {
     return fxAccounts.promiseAccountsSignUpURI().then(authUrl => {
       let data = {
         type: type,
         content: content
       };
       this.iframe.contentWindow.postMessage(data, authUrl);
     })
     .catch(e => {
--- a/browser/base/content/abouthealthreport/abouthealth.js
+++ b/browser/base/content/abouthealthreport/abouthealth.js
@@ -10,111 +10,111 @@ Cu.import("resource://gre/modules/Prefer
 Cu.import("resource://gre/modules/Services.jsm");
 
 const prefs = new Preferences("datareporting.healthreport.");
 
 const PREF_UNIFIED = "toolkit.telemetry.unified";
 const PREF_REPORTING_URL = "datareporting.healthreport.about.reportUrl";
 
 var healthReportWrapper = {
-  init: function () {
+  init: function() {
     let iframe = document.getElementById("remote-report");
     iframe.addEventListener("load", healthReportWrapper.initRemotePage, false);
     iframe.src = this._getReportURI().spec;
     prefs.observe("uploadEnabled", this.updatePrefState, healthReportWrapper);
   },
 
-  uninit: function () {
+  uninit: function() {
     prefs.ignore("uploadEnabled", this.updatePrefState, healthReportWrapper);
   },
 
-  _getReportURI: function () {
+  _getReportURI: function() {
     let url = Services.urlFormatter.formatURLPref(PREF_REPORTING_URL);
     return Services.io.newURI(url, null, null);
   },
 
-  setDataSubmission: function (enabled) {
+  setDataSubmission: function(enabled) {
     MozSelfSupport.healthReportDataSubmissionEnabled = enabled;
     this.updatePrefState();
   },
 
-  updatePrefState: function () {
+  updatePrefState: function() {
     try {
-      let prefs = {
+      let prefsObj = {
         enabled: MozSelfSupport.healthReportDataSubmissionEnabled,
       };
-      healthReportWrapper.injectData("prefs", prefs);
+      healthReportWrapper.injectData("prefs", prefsObj);
     }
     catch (ex) {
       healthReportWrapper.reportFailure(healthReportWrapper.ERROR_PREFS_FAILED);
     }
   },
 
-  sendTelemetryPingList: function () {
+  sendTelemetryPingList: function() {
     console.log("AboutHealthReport: Collecting Telemetry ping list.");
     MozSelfSupport.getTelemetryPingList().then((list) => {
       console.log("AboutHealthReport: Sending Telemetry ping list.");
       this.injectData("telemetry-ping-list", list);
     }).catch((ex) => {
       console.log("AboutHealthReport: Collecting ping list failed: " + ex);
     });
   },
 
-  sendTelemetryPingData: function (pingId) {
+  sendTelemetryPingData: function(pingId) {
     console.log("AboutHealthReport: Collecting Telemetry ping data.");
     MozSelfSupport.getTelemetryPing(pingId).then((ping) => {
       console.log("AboutHealthReport: Sending Telemetry ping data.");
       this.injectData("telemetry-ping-data", {
         id: pingId,
         pingData: ping,
       });
     }).catch((ex) => {
       console.log("AboutHealthReport: Loading ping data failed: " + ex);
       this.injectData("telemetry-ping-data", {
         id: pingId,
         error: "error-generic",
       });
     });
   },
 
-  sendCurrentEnvironment: function () {
+  sendCurrentEnvironment: function() {
     console.log("AboutHealthReport: Sending Telemetry environment data.");
     MozSelfSupport.getCurrentTelemetryEnvironment().then((environment) => {
       this.injectData("telemetry-current-environment-data", environment);
     }).catch((ex) => {
       console.log("AboutHealthReport: Collecting current environment data failed: " + ex);
     });
   },
 
-  sendCurrentPingData: function () {
+  sendCurrentPingData: function() {
     console.log("AboutHealthReport: Sending current Telemetry ping data.");
     MozSelfSupport.getCurrentTelemetrySubsessionPing().then((ping) => {
       this.injectData("telemetry-current-ping-data", ping);
     }).catch((ex) => {
       console.log("AboutHealthReport: Collecting current ping data failed: " + ex);
     });
   },
 
-  injectData: function (type, content) {
+  injectData: function(type, content) {
     let report = this._getReportURI();
 
     // file URIs can't be used for targetOrigin, so we use "*" for this special case
     // in all other cases, pass in the URL to the report so we properly restrict the message dispatch
     let reportUrl = report.scheme == "file" ? "*" : report.spec;
 
     let data = {
       type: type,
       content: content
     }
 
     let iframe = document.getElementById("remote-report");
     iframe.contentWindow.postMessage(data, reportUrl);
   },
 
-  handleRemoteCommand: function (evt) {
+  handleRemoteCommand: function(evt) {
     // Do an origin check to harden against the frame content being loaded from unexpected locations.
     let allowedPrincipal = Services.scriptSecurityManager.getCodebasePrincipal(this._getReportURI());
     let targetPrincipal = evt.target.nodePrincipal;
     if (!allowedPrincipal.equals(targetPrincipal)) {
       Cu.reportError(`Origin check failed for message "${evt.detail.command}": ` +
                      `target origin is "${targetPrincipal.origin}", expected "${allowedPrincipal.origin}"`);
       return;
     }
@@ -142,39 +142,39 @@ var healthReportWrapper = {
         this.sendCurrentPingData();
         break;
       default:
         Cu.reportError("Unexpected remote command received: " + evt.detail.command + ". Ignoring command.");
         break;
     }
   },
 
-  initRemotePage: function () {
+  initRemotePage: function() {
     let iframe = document.getElementById("remote-report").contentDocument;
     iframe.addEventListener("RemoteHealthReportCommand",
                             function onCommand(e) { healthReportWrapper.handleRemoteCommand(e); },
                             false);
     healthReportWrapper.updatePrefState();
   },
 
   // error handling
   ERROR_INIT_FAILED:    1,
   ERROR_PAYLOAD_FAILED: 2,
   ERROR_PREFS_FAILED:   3,
 
-  reportFailure: function (error) {
+  reportFailure: function(error) {
     let details = {
       errorType: error,
     }
     healthReportWrapper.injectData("error", details);
   },
 
-  handleInitFailure: function () {
+  handleInitFailure: function() {
     healthReportWrapper.reportFailure(healthReportWrapper.ERROR_INIT_FAILED);
   },
 
-  handlePayloadFailure: function () {
+  handlePayloadFailure: function() {
     healthReportWrapper.reportFailure(healthReportWrapper.ERROR_PAYLOAD_FAILED);
   },
 }
 
-window.addEventListener("load", function () { healthReportWrapper.init(); });
-window.addEventListener("unload", function () { healthReportWrapper.uninit(); });
+window.addEventListener("load", function() { healthReportWrapper.init(); });
+window.addEventListener("unload", function() { healthReportWrapper.uninit(); });
--- a/browser/base/content/abouthome/aboutHome.js
+++ b/browser/base/content/abouthome/aboutHome.js
@@ -22,33 +22,33 @@ const SNIPPETS_UPDATE_INTERVAL_MS = 1440
 const DATABASE_NAME = "abouthome";
 const DATABASE_VERSION = 1;
 const DATABASE_STORAGE = "persistent";
 const SNIPPETS_OBJECTSTORE_NAME = "snippets";
 var searchText;
 
 // This global tracks if the page has been set up before, to prevent double inits
 var gInitialized = false;
-var gObserver = new MutationObserver(function (mutations) {
+var gObserver = new MutationObserver(function(mutations) {
   for (let mutation of mutations) {
     // The addition of the restore session button changes our width:
     if (mutation.attributeName == "session") {
       fitToWidth();
     }
     if (mutation.attributeName == "snippetsVersion") {
       if (!gInitialized) {
         ensureSnippetsMapThen(loadSnippets);
         gInitialized = true;
       }
       return;
     }
   }
 });
 
-window.addEventListener("pageshow", function () {
+window.addEventListener("pageshow", function() {
   // Delay search engine setup, cause browser.js::BrowserOnAboutPageLoad runs
   // later and may use asynchronous getters.
   window.gObserver.observe(document.documentElement, { attributes: true });
   window.gObserver.observe(document.getElementById("launcher"), { attributes: true });
   fitToWidth();
   setupSearch();
   window.addEventListener("resize", fitToWidth);
 
@@ -113,96 +113,96 @@ function ensureSnippetsMapThen(aCallback
 
   // Handle multiple requests during the async initialization.
   gSnippetsMapCallbacks.push(aCallback);
   if (gSnippetsMapCallbacks.length > 1) {
     // We are already updating, the callbacks will be invoked when done.
     return;
   }
 
-  let invokeCallbacks = function () {
+  let invokeCallbacks = function() {
     if (!gSnippetsMap) {
       gSnippetsMap = Object.freeze(new Map());
     }
 
     for (let callback of gSnippetsMapCallbacks) {
       callback(gSnippetsMap);
     }
     gSnippetsMapCallbacks.length = 0;
   }
 
   let openRequest = indexedDB.open(DATABASE_NAME, {version: DATABASE_VERSION,
                                                    storage: DATABASE_STORAGE});
 
-  openRequest.onerror = function (event) {
+  openRequest.onerror = function(event) {
     // Try to delete the old database so that we can start this process over
     // next time.
     indexedDB.deleteDatabase(DATABASE_NAME);
     invokeCallbacks();
   };
 
-  openRequest.onupgradeneeded = function (event) {
+  openRequest.onupgradeneeded = function(event) {
     let db = event.target.result;
     if (!db.objectStoreNames.contains(SNIPPETS_OBJECTSTORE_NAME)) {
       db.createObjectStore(SNIPPETS_OBJECTSTORE_NAME);
     }
   }
 
-  openRequest.onsuccess = function (event) {
+  openRequest.onsuccess = function(event) {
     let db = event.target.result;
 
-    db.onerror = function (event) {
+    db.onerror = function() {
       invokeCallbacks();
     }
 
-    db.onversionchange = function (event) {
-      event.target.close();
+    db.onversionchange = function(versionChangeEvent) {
+      versionChangeEvent.target.close();
       invokeCallbacks();
     }
 
     let cache = new Map();
     let cursorRequest;
     try {
       cursorRequest = db.transaction(SNIPPETS_OBJECTSTORE_NAME)
                         .objectStore(SNIPPETS_OBJECTSTORE_NAME).openCursor();
     } catch (ex) {
       console.error(ex);
       invokeCallbacks();
       return;
     }
 
-    cursorRequest.onerror = function (event) {
+    cursorRequest.onerror = function() {
       invokeCallbacks();
     }
 
-    cursorRequest.onsuccess = function(event) {
-      let cursor = event.target.result;
+    cursorRequest.onsuccess = function(cursorRequestEvent) {
+      let cursor = cursorRequestEvent.target.result;
 
       // Populate the cache from the persistent storage.
       if (cursor) {
         cache.set(cursor.key, cursor.value);
         cursor.continue();
         return;
       }
 
       // The cache has been filled up, create the snippets map.
       gSnippetsMap = Object.freeze({
         get: (aKey) => cache.get(aKey),
-        set: function (aKey, aValue) {
+        set: function(aKey, aValue) {
           db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
             .objectStore(SNIPPETS_OBJECTSTORE_NAME).put(aValue, aKey);
           return cache.set(aKey, aValue);
         },
         has: (aKey) => cache.has(aKey),
-        delete: function (aKey) {
+        delete: function(aKey) {
           db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
             .objectStore(SNIPPETS_OBJECTSTORE_NAME).delete(aKey);
           return cache.delete(aKey);
         },
-        clear: function () {
+        clear: function() {
           db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite")
             .objectStore(SNIPPETS_OBJECTSTORE_NAME).clear();
           return cache.clear();
         },
         get size() { return cache.size; },
       });
 
       setTimeout(invokeCallbacks, 0);
@@ -278,17 +278,17 @@ function loadSnippets()
                      Date.now() - lastUpdate > SNIPPETS_UPDATE_INTERVAL_MS;
   if (updateURL && shouldUpdate) {
     // Try to update from network.
     let xhr = new XMLHttpRequest();
     xhr.timeout = 5000;
     // Even if fetching should fail we don't want to spam the server, thus
     // set the last update time regardless its results.  Will retry tomorrow.
     gSnippetsMap.set("snippets-last-update", Date.now());
-    xhr.onloadend = function (event) {
+    xhr.onloadend = function() {
       if (xhr.status == 200) {
         gSnippetsMap.set("snippets", xhr.responseText);
         gSnippetsMap.set("snippets-cached-version", currentVersion);
       }
       showSnippets();
       loadCompleted();
     };
     try {
--- a/browser/base/content/browser-addons.js
+++ b/browser/base/content/browser-addons.js
@@ -25,32 +25,32 @@ function removeNotificationOnEnd(notific
       onDownloadFailed: maybeRemove,
       onInstallFailed: maybeRemove,
       onInstallEnded: maybeRemove
     });
   }
 }
 
 const gXPInstallObserver = {
-  _findChildShell: function (aDocShell, aSoughtShell)
+  _findChildShell: function(aDocShell, aSoughtShell)
   {
     if (aDocShell == aSoughtShell)
       return aDocShell;
 
     var node = aDocShell.QueryInterface(Components.interfaces.nsIDocShellTreeItem);
     for (var i = 0; i < node.childCount; ++i) {
       var docShell = node.getChildAt(i);
       docShell = this._findChildShell(docShell, aSoughtShell);
       if (docShell == aSoughtShell)
         return docShell;
     }
     return null;
   },
 
-  _getBrowser: function (aDocShell)
+  _getBrowser: function(aDocShell)
   {
     for (let browser of gBrowser.browsers) {
       if (this._findChildShell(browser.docShell, aDocShell))
         return browser;
     }
     return null;
   },
 
@@ -127,20 +127,22 @@ const gXPInstallObserver = {
             let container = document.createElement("hbox");
 
             let name = document.createElement("label");
             name.setAttribute("value", install.addon.name);
             name.setAttribute("class", "addon-install-confirmation-name");
             container.appendChild(name);
 
             if (someUnsigned && install.addon.signedState <= AddonManager.SIGNEDSTATE_MISSING) {
-              let unsigned = document.createElement("label");
-              unsigned.setAttribute("value", gNavigatorBundle.getString("addonInstall.unsigned"));
-              unsigned.setAttribute("class", "addon-install-confirmation-unsigned");
-              container.appendChild(unsigned);
+              let unsignedLabel = document.createElement("label");
+              unsignedLabel.setAttribute("value",
+                gNavigatorBundle.getString("addonInstall.unsigned"));
+              unsignedLabel.setAttribute("class",
+                "addon-install-confirmation-unsigned");
+              container.appendChild(unsignedLabel);
             }
 
             addonList.appendChild(container);
           }
 
           this.acceptInstallation = () => {
             for (let install of installInfo.installs)
               install.install();
@@ -189,17 +191,16 @@ const gXPInstallObserver = {
     cancelButton.label = gNavigatorBundle.getString("addonInstall.cancelButton.label");
     cancelButton.accessKey = gNavigatorBundle.getString("addonInstall.cancelButton.accesskey");
 
     let acceptButton = document.getElementById("addon-install-confirmation-accept");
     acceptButton.label = gNavigatorBundle.getString("addonInstall.acceptButton.label");
     acceptButton.accessKey = gNavigatorBundle.getString("addonInstall.acceptButton.accesskey");
 
     if (height) {
-      let notification = document.getElementById("addon-install-confirmation-notification");
       notification.style.minHeight = height + "px";
     }
 
     let tab = gBrowser.getTabForBrowser(browser);
     if (tab) {
       gBrowser.selectedTab = tab;
     }
 
@@ -209,17 +210,17 @@ const gXPInstallObserver = {
 
     removeNotificationOnEnd(popup, installInfo.installs);
 
     Services.telemetry
             .getHistogramById("SECURITY_UI")
             .add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL);
   },
 
-  observe: function (aSubject, aTopic, aData)
+  observe: function(aSubject, aTopic, aData)
   {
     var brandBundle = document.getElementById("bundle_brand");
     var installInfo = aSubject.QueryInterface(Components.interfaces.amIWebInstallInfo);
     var browser = installInfo.browser;
 
     // Make sure the browser is still alive.
     if (!browser || gBrowser.browsers.indexOf(browser) == -1)
       return;
@@ -437,24 +438,24 @@ const gXPInstallObserver = {
   _removeProgressNotification(aBrowser) {
     let notification = PopupNotifications.getNotification("addon-progress", aBrowser);
     if (notification)
       notification.remove();
   }
 };
 
 var LightWeightThemeWebInstaller = {
-  init: function () {
+  init: function() {
     let mm = window.messageManager;
     mm.addMessageListener("LightWeightThemeWebInstaller:Install", this);
     mm.addMessageListener("LightWeightThemeWebInstaller:Preview", this);
     mm.addMessageListener("LightWeightThemeWebInstaller:ResetPreview", this);
   },
 
-  receiveMessage: function (message) {
+  receiveMessage: function(message) {
     // ignore requests from background tabs
     if (message.target != gBrowser.selectedBrowser) {
       return;
     }
 
     let data = message.data;
 
     switch (message.name) {
@@ -468,33 +469,33 @@ var LightWeightThemeWebInstaller = {
       }
       case "LightWeightThemeWebInstaller:ResetPreview": {
         this._resetPreview(data && data.baseURI);
         break;
       }
     }
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     switch (event.type) {
       case "TabSelect": {
         this._resetPreview();
         break;
       }
     }
   },
 
-  get _manager () {
+  get _manager() {
     let temp = {};
     Cu.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
     delete this._manager;
     return this._manager = temp.LightweightThemeManager;
   },
 
-  _installRequest: function (dataString, baseURI) {
+  _installRequest: function(dataString, baseURI) {
     let data = this._manager.parseTheme(dataString, baseURI);
 
     if (!data) {
       return;
     }
 
     let uri = makeURI(baseURI);
 
@@ -525,47 +526,47 @@ var LightWeightThemeWebInstaller = {
     let allowButtonAccesskey =
       gNavigatorBundle.getString("lwthemeInstallRequest.allowButton.accesskey");
     let message =
       gNavigatorBundle.getFormattedString("lwthemeInstallRequest.message",
                                           [uri.host]);
     let buttons = [{
       label: allowButtonText,
       accessKey: allowButtonAccesskey,
-      callback: function () {
+      callback: function() {
         LightWeightThemeWebInstaller._install(data, notify);
       }
     }];
 
     this._removePreviousNotifications();
 
     let notificationBox = gBrowser.getNotificationBox();
     let notificationBar =
       notificationBox.appendNotification(message, "lwtheme-install-request", "",
                                          notificationBox.PRIORITY_INFO_MEDIUM,
                                          buttons);
     notificationBar.persistence = 1;
   },
 
-  _install: function (newLWTheme, notify) {
+  _install: function(newLWTheme, notify) {
     let previousLWTheme = this._manager.currentTheme;
 
     let listener = {
       onEnabling: function(aAddon, aRequiresRestart) {
         if (!aRequiresRestart) {
           return;
         }
 
         let messageString = gNavigatorBundle.getFormattedString("lwthemeNeedsRestart.message",
           [aAddon.name], 1);
 
         let action = {
           label: gNavigatorBundle.getString("lwthemeNeedsRestart.button"),
           accessKey: gNavigatorBundle.getString("lwthemeNeedsRestart.accesskey"),
-          callback: function () {
+          callback: function() {
             BrowserUtils.restartApplication();
           }
         };
 
         let options = {
           timeout: Date.now() + 30000
         };
 
@@ -581,80 +582,80 @@ var LightWeightThemeWebInstaller = {
       }
     };
 
     AddonManager.addAddonListener(listener);
     this._manager.currentTheme = newLWTheme;
     AddonManager.removeAddonListener(listener);
   },
 
-  _postInstallNotification: function (newTheme, previousTheme) {
+  _postInstallNotification: function(newTheme, previousTheme) {
     function text(id) {
       return gNavigatorBundle.getString("lwthemePostInstallNotification." + id);
     }
 
     let buttons = [{
       label: text("undoButton"),
       accessKey: text("undoButton.accesskey"),
-      callback: function () {
+      callback: function() {
         LightWeightThemeWebInstaller._manager.forgetUsedTheme(newTheme.id);
         LightWeightThemeWebInstaller._manager.currentTheme = previousTheme;
       }
     }, {
       label: text("manageButton"),
       accessKey: text("manageButton.accesskey"),
-      callback: function () {
+      callback: function() {
         BrowserOpenAddonsMgr("addons://list/theme");
       }
     }];
 
     this._removePreviousNotifications();
 
     let notificationBox = gBrowser.getNotificationBox();
     let notificationBar =
       notificationBox.appendNotification(text("message"),
                                          "lwtheme-install-notification", "",
                                          notificationBox.PRIORITY_INFO_MEDIUM,
                                          buttons);
     notificationBar.persistence = 1;
     notificationBar.timeout = Date.now() + 20000; // 20 seconds
   },
 
-  _removePreviousNotifications: function () {
+  _removePreviousNotifications: function() {
     let box = gBrowser.getNotificationBox();
 
     ["lwtheme-install-request",
-     "lwtheme-install-notification"].forEach(function (value) {
+     "lwtheme-install-notification"].forEach(function(value) {
         let notification = box.getNotificationWithValue(value);
         if (notification)
           box.removeNotification(notification);
       });
   },
 
-  _preview: function (dataString, baseURI) {
+  _preview: function(dataString, baseURI) {
     if (!this._isAllowed(baseURI))
       return;
 
     let data = this._manager.parseTheme(dataString, baseURI);
     if (!data)
       return;
 
     this._resetPreview();
     gBrowser.tabContainer.addEventListener("TabSelect", this, false);
     this._manager.previewTheme(data);
   },
 
-  _resetPreview: function (baseURI) {
+  _resetPreview: function(baseURI) {
     if (baseURI && !this._isAllowed(baseURI))
       return;
     gBrowser.tabContainer.removeEventListener("TabSelect", this, false);
     this._manager.resetPreview();
   },
 
-  _isAllowed: function (srcURIString) {
+  _isAllowed: function(srcURIString) {
     let uri;
     try {
       uri = makeURI(srcURIString);
     }
     catch (e) {
       // makeURI fails if srcURIString is a nonsense URI
       return false;
     }
@@ -669,33 +670,33 @@ var LightWeightThemeWebInstaller = {
 };
 
 /*
  * Listen for Lightweight Theme styling changes and update the browser's theme accordingly.
  */
 var LightweightThemeListener = {
   _modifiedStyles: [],
 
-  init: function () {
+  init: function() {
     XPCOMUtils.defineLazyGetter(this, "styleSheet", function() {
       for (let i = document.styleSheets.length - 1; i >= 0; i--) {
         let sheet = document.styleSheets[i];
         if (sheet.href == "chrome://browser/skin/browser-lightweightTheme.css")
           return sheet;
       }
       return undefined;
     });
 
     Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
     Services.obs.addObserver(this, "lightweight-theme-optimized", false);
     if (document.documentElement.hasAttribute("lwtheme"))
       this.updateStyleSheet(document.documentElement.style.backgroundImage);
   },
 
-  uninit: function () {
+  uninit: function() {
     Services.obs.removeObserver(this, "lightweight-theme-styling-update");
     Services.obs.removeObserver(this, "lightweight-theme-optimized");
   },
 
   /**
    * Append the headerImage to the background-image property of all rulesets in
    * browser-lightweightTheme.css.
    *
@@ -726,17 +727,17 @@ var LightweightThemeListener = {
       } else {
         Cu.reportError("Unsupported rule encountered");
       }
     }
     return styleRulesModified;
   },
 
   // nsIObserver
-  observe: function (aSubject, aTopic, aData) {
+  observe: function(aSubject, aTopic, aData) {
     if ((aTopic != "lightweight-theme-styling-update" && aTopic != "lightweight-theme-optimized") ||
           !this.styleSheet)
       return;
 
     if (aTopic == "lightweight-theme-optimized" && aSubject != window)
       return;
 
     let themeData = JSON.parse(aData);
--- a/browser/base/content/browser-ctrlTab.js
+++ b/browser/base/content/browser-ctrlTab.js
@@ -43,17 +43,17 @@ var tabPreviews = {
   },
 
   capture: function tabPreviews_capture(aTab, aShouldCache) {
     let browser = aTab.linkedBrowser;
     let uri = browser.currentURI.spec;
     let canvas = PageThumbs.createCanvas(window);
     PageThumbs.shouldStoreThumbnail(browser, (aDoStore) => {
       if (aDoStore && aShouldCache) {
-        PageThumbs.captureAndStore(browser, function () {
+        PageThumbs.captureAndStore(browser, function() {
           let img = new Image;
           img.src = PageThumbs.getThumbnailURL(uri);
           aTab.__thumbnail = img;
           aTab.__thumbnail_lastURI = uri;
           canvas.getContext("2d").drawImage(img, 0, 0);
         });
       } else {
         PageThumbs.captureToCanvas(browser, canvas, () => {
@@ -73,17 +73,17 @@ var tabPreviews = {
         if (this._selectedTab &&
             this._selectedTab.parentNode &&
             !this._pendingUpdate) {
           // Generate a thumbnail for the tab that was selected.
           // The timeout keeps the UI snappy and prevents us from generating thumbnails
           // for tabs that will be closed. During that timeout, don't generate other
           // thumbnails in case multiple TabSelect events occur fast in succession.
           this._pendingUpdate = true;
-          setTimeout(function (self, aTab) {
+          setTimeout(function(self, aTab) {
             self._pendingUpdate = false;
             if (aTab.parentNode &&
                 !aTab.hasAttribute("busy") &&
                 !aTab.hasAttribute("pending"))
               self.capture(aTab, true);
           }, 2000, this, this._selectedTab);
         }
         this._selectedTab = event.target;
@@ -91,39 +91,39 @@ var tabPreviews = {
       case "SSTabRestored":
         this.capture(event.target, true);
         break;
     }
   }
 };
 
 var tabPreviewPanelHelper = {
-  opening: function (host) {
+  opening: function(host) {
     host.panel.hidden = false;
 
     var handler = this._generateHandler(host);
     host.panel.addEventListener("popupshown", handler, false);
     host.panel.addEventListener("popuphiding", handler, false);
 
     host._prevFocus = document.commandDispatcher.focusedElement;
   },
-  _generateHandler: function (host) {
+  _generateHandler: function(host) {
     var self = this;
-    return function (event) {
+    return function(event) {
       if (event.target == host.panel) {
         host.panel.removeEventListener(event.type, arguments.callee, false);
         self["_" + event.type](host);
       }
     };
   },
-  _popupshown: function (host) {
+  _popupshown: function(host) {
     if ("setupGUI" in host)
       host.setupGUI();
   },
-  _popuphiding: function (host) {
+  _popuphiding: function(host) {
     if ("suspendGUI" in host)
       host.suspendGUI();
 
     if (host._prevFocus) {
       Services.focus.setFocus(host._prevFocus, Ci.nsIFocusManager.FLAG_NOSCROLL);
       host._prevFocus = null;
     } else
       gBrowser.selectedBrowser.focus();
@@ -134,67 +134,67 @@ var tabPreviewPanelHelper = {
     }
   }
 };
 
 /**
  * Ctrl-Tab panel
  */
 var ctrlTab = {
-  get panel () {
+  get panel() {
     delete this.panel;
     return this.panel = document.getElementById("ctrlTab-panel");
   },
-  get showAllButton () {
+  get showAllButton() {
     delete this.showAllButton;
     return this.showAllButton = document.getElementById("ctrlTab-showAll");
   },
-  get previews () {
+  get previews() {
     delete this.previews;
     return this.previews = this.panel.getElementsByClassName("ctrlTab-preview");
   },
-  get maxTabPreviews () {
+  get maxTabPreviews() {
     delete this.maxTabPreviews;
     return this.maxTabPreviews = this.previews.length - 1;
   },
-  get canvasWidth () {
+  get canvasWidth() {
     delete this.canvasWidth;
     return this.canvasWidth = Math.ceil(screen.availWidth * .85 / this.maxTabPreviews);
   },
-  get canvasHeight () {
+  get canvasHeight() {
     delete this.canvasHeight;
     return this.canvasHeight = Math.round(this.canvasWidth * tabPreviews.aspectRatio);
   },
-  get keys () {
+  get keys() {
     var keys = {};
-    ["close", "find", "selectAll"].forEach(function (key) {
+    ["close", "find", "selectAll"].forEach(function(key) {
       keys[key] = document.getElementById("key_" + key)
                           .getAttribute("key")
                           .toLocaleLowerCase().charCodeAt(0);
     });
     delete this.keys;
     return this.keys = keys;
   },
   _selectedIndex: 0,
-  get selected () {
+  get selected() {
     return this._selectedIndex < 0 ?
              document.activeElement :
              this.previews.item(this._selectedIndex);
   },
-  get isOpen () {
+  get isOpen() {
     return this.panel.state == "open" || this.panel.state == "showing" || this._timer;
   },
-  get tabCount () {
+  get tabCount() {
     return this.tabList.length;
   },
-  get tabPreviewCount () {
+  get tabPreviewCount() {
     return Math.min(this.maxTabPreviews, this.tabCount);
   },
 
-  get tabList () {
+  get tabList() {
     return this._recentlyUsedTabs;
   },
 
   init: function ctrlTab_init() {
     if (!this._recentlyUsedTabs) {
       tabPreviews.init();
 
       this._initRecentlyUsedTabs();
@@ -214,17 +214,17 @@ var ctrlTab = {
       (!gPrefService.prefHasUserValue("browser.ctrlTab.disallowForScreenReaders") ||
        !gPrefService.getBoolPref("browser.ctrlTab.disallowForScreenReaders"));
 
     if (enable)
       this.init();
     else
       this.uninit();
   },
-  observe: function (aSubject, aTopic, aPrefName) {
+  observe: function(aSubject, aTopic, aPrefName) {
     this.readPref();
   },
 
   updatePreviews: function ctrlTab_updatePreviews() {
     for (let i = 0; i < this.previews.length; i++)
       this.updatePreview(this.previews[i], this.tabList[i]);
 
     var showAllLabel = gNavigatorBundle.getString("ctrlTab.listAllTabs.label");
@@ -342,17 +342,17 @@ var ctrlTab = {
 
     document.addEventListener("keyup", this, true);
 
     this.updatePreviews();
     this._selectedIndex = 1;
 
     // Add a slight delay before showing the UI, so that a quick
     // "ctrl-tab" keypress just flips back to the MRU tab.
-    this._timer = setTimeout(function (self) {
+    this._timer = setTimeout(function(self) {
       self._timer = null;
       self._openPanel();
     }, 200, this);
   },
 
   _openPanel: function ctrlTab_openPanel() {
     tabPreviewPanelHelper.opening(this);
 
@@ -383,17 +383,17 @@ var ctrlTab = {
 
   setupGUI: function ctrlTab_setupGUI() {
     this.selected.focus();
     this._selectedIndex = -1;
 
     // Track mouse movement after a brief delay so that the item that happens
     // to be under the mouse pointer initially won't be selected unintentionally.
     this._trackMouseOver = false;
-    setTimeout(function (self) {
+    setTimeout(function(self) {
       if (self.isOpen)
         self._trackMouseOver = true;
     }, 0, this);
   },
 
   suspendGUI: function ctrlTab_suspendGUI() {
     document.removeEventListener("keyup", this, true);
 
@@ -457,17 +457,17 @@ var ctrlTab = {
 
     if (this.selected.hidden)
       this.advanceFocus(false);
     if (this.selected == this.showAllButton)
       this.advanceFocus(false);
 
     // If the current tab is removed, another tab can steal our focus.
     if (aTab.selected && this.panel.state == "open") {
-      setTimeout(function (selected) {
+      setTimeout(function(selected) {
         selected.focus();
       }, 0, this.selected);
     }
   },
 
   handleEvent: function ctrlTab_handleEvent(event) {
     switch (event.type) {
       case "SSWindowRestored":
@@ -503,31 +503,31 @@ var ctrlTab = {
         break;
       case "popupshowing":
         if (event.target.id == "menu_viewPopup")
           document.getElementById("menu_showAllTabs").hidden = !allTabs.canOpen;
         break;
     }
   },
 
-  filterForThumbnailExpiration: function (aCallback) {
+  filterForThumbnailExpiration: function(aCallback) {
     // Save a few more thumbnails than we actually display, so that when tabs
     // are closed, the previews we add instead still get thumbnails.
     const extraThumbnails = 3;
     const thumbnailCount = Math.min(this.tabPreviewCount + extraThumbnails,
                                     this.tabCount);
 
     let urls = [];
     for (let i = 0; i < thumbnailCount; i++)
       urls.push(this.tabList[i].linkedBrowser.currentURI.spec);
 
     aCallback(urls);
   },
 
-  _initRecentlyUsedTabs: function () {
+  _initRecentlyUsedTabs: function() {
     this._recentlyUsedTabs =
       Array.filter(gBrowser.tabs, tab => !tab.closing)
            .sort((tab1, tab2) => tab2.lastAccessed - tab1.lastAccessed);
   },
 
   _init: function ctrlTab__init(enable) {
     var toggleEventListener = enable ? "addEventListener" : "removeEventListener";
 
--- a/browser/base/content/browser-data-submission-info-bar.js
+++ b/browser/base/content/browser-data-submission-info-bar.js
@@ -34,21 +34,21 @@ var gDataNotificationInfoBar = {
       }
     }, false);
 
     for (let o of this._OBSERVERS) {
       Services.obs.addObserver(this, o, true);
     }
   },
 
-  _getDataReportingNotification: function (name=this._DATA_REPORTING_NOTIFICATION) {
+  _getDataReportingNotification: function(name = this._DATA_REPORTING_NOTIFICATION) {
     return this._notificationBox.getNotificationWithValue(name);
   },
 
-  _displayDataPolicyInfoBar: function (request) {
+  _displayDataPolicyInfoBar: function(request) {
     if (this._getDataReportingNotification()) {
       return;
     }
 
     let brandBundle = document.getElementById("bundle_brand");
     let appName = brandBundle.getString("brandShortName");
     let vendorName = brandBundle.getString("vendorShortName");
 
@@ -83,17 +83,17 @@ var gDataNotificationInfoBar = {
     );
     // It is important to defer calling onUserNotifyComplete() until we're
     // actually sure the notification was displayed. If we ever called
     // onUserNotifyComplete() without showing anything to the user, that
     // would be very good for user choice. It may also have legal impact.
     request.onUserNotifyComplete();
   },
 
-  _clearPolicyNotification: function () {
+  _clearPolicyNotification: function() {
     let notification = this._getDataReportingNotification();
     if (notification) {
       this._log.debug("Closing notification.");
       notification.close();
     }
   },
 
   observe: function(subject, topic, data) {
--- a/browser/base/content/browser-devedition.js
+++ b/browser/base/content/browser-devedition.js
@@ -16,17 +16,17 @@ var DevEdition = {
     return this.styleSheet && !this.styleSheet.sheet.disabled;
   },
 
   get isThemeCurrentlyApplied() {
     let theme = LightweightThemeManager.currentTheme;
     return theme && theme.id == "firefox-devedition@mozilla.org";
   },
 
-  init: function () {
+  init: function() {
     this.initialized = true;
     Services.prefs.addObserver(this._devtoolsThemePrefName, this, false);
     Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
     Services.obs.addObserver(this, "lightweight-theme-window-updated", false);
     this._updateDevtoolsThemeAttribute();
 
     if (this.isThemeCurrentlyApplied) {
       this._toggleStyleSheet(true);
@@ -37,17 +37,17 @@ var DevEdition = {
     let styleSheetAttr = `href="${this.styleSheetLocation}" type="text/css"`;
     this.styleSheet = document.createProcessingInstruction(
       "xml-stylesheet", styleSheetAttr);
     this.styleSheet.addEventListener("load", this);
     document.insertBefore(this.styleSheet, document.documentElement);
     this.styleSheet.sheet.disabled = true;
   },
 
-  observe: function (subject, topic, data) {
+  observe: function(subject, topic, data) {
     if (topic == "lightweight-theme-styling-update") {
       let newTheme = JSON.parse(data);
       if (newTheme && newTheme.id == "firefox-devedition@mozilla.org") {
         this._toggleStyleSheet(true);
       } else {
         this._toggleStyleSheet(false);
       }
     } else if (topic == "lightweight-theme-window-updated" && subject == window) {
@@ -117,17 +117,17 @@ var DevEdition = {
       this.styleSheet.sheet.disabled = false;
       this.refreshBrowserDisplay();
     } else if (!deveditionThemeEnabled && wasEnabled) {
       this.styleSheet.sheet.disabled = true;
       this.refreshBrowserDisplay();
     }
   },
 
-  uninit: function () {
+  uninit: function() {
     Services.prefs.removeObserver(this._devtoolsThemePrefName, this);
     Services.obs.removeObserver(this, "lightweight-theme-styling-update", false);
     Services.obs.removeObserver(this, "lightweight-theme-window-updated", false);
     if (this.styleSheet) {
       this.styleSheet.removeEventListener("load", this);
     }
     this.styleSheet = null;
   }
--- a/browser/base/content/browser-fullScreenAndPointerLock.js
+++ b/browser/base/content/browser-fullScreenAndPointerLock.js
@@ -272,17 +272,17 @@ var FullScreen = {
 
   uninit: function() {
     for (let type of this._MESSAGES) {
       window.messageManager.removeMessageListener(type, this);
     }
     this.cleanup();
   },
 
-  toggle: function () {
+  toggle: function() {
     var enterFS = window.fullScreen;
 
     // Toggle the View:FullScreen command, which controls elements like the
     // fullscreen menuitem, and menubars.
     let fullscreenCommand = document.getElementById("View:FullScreen");
     if (enterFS) {
       fullscreenCommand.setAttribute("checked", enterFS);
     } else {
@@ -341,17 +341,17 @@ var FullScreen = {
                         .add(1);
     }
   },
 
   exitDomFullScreen : function() {
     document.exitFullscreen();
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     switch (event.type) {
       case "fullscreen":
         this.toggle();
         break;
       case "MozDOMFullscreen:Entered": {
         // The event target is the element which requested the DOM
         // fullscreen. If we were entering DOM fullscreen for a remote
         // browser, the target would be `gBrowser` and the original
@@ -451,39 +451,39 @@ var FullScreen = {
     gBrowser.tabContainer.addEventListener("TabSelect", this.exitDomFullScreen);
 
     // Add listener to detect when the fullscreen window is re-focused.
     // If a fullscreen window loses focus, we show a warning when the
     // fullscreen window is refocused.
     window.addEventListener("activate", this);
   },
 
-  cleanup: function () {
+  cleanup: function() {
     if (!window.fullScreen) {
       MousePosTracker.removeListener(this);
       document.removeEventListener("keypress", this._keyToggleCallback, false);
       document.removeEventListener("popupshown", this._setPopupOpen, false);
       document.removeEventListener("popuphidden", this._setPopupOpen, false);
     }
   },
 
-  cleanupDomFullscreen: function () {
+  cleanupDomFullscreen: function() {
     window.messageManager
           .broadcastAsyncMessage("DOMFullscreen:CleanUp");
 
     PointerlockFsWarning.close();
     gBrowser.tabContainer.removeEventListener("TabOpen", this.exitDomFullScreen);
     gBrowser.tabContainer.removeEventListener("TabClose", this.exitDomFullScreen);
     gBrowser.tabContainer.removeEventListener("TabSelect", this.exitDomFullScreen);
     window.removeEventListener("activate", this);
 
     document.documentElement.removeAttribute("inDOMFullscreen");
   },
 
-  _isRemoteBrowser: function (aBrowser) {
+  _isRemoteBrowser: function(aBrowser) {
     return gMultiProcessBrowser && aBrowser.getAttribute("remote") == "true";
   },
 
   get _windowUtils() {
     return window.QueryInterface(Ci.nsIInterfaceRequestor)
                  .getInterface(Ci.nsIDOMWindowUtils);
   },
 
@@ -511,17 +511,17 @@ var FullScreen = {
     // F6 is another shortcut to the address bar, but its not covered in OpenLocation()
     else if (aEvent.keyCode == aEvent.DOM_VK_F6)
       FullScreen.showNavToolbox();
   },
 
   // Checks whether we are allowed to collapse the chrome
   _isPopupOpen: false,
   _isChromeCollapsed: false,
-  _safeToCollapse: function () {
+  _safeToCollapse: function() {
     if (!gPrefService.getBoolPref("browser.fullscreen.autohide"))
       return false;
 
     // a popup menu is open in chrome: don't collapse chrome
     if (this._isPopupOpen)
       return false;
 
     // On OS X Lion we don't want to hide toolbars.
@@ -586,17 +586,17 @@ var FullScreen = {
         right: rect.right
       };
       MousePosTracker.addListener(this);
     }
 
     this._isChromeCollapsed = false;
   },
 
-  hideNavToolbox: function (aAnimate = false) {
+  hideNavToolbox: function(aAnimate = false) {
     if (this._isChromeCollapsed || !this._safeToCollapse())
       return;
 
     this._fullScrToggler.hidden = false;
 
     if (aAnimate && gPrefService.getBoolPref("browser.fullscreen.animate")) {
       gNavToolbox.setAttribute("fullscreenShouldAnimate", true);
       // Hide the fullscreen toggler until the transition ends.
@@ -610,17 +610,17 @@ var FullScreen = {
     }
 
     gNavToolbox.style.marginTop =
       -gNavToolbox.getBoundingClientRect().height + "px";
     this._isChromeCollapsed = true;
     MousePosTracker.removeListener(this);
   },
 
-  _updateToolbars: function (aEnterFS) {
+  _updateToolbars: function(aEnterFS) {
     for (let el of document.querySelectorAll("toolbar[fullscreentoolbar=true]")) {
       if (aEnterFS) {
         // Give the main nav bar and the tab bar the fullscreen context menu,
         // otherwise remove context menu to prevent breakage
         el.setAttribute("saved-context", el.getAttribute("context"));
         if (el.id == "nav-bar" || el.id == "TabsToolbar")
           el.setAttribute("context", "autohide-context");
         else
--- a/browser/base/content/browser-fullZoom.js
+++ b/browser/base/content/browser-fullZoom.js
@@ -84,17 +84,17 @@ var FullZoom = {
         this._ignorePendingZoomAccesses(browser);
         this._applyZoomToPref(browser);
         break;
     }
   },
 
   // nsIObserver
 
-  observe: function (aSubject, aTopic, aData) {
+  observe: function(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "nsPref:changed":
         switch (aData) {
           case "browser.zoom.siteSpecific":
             this._siteSpecificPref =
               gPrefService.getBoolPref("browser.zoom.siteSpecific");
             break;
           case "browser.zoom.updateBackgroundTabs":
@@ -149,18 +149,18 @@ var FullZoom = {
                           this._ensureValid(aValue);
 
     // If the current page doesn't have a site-specific preference, then its
     // zoom should be set to the new global preference now that the global
     // preference has changed.
     let hasPref = false;
     let token = this._getBrowserToken(browser);
     this._cps2.getByDomainAndName(browser.currentURI.spec, this.name, ctxt, {
-      handleResult: function () { hasPref = true; },
-      handleCompletion: function () {
+      handleResult: function() { hasPref = true; },
+      handleCompletion: function() {
         if (!hasPref && token.isCurrent)
           this._applyPrefToZoom(undefined, browser);
       }.bind(this)
     });
   },
 
   // location change observer
 
@@ -218,18 +218,18 @@ var FullZoom = {
                             this._notifyOnLocationChange.bind(this, browser));
       return;
     }
 
     // It's not cached, so we have to asynchronously fetch it.
     let value = undefined;
     let token = this._getBrowserToken(browser);
     this._cps2.getByDomainAndName(aURI.spec, this.name, ctxt, {
-      handleResult: function (resultPref) { value = resultPref.value; },
-      handleCompletion: function () {
+      handleResult: function(resultPref) { value = resultPref.value; },
+      handleCompletion: function() {
         if (!token.isCurrent) {
           this._notifyOnLocationChange(browser);
           return;
         }
         this._applyPrefToZoom(value, browser,
                               this._notifyOnLocationChange.bind(this, browser));
       }.bind(this)
     });
@@ -264,17 +264,17 @@ var FullZoom = {
     this._ignorePendingZoomAccesses(browser);
     this._applyZoomToPref(browser);
   },
 
   /**
    * Sets the zoom level for the given browser to the given floating
    * point value, where 1 is the default zoom level.
    */
-  setZoom: function (value, browser = gBrowser.selectedBrowser) {
+  setZoom: function(value, browser = gBrowser.selectedBrowser) {
     ZoomManager.setZoomForBrowser(browser, value);
     this._ignorePendingZoomAccesses(browser);
     this._applyZoomToPref(browser);
   },
 
   /**
    * Sets the zoom level of the page in the given browser to the global zoom
    * level.
@@ -359,34 +359,34 @@ var FullZoom = {
     if (!this.siteSpecific ||
         gInPrintPreviewMode ||
         browser.isSyntheticDocument)
       return;
 
     this._cps2.set(browser.currentURI.spec, this.name,
                    ZoomManager.getZoomForBrowser(browser),
                    this._loadContextFromBrowser(browser), {
-      handleCompletion: function () {
+      handleCompletion: function() {
         this._isNextContentPrefChangeInternal = true;
       }.bind(this),
     });
   },
 
   /**
    * Removes from the content prefs store the zoom level of the given browser.
    *
    * @param browser  The zoom of this browser will be removed.  Required.
    */
   _removePref: function FullZoom__removePref(browser) {
     Services.obs.notifyObservers(browser, "browser-fullZoom:zoomReset", "");
     if (browser.isSyntheticDocument)
       return;
     let ctxt = this._loadContextFromBrowser(browser);
     this._cps2.removeByDomainAndName(browser.currentURI.spec, this.name, ctxt, {
-      handleCompletion: function () {
+      handleCompletion: function() {
         this._isNextContentPrefChangeInternal = true;
       }.bind(this),
     });
   },
 
   // Utilities
 
   /**
@@ -482,17 +482,17 @@ var FullZoom = {
     // * Otherwise, this._globalValue is a number, the global value.
     return new Promise(resolve => {
       if ("_globalValue" in this) {
         resolve(this._globalValue);
         return;
       }
       let value = undefined;
       this._cps2.getGlobal(this.name, this._loadContextFromBrowser(browser), {
-        handleResult: function (pref) { value = pref.value; },
+        handleResult: function(pref) { value = pref.value; },
         handleCompletion: (reason) => {
           this._globalValue = this._ensureValid(value);
           resolve(this._globalValue);
         }
       });
     });
   },
 
@@ -508,17 +508,17 @@ var FullZoom = {
 
   /**
    * Asynchronously broadcasts "browser-fullZoom:location-change" so that
    * listeners can be notified when the zoom levels on those pages change.
    * The notification is always asynchronous so that observers are guaranteed a
    * consistent behavior.
    */
   _notifyOnLocationChange: function FullZoom__notifyOnLocationChange(browser) {
-    this._executeSoon(function () {
+    this._executeSoon(function() {
       Services.obs.notifyObservers(browser, "browser-fullZoom:location-change", "");
     });
   },
 
   _executeSoon: function FullZoom__executeSoon(callback) {
     if (!callback)
       return;
     Services.tm.mainThread.dispatch(callback, Ci.nsIThread.DISPATCH_NORMAL);
--- a/browser/base/content/browser-fxaccounts.js
+++ b/browser/base/content/browser-fxaccounts.js
@@ -82,17 +82,17 @@ var gFxAccounts = {
     return Services.prefs.getBoolPref("services.sync.sendTabToDevice.enabled");
   },
 
   get remoteClients() {
     return Weave.Service.clientsEngine.remoteClients
            .sort((a, b) => a.name.localeCompare(b.name));
   },
 
-  init: function () {
+  init: function() {
     // Bail out if we're already initialized and for pop-up windows.
     if (this._initialized || !window.toolbar.visible) {
       return;
     }
 
     for (let topic of this.topics) {
       Services.obs.addObserver(this, topic, false);
     }
@@ -101,43 +101,43 @@ var gFxAccounts = {
     gNavToolbox.addEventListener("customizationending", this);
 
     EnsureFxAccountsWebChannel();
     this._initialized = true;
 
     this.updateUI();
   },
 
-  uninit: function () {
+  uninit: function() {
     if (!this._initialized) {
       return;
     }
 
     for (let topic of this.topics) {
       Services.obs.removeObserver(this, topic);
     }
 
     this._initialized = false;
   },
 
-  observe: function (subject, topic, data) {
+  observe: function(subject, topic, data) {
     switch (topic) {
       case "fxa-migration:state-changed":
         this.onMigrationStateChanged(data, subject);
         break;
       case this.FxAccountsCommon.ONPROFILE_IMAGE_CHANGE_NOTIFICATION:
         this.updateUI();
         break;
       default:
         this.updateUI();
         break;
     }
   },
 
-  onMigrationStateChanged: function () {
+  onMigrationStateChanged: function() {
     // Since we nuked most of the migration code, this notification will fire
     // once after legacy Sync has been disconnected (and should never fire
     // again)
     let nb = window.document.getElementById("global-notificationbox");
 
     let msg = this.strings.GetStringFromName("autoDisconnectDescription")
     let signInLabel = this.strings.GetStringFromName("autoDisconnectSignIn.label");
     let signInAccessKey = this.strings.GetStringFromName("autoDisconnectSignIn.accessKey");
@@ -169,36 +169,36 @@ var gFxAccounts = {
                           undefined,
                           nb.PRIORITY_WARNING_LOW,
                           buttons);
 
     // ensure the hamburger menu reflects the newly disconnected state.
     this.updateAppMenuItem();
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     this._inCustomizationMode = event.type == "customizationstarting";
     this.updateAppMenuItem();
   },
 
-  updateUI: function () {
+  updateUI: function() {
     // It's possible someone signed in to FxA after seeing our notification
     // about "Legacy Sync migration" (which now is actually "Legacy Sync
     // auto-disconnect") so kill that notification if it still exists.
     let nb = window.document.getElementById("global-notificationbox");
     let n = nb.getNotificationWithValue(this.SYNC_MIGRATION_NOTIFICATION_TITLE);
     if (n) {
       nb.removeNotification(n, true);
     }
 
     this.updateAppMenuItem();
   },
 
   // Note that updateAppMenuItem() returns a Promise that's only used by tests.
-  updateAppMenuItem: function () {
+  updateAppMenuItem: function() {
     let profileInfoEnabled = false;
     try {
       profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
     } catch (e) { }
 
     // Bail out if FxA is disabled.
     if (!this.weave.fxAccountsEnabled) {
       return Promise.resolve();
@@ -314,17 +314,17 @@ var gFxAccounts = {
       // The most likely scenario is a user logged out, so reflect that.
       // Bug 995134 calls for better errors so we could retry if we were
       // sure this was the failure reason.
       this.FxAccountsCommon.log.error("Error updating FxA account info", error);
       updateWithUserData(null);
     });
   },
 
-  onMenuPanelCommand: function () {
+  onMenuPanelCommand: function() {
 
     switch (this.panelUIFooter.getAttribute("fxastatus")) {
     case "signedin":
       this.openPreferences();
       break;
     case "error":
       if (this.panelUIFooter.getAttribute("unverified")) {
         this.openPreferences();
@@ -335,57 +335,56 @@ var gFxAccounts = {
     default:
       this.openPreferences();
       break;
     }
 
     PanelUI.hide();
   },
 
-  openPreferences: function () {
+  openPreferences: function() {
     openPreferences("paneSync", { urlParams: { entrypoint: "menupanel" } });
   },
 
-  openAccountsPage: function (action, urlParams={}) {
+  openAccountsPage: function(action, urlParams = {}) {
     let params = new URLSearchParams();
     if (action) {
       params.set("action", action);
     }
     for (let name in urlParams) {
       if (urlParams[name] !== undefined) {
         params.set(name, urlParams[name]);
       }
     }
     let url = "about:accounts?" + params;
     switchToTabHavingURI(url, true, {
       replaceQueryString: true
     });
   },
 
-  openSignInAgainPage: function (entryPoint) {
+  openSignInAgainPage: function(entryPoint) {
     this.openAccountsPage("reauth", { entrypoint: entryPoint });
   },
 
-  sendTabToDevice: function (url, clientId, title) {
+  sendTabToDevice: function(url, clientId, title) {
     Weave.Service.clientsEngine.sendURIToClientForDisplay(url, clientId, title);
   },
 
-  populateSendTabToDevicesMenu: function (devicesPopup, url, title) {
+  populateSendTabToDevicesMenu: function(devicesPopup, url, title) {
     // remove existing menu items
     while (devicesPopup.hasChildNodes()) {
       devicesPopup.removeChild(devicesPopup.firstChild);
     }
 
     const fragment = document.createDocumentFragment();
 
     const onTargetDeviceCommand = (event) => {
-      const clientId = event.target.getAttribute("clientId");
-      const clients = clientId
-                      ? [clientId]
-                      : this.remoteClients.map(client => client.id);
+      let clients = event.target.getAttribute("clientId") ?
+        [event.target.getAttribute("clientId")] :
+        this.remoteClients.map(client => client.id);
 
       clients.forEach(clientId => this.sendTabToDevice(url, clientId, title));
     }
 
     function addTargetDevice(clientId, name) {
       const targetDevice = document.createElement("menuitem");
       targetDevice.addEventListener("command", onTargetDeviceCommand, true);
       targetDevice.setAttribute("class", "sendtab-target");
@@ -405,27 +404,27 @@ var gFxAccounts = {
       fragment.appendChild(separator);
       const allDevicesLabel = this.strings.GetStringFromName("sendTabToAllDevices.menuitem");
       addTargetDevice("", allDevicesLabel);
     }
 
     devicesPopup.appendChild(fragment);
   },
 
-  updateTabContextMenu: function (aPopupMenu) {
+  updateTabContextMenu: function(aPopupMenu) {
     if (!this.sendTabToDeviceEnabled) {
       return;
     }
 
     const remoteClientPresent = this.remoteClients.length > 0;
     ["context_sendTabToDevice", "context_sendTabToDevice_separator"]
     .forEach(id => { document.getElementById(id).hidden = !remoteClientPresent });
   },
 
-  initPageContextMenu: function (contextMenu) {
+  initPageContextMenu: function(contextMenu) {
     if (!this.sendTabToDeviceEnabled) {
       return;
     }
 
     const remoteClientPresent = this.remoteClients.length > 0;
     // showSendLink and showSendPage are mutually exclusive
     const showSendLink = remoteClientPresent
                          && (contextMenu.onSaveableLink || contextMenu.onPlainTextLink);
@@ -437,17 +436,17 @@ var gFxAccounts = {
 
     ["context-sendpagetodevice", "context-sep-sendpagetodevice"]
     .forEach(id => contextMenu.showItem(id, showSendPage));
     ["context-sendlinktodevice", "context-sep-sendlinktodevice"]
     .forEach(id => contextMenu.showItem(id, showSendLink));
   }
 };
 
-XPCOMUtils.defineLazyGetter(gFxAccounts, "FxAccountsCommon", function () {
+XPCOMUtils.defineLazyGetter(gFxAccounts, "FxAccountsCommon", function() {
   return Cu.import("resource://gre/modules/FxAccountsCommon.js", {});
 });
 
 XPCOMUtils.defineLazyModuleGetter(gFxAccounts, "fxaMigrator",
   "resource://services-sync/FxaMigrator.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "EnsureFxAccountsWebChannel",
   "resource://gre/modules/FxAccountsWebChannel.jsm");
--- a/browser/base/content/browser-gestureSupport.js
+++ b/browser/base/content/browser-gestureSupport.js
@@ -129,28 +129,28 @@ var gGestureSupport = {
       aPref[pref] = this._getPref(aGesture + "." + pref, def);
 
     // Keep track of the total deltas and latching behavior
     let offset = 0;
     let latchDir = aEvent.delta > 0 ? 1 : -1;
     let isLatched = false;
 
     // Create the update function here to capture closure state
-    this._doUpdate = function GS__doUpdate(aEvent) {
+    this._doUpdate = function GS__doUpdate(updateEvent) {
       // Update the offset with new event data
-      offset += aEvent.delta;
+      offset += updateEvent.delta;
 
       // Check if the cumulative deltas exceed the threshold
       if (Math.abs(offset) > aPref["threshold"]) {
         // Trigger the action if we don't care about latching; otherwise, make
         // sure either we're not latched and going the same direction of the
         // initial motion; or we're latched and going the opposite way
         let sameDir = (latchDir ^ offset) >= 0;
         if (!aPref["latched"] || (isLatched ^ sameDir)) {
-          this._doAction(aEvent, [aGesture, offset > 0 ? aInc : aDec]);
+          this._doAction(updateEvent, [aGesture, offset > 0 ? aInc : aDec]);
 
           // We must be getting latched or leaving it, so just toggle
           isLatched = !isLatched;
         }
 
         // Reset motion counter to prepare for more of the same gesture
         offset = 0;
       }
@@ -237,35 +237,35 @@ var gGestureSupport = {
 
     this._doUpdate = function GS__doUpdate(aEvent) {
       gHistorySwipeAnimation.updateAnimation(aEvent.delta);
     };
 
     this._doEnd = function GS__doEnd(aEvent) {
       gHistorySwipeAnimation.swipeEndEventReceived();
 
-      this._doUpdate = function (aEvent) {};
-      this._doEnd = function (aEvent) {};
+      this._doUpdate = function() {};
+      this._doEnd = function() {};
     }
   },
 
   /**
    * Generator producing the powerset of the input array where the first result
    * is the complete set and the last result (before StopIteration) is empty.
    *
    * @param aArray
    *        Source array containing any number of elements
    * @yield Array that is a subset of the input array from full set to empty
    */
   _power: function* GS__power(aArray) {
     // Create a bitmask based on the length of the array
     let num = 1 << aArray.length;
     while (--num >= 0) {
       // Only select array elements where the current bit is set
-      yield aArray.reduce(function (aPrev, aCurr, aIndex) {
+      yield aArray.reduce(function(aPrev, aCurr, aIndex) {
         if (num & 1 << aIndex)
           aPrev.push(aCurr);
         return aPrev;
       }, []);
     }
   },
 
   /**
--- a/browser/base/content/browser-media.js
+++ b/browser/base/content/browser-media.js
@@ -139,17 +139,17 @@ var gEMEHandler = {
     box.appendNotification(fragment, notificationId, iconURL, box.PRIORITY_WARNING_MEDIUM,
                            buttons);
   },
   showPopupNotificationForSuccess: function(browser, keySystem) {
     // We're playing EME content! Remove any "we can't play because..." messages.
     var box = gBrowser.getNotificationBox(browser);
     ["drmContentDisabled",
      "drmContentCDMInstalling"
-     ].forEach(function (value) {
+     ].forEach(function(value) {
         var notification = box.getNotificationWithValue(value);
         if (notification)
           box.removeNotification(notification);
       });
 
     // Don't bother creating it if it's already there:
     if (PopupNotifications.getNotification("drmContentPlaying", browser)) {
       return;
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -31,31 +31,31 @@ var StarUI = {
   // Array of command elements to disable when the panel is opened.
   get _blockedCommands() {
     delete this._blockedCommands;
     return this._blockedCommands =
       ["cmd_close", "cmd_closeWindow"].map(id => this._element(id));
   },
 
   _blockCommands: function SU__blockCommands() {
-    this._blockedCommands.forEach(function (elt) {
+    this._blockedCommands.forEach(function(elt) {
       // make sure not to permanently disable this item (see bug 409155)
       if (elt.hasAttribute("wasDisabled"))
         return;
       if (elt.getAttribute("disabled") == "true") {
         elt.setAttribute("wasDisabled", "true");
       } else {
         elt.setAttribute("wasDisabled", "false");
         elt.setAttribute("disabled", "true");
       }
     });
   },
 
   _restoreCommandsState: function SU__restoreCommandsState() {
-    this._blockedCommands.forEach(function (elt) {
+    this._blockedCommands.forEach(function(elt) {
       if (elt.getAttribute("wasDisabled") != "true")
         elt.removeAttribute("disabled");
       elt.removeAttribute("wasDisabled");
     });
   },
 
   // nsIDOMEventListener
   handleEvent(aEvent) {
@@ -193,17 +193,17 @@ var StarUI = {
     if (this._overlayLoaded) {
       this._doShowEditBookmarkPanel(aNode, aAnchorElement, aPosition);
       return;
     }
 
     this._overlayLoading = true;
     document.loadOverlay(
       "chrome://browser/content/places/editBookmarkOverlay.xul",
-      (function (aSubject, aTopic, aData) {
+      (function(aSubject, aTopic, aData) {
         // Move the header (star, title, button) into the grid,
         // so that it aligns nicely with the other items (bug 484022).
         let header = this._element("editBookmarkPanelHeader");
         let rows = this._element("editBookmarkPanelGrid").lastChild;
         rows.insertBefore(header, rows.firstChild);
         header.hidden = false;
 
         this._overlayLoading = false;
@@ -528,17 +528,17 @@ var PlacesCommandHook = {
    *        bookmarked.
    * @param aURL (string)
    *        the address of the link target
    * @param aTitle
    *        The link text
    * @param [optional] aDescription
    *        The linked page description, if available
    */
-  bookmarkLink: Task.async(function* (aParentId, aURL, aTitle, aDescription="") {
+  bookmarkLink: Task.async(function* (aParentId, aURL, aTitle, aDescription = "") {
     let node = yield PlacesUIUtils.fetchNodeLike({ url: aURL });
     if (node) {
       PlacesUIUtils.showBookmarkDialog({ action: "edit"
                                        , node
                                        }, window.top);
       return;
     }
 
@@ -1139,17 +1139,17 @@ var PlacesToolbarHelper = {
 
   _getShouldWrap: function PTH_getShouldWrap() {
     let placement = CustomizableUI.getPlacementOfWidget("personal-bookmarks");
     let area = placement && placement.area;
     let areaType = area && CustomizableUI.getAreaType(area);
     return !area || CustomizableUI.TYPE_MENU_PANEL == areaType;
   },
 
-  onPlaceholderCommand: function () {
+  onPlaceholderCommand: function() {
     let widgetGroup = CustomizableUI.getWidget("personal-bookmarks");
     let widget = widgetGroup.forWindow(window);
     if (widget.overflowed ||
         widgetGroup.areaType == CustomizableUI.TYPE_MENU_PANEL) {
       PlacesCommandHook.showPlacesOrganizer("BookmarksToolbar");
     }
   },
 
@@ -1898,21 +1898,21 @@ var BookmarkingUI = {
         // Only need to update the UI if it wasn't marked as starred before:
         if (this._itemIds.length == 1) {
           this._updateStar();
         }
       }
     }
   },
 
-  onBeginUpdateBatch: function () {},
-  onEndUpdateBatch: function () {},
-  onBeforeItemRemoved: function () {},
-  onItemVisited: function () {},
-  onItemMoved: function () {},
+  onBeginUpdateBatch: function() {},
+  onEndUpdateBatch: function() {},
+  onBeforeItemRemoved: function() {},
+  onItemVisited: function() {},
+  onItemMoved: function() {},
 
   // CustomizableUI events:
   _starButtonLabel: null,
   get _starButtonOverflowedLabel() {
     delete this._starButtonOverflowedLabel;
     return this._starButtonOverflowedLabel =
       gNavigatorBundle.getString("starButtonOverflowed.label");
   },
--- a/browser/base/content/browser-plugins.js
+++ b/browser/base/content/browser-plugins.js
@@ -12,39 +12,39 @@ var gPluginHandler = {
     "PluginContent:UpdateHiddenPluginUI",
     "PluginContent:HideNotificationBar",
     "PluginContent:InstallSinglePlugin",
     "PluginContent:ShowPluginCrashedNotification",
     "PluginContent:SubmitReport",
     "PluginContent:LinkClickCallback",
   ],
 
-  init: function () {
+  init: function() {
     const mm = window.messageManager;
     for (let msg of this.MESSAGES) {
       mm.addMessageListener(msg, this);
     }
     window.addEventListener("unload", this);
   },
 
-  uninit: function () {
+  uninit: function() {
     const mm = window.messageManager;
     for (let msg of this.MESSAGES) {
       mm.removeMessageListener(msg, this);
     }
     window.removeEventListener("unload", this);
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     if (event.type == "unload") {
       this.uninit();
     }
   },
 
-  receiveMessage: function (msg) {
+  receiveMessage: function(msg) {
     switch (msg.name) {
       case "PluginContent:ShowClickToPlayNotification":
         this.showClickToPlayNotification(msg.target, msg.data.plugins, msg.data.showNow,
                                          msg.principal, msg.data.location);
         break;
       case "PluginContent:RemoveNotification":
         this.removeNotification(msg.target, msg.data.name);
         break;
@@ -78,17 +78,17 @@ var gPluginHandler = {
         break;
       default:
         Cu.reportError("gPluginHandler did not expect to handle message " + msg.name);
         break;
     }
   },
 
   // Callback for user clicking on a disabled plugin
-  managePlugins: function () {
+  managePlugins: function() {
     BrowserOpenAddonsMgr("addons://list/plugin");
   },
 
   // Callback for user clicking on the link in a click-to-play plugin
   // (where the plugin has an update)
   openPluginUpdatePage: function(pluginTag) {
     let url = Services.blocklist.getPluginInfoURL(pluginTag);
     if (!url) {
@@ -101,22 +101,22 @@ var gPluginHandler = {
     if (!AppConstants.MOZ_CRASHREPORTER) {
       return;
     }
     Services.prefs.setBoolPref("dom.ipc.plugins.reportCrashURL", submitURLOptIn);
     PluginCrashReporter.submitCrashReport(runID, keyVals);
   },
 
   // Callback for user clicking a "reload page" link
-  reloadPage: function (browser) {
+  reloadPage: function(browser) {
     browser.reload();
   },
 
   // Callback for user clicking the help icon
-  openHelpPage: function () {
+  openHelpPage: function() {
     openHelpLink("plugin-crashed", false);
   },
 
   _clickToPlayNotificationEventCallback: function PH_ctpEventCallback(event) {
     if (event == "showing") {
       Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_SHOWN")
         .add(!this.options.primaryPlugin);
       // Histograms always start at 0, even though our data starts at 1
@@ -134,17 +134,17 @@ var gPluginHandler = {
     }
   },
 
   /**
    * Called from the plugin doorhanger to set the new permissions for a plugin
    * and activate plugins if necessary.
    * aNewState should be either "allownow" "allowalways" or "block"
    */
-  _updatePluginPermission: function (aNotification, aPluginInfo, aNewState) {
+  _updatePluginPermission: function(aNotification, aPluginInfo, aNewState) {
     let permission;
     let expireType;
     let expireTime;
     let histogram =
       Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_USER_ACTION");
 
     // Update the permission manager.
     // Also update the current state of pluginInfo.fallbackType so that
@@ -203,18 +203,18 @@ var gPluginHandler = {
     }
 
     browser.messageManager.sendAsyncMessage("BrowserPlugins:ActivatePlugins", {
       pluginInfo: aPluginInfo,
       newState: aNewState,
     });
   },
 
-  showClickToPlayNotification: function (browser, plugins, showNow,
-                                         principal, location) {
+  showClickToPlayNotification: function(browser, plugins, showNow,
+                                        principal, location) {
     // It is possible that we've received a message from the frame script to show
     // a click to play notification for a principal that no longer matches the one
     // that the browser's content now has assigned (ie, the browser has browsed away
     // after the message was sent, but before the message was received). In that case,
     // we should just ignore the message.
     if (!principal.equals(browser.contentPrincipal)) {
       return;
     }
@@ -284,31 +284,31 @@ var gPluginHandler = {
       principal: principal,
     };
     PopupNotifications.show(browser, "click-to-play-plugins",
                             "", "plugins-notification-icon",
                             null, null, options);
     browser.messageManager.sendAsyncMessage("BrowserPlugins:NotificationShown");
   },
 
-  removeNotification: function (browser, name) {
+  removeNotification: function(browser, name) {
     let notification = PopupNotifications.getNotification(name, browser);
     if (notification)
       PopupNotifications.remove(notification);
   },
 
-  hideNotificationBar: function (browser, name) {
+  hideNotificationBar: function(browser, name) {
     let notificationBox = gBrowser.getNotificationBox(browser);
     let notification = notificationBox.getNotificationWithValue(name);
     if (notification)
       notificationBox.removeNotification(notification, true);
   },
 
-  updateHiddenPluginUI: function (browser, haveInsecure, actions,
-                                  principal, location) {
+  updateHiddenPluginUI: function(browser, haveInsecure, actions,
+                                 principal, location) {
     let origin = principal.originNoSuffix;
 
     // It is possible that we've received a message from the frame script to show
     // the hidden plugin notification for a principal that no longer matches the one
     // that the browser's content now has assigned (ie, the browser has browsed away
     // after the message was sent, but before the message was received). In that case,
     // we should just ignore the message.
     if (!principal.equals(browser.contentPrincipal)) {
@@ -431,17 +431,17 @@ var gPluginHandler = {
       if (notificationPermission == Ci.nsIPermissionManager.DENY_ACTION) {
         hideNotification();
       } else {
         showNotification();
       }
     }
   },
 
-  contextMenuCommand: function (browser, plugin, command) {
+  contextMenuCommand: function(browser, plugin, command) {
     browser.messageManager.sendAsyncMessage("BrowserPlugins:ContextMenuCommand",
       { command: command }, { plugin: plugin });
   },
 
   // Crashed-plugin observer. Notified once per plugin crash, before events
   // are dispatched to individual plugin instances.
   NPAPIPluginCrashed : function(subject, topic, data) {
     let propertyBag = subject;
@@ -487,17 +487,17 @@ var gPluginHandler = {
    *        The browser to show the notification for.
    * @param messageString
    *        The string to put in the notification bar
    * @param pluginID
    *        The unique-per-process identifier for the NPAPI plugin or GMP.
    *        For a GMP, this is the pluginID. For NPAPI plugins (where "pluginID"
    *        means something different), this is the runID.
    */
-  showPluginCrashedNotification: function (browser, messageString, pluginID) {
+  showPluginCrashedNotification: function(browser, messageString, pluginID) {
     // If there's already an existing notification bar, don't do anything.
     let notificationBox = gBrowser.getNotificationBox(browser);
     let notification = notificationBox.getNotificationWithValue("plugin-crashed");
     if (notification) {
       return;
     }
 
     // Configure the notification bar
--- a/browser/base/content/browser-refreshblocker.js
+++ b/browser/base/content/browser-refreshblocker.js
@@ -63,17 +63,17 @@ var RefreshBlocker = {
       let refreshButtonText =
         gNavigatorBundle.getString("refreshBlocked.goButton");
       let refreshButtonAccesskey =
         gNavigatorBundle.getString("refreshBlocked.goButton.accesskey");
 
       let buttons = [{
         label: refreshButtonText,
         accessKey: refreshButtonAccesskey,
-        callback: function (notification, button) {
+        callback: function() {
           if (browser.messageManager) {
             browser.messageManager.sendAsyncMessage("RefreshBlocker:Refresh", data);
           }
         }
       }];
 
       notificationBox.appendNotification(message, "refresh-blocked",
                                          "chrome://browser/skin/Info.png",
--- a/browser/base/content/browser-syncui.js
+++ b/browser/base/content/browser-syncui.js
@@ -34,17 +34,17 @@ var gSyncUI = {
   ],
 
   _unloaded: false,
   // The last sync start time. Used to calculate the leftover animation time
   // once syncing completes (bug 1239042).
   _syncStartTime: 0,
   _syncAnimationTimer: 0,
 
-  init: function () {
+  init: function() {
     Cu.import("resource://services-common/stringbundle.js");
 
     // Proceed to set up the UI if Sync has already started up.
     // Otherwise we'll do it when Sync is firing up.
     if (this.weaveService.ready) {
       this.initUI();
       return;
     }
@@ -132,17 +132,17 @@ var gSyncUI = {
     // Otherwise we are configured for legacy Sync, which has no verification
     // concept.
     return Promise.resolve(false);
   },
 
   // Note that we don't show login errors in a notification bar here, but do
   // still need to track a login-failed state so the "Tools" menu updates
   // with the correct state.
-  _loginFailed: function () {
+  _loginFailed: function() {
     // If Sync isn't already ready, we don't want to force it to initialize
     // by referencing Weave.Status - and it isn't going to be accurate before
     // Sync is ready anyway.
     if (!this.weaveService.ready) {
       this.log.debug("_loginFailed has sync not ready, so returning false");
       return false;
     }
     this.log.debug("_loginFailed has sync state=${sync}",
@@ -237,17 +237,17 @@ var gSyncUI = {
     // the hamburger menu.
     this.updateUI();
   },
 
   onLogout: function SUI_onLogout() {
     this.updateUI();
   },
 
-  _getAppName: function () {
+  _getAppName: function() {
     let brand = new StringBundle("chrome://branding/locale/brand.properties");
     return brand.get("brandShortName");
   },
 
   // Commands
   // doSync forces a sync - it *does not* return a promise as it is called
   // via the various UI components.
   doSync() {
@@ -299,33 +299,33 @@ var gSyncUI = {
         window.openDialog("chrome://browser/content/sync/setup.xul",
                           "weaveSetup", "centerscreen,chrome,resizable=no",
                           wizardType);
       }
     }
   },
 
   // Open the legacy-sync device pairing UI. Note used for FxA Sync.
-  openAddDevice: function () {
+  openAddDevice: function() {
     if (!Weave.Utils.ensureMPUnlocked())
       return;
 
     let win = Services.wm.getMostRecentWindow("Sync:AddDevice");
     if (win)
       win.focus();
     else
       window.openDialog("chrome://browser/content/sync/addDevice.xul",
                         "syncAddDevice", "centerscreen,chrome,resizable=no");
   },
 
-  openPrefs: function (entryPoint) {
+  openPrefs: function(entryPoint) {
     openPreferences("paneSync", { urlParams: { entrypoint: entryPoint } });
   },
 
-  openSignInAgainPage: function (entryPoint = "syncbutton") {
+  openSignInAgainPage: function(entryPoint = "syncbutton") {
     gFxAccounts.openSignInAgainPage(entryPoint);
   },
 
   openSyncedTabsPanel() {
     let placement = CustomizableUI.getPlacementOfWidget("sync-button");
     let area = placement ? placement.area : CustomizableUI.AREA_NAVBAR;
     let anchor = document.getElementById("sync-button") ||
                  document.getElementById("PanelUI-menu-button");
@@ -421,20 +421,20 @@ var gSyncUI = {
         broadcaster.removeAttribute("tooltiptext");
       }
     }
   }),
 
   formatLastSyncDate: function(date) {
     let dateFormat;
     let sixDaysAgo = (() => {
-      let date = new Date();
-      date.setDate(date.getDate() - 6);
-      date.setHours(0, 0, 0, 0);
-      return date;
+      let tempDate = new Date();
+      tempDate.setDate(tempDate.getDate() - 6);
+      tempDate.setHours(0, 0, 0, 0);
+      return tempDate;
     })();
     // It may be confusing for the user to see "Last Sync: Monday" when the last sync was a indeed a Monday but 3 weeks ago
     if (date < sixDaysAgo) {
       dateFormat = {month: 'long', day: 'numeric'};
     } else {
       dateFormat = {weekday: 'long', hour: 'numeric', minute: 'numeric'};
     }
     let lastSyncDateString = date.toLocaleDateString(undefined, dateFormat);
--- a/browser/base/content/browser-tabsintitlebar-stub.js
+++ b/browser/base/content/browser-tabsintitlebar-stub.js
@@ -2,16 +2,16 @@
  * 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 file is used as a stub object for platforms which
 // don't have CAN_DRAW_IN_TITLEBAR defined.
 
 var TabsInTitlebar = {
-  init: function () {},
-  uninit: function () {},
-  allowedBy: function (condition, allow) {},
+  init: function() {},
+  uninit: function() {},
+  allowedBy: function(condition, allow) {},
   updateAppearance: function updateAppearance(aForce) {},
   get enabled() {
     return document.documentElement.getAttribute("tabsintitlebar") == "true";
   },
 };
--- a/browser/base/content/browser-tabsintitlebar.js
+++ b/browser/base/content/browser-tabsintitlebar.js
@@ -2,17 +2,17 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Note: the file browser-tabsintitlebar-stub.js is used instead of
 // this one on platforms which don't have CAN_DRAW_IN_TITLEBAR defined.
 
 var TabsInTitlebar = {
-  init: function () {
+  init: function() {
     if (this._initialized) {
       return;
     }
     this._readPref();
     Services.prefs.addObserver(this._prefName, this, false);
 
     // We need to update the appearance of the titlebar when the menu changes
     // from the active to the inactive state. We can't, however, rely on
@@ -44,17 +44,17 @@ var TabsInTitlebar = {
     if (this._updateOnInit) {
       // We don't need to call this with 'true', even if original calls
       // (before init()) did, because this will be the first call and so
       // we will update anyway.
       this._update();
     }
   },
 
-  allowedBy: function (condition, allow) {
+  allowedBy: function(condition, allow) {
     if (allow) {
       if (condition in this._disallowed) {
         delete this._disallowed[condition];
         this._update(true);
       }
     } else if (!(condition in this._disallowed)) {
       this._disallowed[condition] = null;
       this._update(true);
@@ -64,49 +64,49 @@ var TabsInTitlebar = {
   updateAppearance: function updateAppearance(aForce) {
     this._update(aForce);
   },
 
   get enabled() {
     return document.documentElement.getAttribute("tabsintitlebar") == "true";
   },
 
-  observe: function (subject, topic, data) {
+  observe: function(subject, topic, data) {
     if (topic == "nsPref:changed")
       this._readPref();
   },
 
-  handleEvent: function (aEvent) {
+  handleEvent: function(aEvent) {
     if (aEvent.type == "resolutionchange" && aEvent.target == window) {
       this._update(true);
     }
   },
 
-  _onMenuMutate: function (aMutations) {
+  _onMenuMutate: function(aMutations) {
     for (let mutation of aMutations) {
       if (mutation.attributeName == "inactive" ||
           mutation.attributeName == "autohide") {
         TabsInTitlebar._update(true);
         return;
       }
     }
   },
 
   _initialized: false,
   _updateOnInit: false,
   _disallowed: {},
   _prefName: "browser.tabs.drawInTitlebar",
   _lastSizeMode: null,
 
-  _readPref: function () {
+  _readPref: function() {
     this.allowedBy("pref",
                    Services.prefs.getBoolPref(this._prefName));
   },
 
-  _update: function (aForce=false) {
+  _update: function(aForce = false) {
     let $ = id => document.getElementById(id);
     let rect = ele => ele.getBoundingClientRect();
     let verticalMargins = cstyle => parseFloat(cstyle.marginBottom) + parseFloat(cstyle.marginTop);
 
     if (window.fullScreen)
       return;
 
     // In some edgecases it is possible for this to fire before we've initialized.
@@ -248,22 +248,22 @@ var TabsInTitlebar = {
     }
 
     ToolbarIconColor.inferFromText();
     if (CustomizationHandler.isCustomizing()) {
       gCustomizeMode.updateLWTStyling();
     }
   },
 
-  _sizePlaceholder: function (type, width) {
-    Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='"+ type +"']"),
-                  function (node) { node.width = width; });
+  _sizePlaceholder: function(type, width) {
+    Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='" + type + "']"),
+                  function(node) { node.width = width; });
   },
 
-  uninit: function () {
+  uninit: function() {
     this._initialized = false;
     removeEventListener("resolutionchange", this);
     Services.prefs.removeObserver(this._prefName, this);
     this._menuObserver.disconnect();
     CustomizableUI.removeListener(this);
   }
 };
 
--- a/browser/base/content/browser-thumbnails.js
+++ b/browser/base/content/browser-thumbnails.js
@@ -31,29 +31,29 @@ var gBrowserThumbnails = {
   init: function Thumbnails_init() {
     PageThumbs.addExpirationFilter(this);
     gBrowser.addTabsProgressListener(this);
     Services.prefs.addObserver(this.PREF_DISK_CACHE_SSL, this, false);
 
     this._sslDiskCacheEnabled =
       Services.prefs.getBoolPref(this.PREF_DISK_CACHE_SSL);
 
-    this._tabEvents.forEach(function (aEvent) {
+    this._tabEvents.forEach(function(aEvent) {
       gBrowser.tabContainer.addEventListener(aEvent, this, false);
     }, this);
 
     this._timeouts = new WeakMap();
   },
 
   uninit: function Thumbnails_uninit() {
     PageThumbs.removeExpirationFilter(this);
     gBrowser.removeTabsProgressListener(this);
     Services.prefs.removeObserver(this.PREF_DISK_CACHE_SSL, this);
 
-    this._tabEvents.forEach(function (aEvent) {
+    this._tabEvents.forEach(function(aEvent) {
       gBrowser.tabContainer.removeEventListener(aEvent, this, false);
     }, this);
   },
 
   handleEvent: function Thumbnails_handleEvent(aEvent) {
     switch (aEvent.type) {
       case "scroll":
         let browser = aEvent.currentTarget;
@@ -89,30 +89,30 @@ var gBrowserThumbnails = {
         aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK)
       this._delayedCapture(aBrowser);
   },
 
   _capture: function Thumbnails_capture(aBrowser) {
     // Only capture about:newtab top sites.
     if (this._topSiteURLs.indexOf(aBrowser.currentURI.spec) == -1)
       return;
-    this._shouldCapture(aBrowser, function (aResult) {
+    this._shouldCapture(aBrowser, function(aResult) {
       if (aResult) {
         PageThumbs.captureAndStoreIfStale(aBrowser);
       }
     });
   },
 
   _delayedCapture: function Thumbnails_delayedCapture(aBrowser) {
     if (this._timeouts.has(aBrowser))
       clearTimeout(this._timeouts.get(aBrowser));
     else
       aBrowser.addEventListener("scroll", this, true);
 
-    let timeout = setTimeout(function () {
+    let timeout = setTimeout(function() {
       this._clearTimeout(aBrowser);
       this._capture(aBrowser);
     }.bind(this), this._captureDelayMS);
 
     this._timeouts.set(aBrowser, timeout);
   },
 
   _shouldCapture: function Thumbnails_shouldCapture(aBrowser, aCallback) {
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -92,17 +92,17 @@ XPCOMUtils.defineLazyGetter(this, "gBrow
 });
 
 XPCOMUtils.defineLazyGetter(this, "gCustomizeMode", function() {
   let scope = {};
   Cu.import("resource:///modules/CustomizeMode.jsm", scope);
   return new scope.CustomizeMode(window);
 });
 
-XPCOMUtils.defineLazyGetter(window, "gShowPageResizers", function () {
+XPCOMUtils.defineLazyGetter(window, "gShowPageResizers", function() {
   // Only show resizers on Windows 2000 and XP
   return AppConstants.isPlatformAndVersionAtMost("win", "5.9");
 });
 
 XPCOMUtils.defineLazyGetter(this, "gPrefService", function() {
   return Services.prefs;
 });
 
@@ -113,42 +113,42 @@ XPCOMUtils.defineLazyGetter(this, "Inlin
 });
 
 XPCOMUtils.defineLazyGetter(this, "PageMenuParent", function() {
   let tmp = {};
   Cu.import("resource://gre/modules/PageMenu.jsm", tmp);
   return new tmp.PageMenuParent();
 });
 
-XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function () {
+XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function() {
   let tmp = {};
   Cu.import("resource://gre/modules/PopupNotifications.jsm", tmp);
   try {
     return new tmp.PopupNotifications(gBrowser,
                                       document.getElementById("notification-popup"),
                                       document.getElementById("notification-popup-box"));
   } catch (ex) {
     Cu.reportError(ex);
     return null;
   }
 });
 
-XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
+XPCOMUtils.defineLazyGetter(this, "Win7Features", function() {
   if (AppConstants.platform != "win")
     return null;
 
   const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
   if (WINTASKBAR_CONTRACTID in Cc &&
       Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
     let AeroPeek = Cu.import("resource:///modules/WindowsPreviewPerTab.jsm", {}).AeroPeek;
     return {
-      onOpenWindow: function () {
+      onOpenWindow: function() {
         AeroPeek.onOpenWindow(window);
       },
-      onCloseWindow: function () {
+      onCloseWindow: function() {
         AeroPeek.onCloseWindow(window);
       }
     };
   }
   return null;
 });
 
 
@@ -172,26 +172,26 @@ if (AppConstants.platform != "macosx") {
 }
 
 /* globals gBrowser, gNavToolbox, gURLBar, gNavigatorBundle*/
 [
   ["gBrowser",            "content"],
   ["gNavToolbox",         "navigator-toolbox"],
   ["gURLBar",             "urlbar"],
   ["gNavigatorBundle",    "bundle_browser"]
-].forEach(function (elementGlobal) {
+].forEach(function(elementGlobal) {
   var [name, id] = elementGlobal;
-  window.__defineGetter__(name, function () {
+  window.__defineGetter__(name, function() {
     var element = document.getElementById(id);
     if (!element)
       return null;
     delete window[name];
     return window[name] = element;
   });
-  window.__defineSetter__(name, function (val) {
+  window.__defineSetter__(name, function(val) {
     delete window[name];
     return window[name] = val;
   });
 });
 
 // Smart getter for the findbar.  If you don't wish to force the creation of
 // the findbar, check gFindBarInitialized first.
 
@@ -203,17 +203,17 @@ this.__defineGetter__("gFindBarInitializ
   return window.gBrowser.isFindBarInitialized();
 });
 
 this.__defineGetter__("AddonManager", function() {
   let tmp = {};
   Cu.import("resource://gre/modules/AddonManager.jsm", tmp);
   return this.AddonManager = tmp.AddonManager;
 });
-this.__defineSetter__("AddonManager", function (val) {
+this.__defineSetter__("AddonManager", function(val) {
   delete this.AddonManager;
   return this.AddonManager = val;
 });
 
 
 var gInitialPages = [
   "about:blank",
   "about:newtab",
@@ -425,28 +425,28 @@ function findChildShell(aDocument, aDocS
       return docShell;
   }
   return null;
 }
 
 var gPopupBlockerObserver = {
   _reportButton: null,
 
-  onReportButtonMousedown: function (aEvent)
+  onReportButtonMousedown: function(aEvent)
   {
     // If this method is called on the same event tick as the popup gets
     // hidden, do nothing to avoid re-opening the popup.
     if (aEvent.button != 0 || aEvent.target != this._reportButton || this.isPopupHidingTick)
       return;
 
     document.getElementById("blockedPopupOptions")
             .openPopup(this._reportButton, "after_end", 0, 2, false, false, aEvent);
   },
 
-  handleEvent: function (aEvent)
+  handleEvent: function(aEvent)
   {
     if (aEvent.originalTarget != gBrowser.selectedBrowser)
       return;
 
     if (!this._reportButton)
       this._reportButton = document.getElementById("page-report-button");
 
     if (!gBrowser.selectedBrowser.blockedPopups ||
@@ -507,30 +507,30 @@ var gPopupBlockerObserver = {
       }
 
       // Record the fact that we've reported this blocked popup, so we don't
       // show it again.
       gBrowser.selectedBrowser.blockedPopups.reported = true;
     }
   },
 
-  toggleAllowPopupsForSite: function (aEvent)
+  toggleAllowPopupsForSite: function(aEvent)
   {
     var pm = Services.perms;
     var shouldBlock = aEvent.target.getAttribute("block") == "true";
     var perm = shouldBlock ? pm.DENY_ACTION : pm.ALLOW_ACTION;
     pm.add(gBrowser.currentURI, "popup", perm);
 
     if (!shouldBlock)
       this.showAllBlockedPopups(gBrowser.selectedBrowser);
 
     gBrowser.getNotificationBox().removeCurrentNotification();
   },
 
-  fillPopupList: function (aEvent)
+  fillPopupList: function(aEvent)
   {
     // XXXben - rather than using |currentURI| here, which breaks down on multi-framed sites
     //          we should really walk the blockedPopups and create a list of "allow for <host>"
     //          menuitems for the common subset of hosts present in the report, this will
     //          make us frame-safe.
     //
     // XXXjst - Note that when this is fixed to work with multi-framed sites,
     //          also back out the fix for bug 343772 where
@@ -623,50 +623,50 @@ var gPopupBlockerObserver = {
 
       // Show the separator if we added any
       // showable popup addresses to the menu.
       if (foundUsablePopupURI)
         blockedPopupsSeparator.removeAttribute("hidden");
     }, null);
   },
 
-  onPopupHiding: function (aEvent) {
+  onPopupHiding: function(aEvent) {
     if (aEvent.target.anchorNode.id == "page-report-button")
       aEvent.target.anchorNode.removeAttribute("open");
 
     this.isPopupHidingTick = true;
     setTimeout(() => this.isPopupHidingTick = false, 0);
 
     let item = aEvent.target.lastChild;
     while (item && item.getAttribute("observes") != "blockedPopupsSeparator") {
       let next = item.previousSibling;
       item.parentNode.removeChild(item);
       item = next;
     }
   },
 
-  showBlockedPopup: function (aEvent)
+  showBlockedPopup: function(aEvent)
   {
     var target = aEvent.target;
     var popupReportIndex = target.getAttribute("popupReportIndex");
     let browser = target.popupReportBrowser;
     browser.unblockPopup(popupReportIndex);
   },
 
-  showAllBlockedPopups: function (aBrowser)
+  showAllBlockedPopups: function(aBrowser)
   {
     aBrowser.retrieveListOfBlockedPopups().then(popups => {
       for (let i = 0; i < popups.length; i++) {
         if (popups[i].popupWindowURIspec)
           aBrowser.unblockPopup(i);
       }
     }, null);
   },
 
-  editPopupSettings: function ()
+  editPopupSettings: function()
   {
     var host = "";
     try {
       host = gBrowser.currentURI.host;
     }
     catch (e) { }
 
     var bundlePreferences = document.getElementById("bundle_preferences");
@@ -682,17 +682,17 @@ var gPopupBlockerObserver = {
       existingWindow.initWithParams(params);
       existingWindow.focus();
     }
     else
       window.openDialog("chrome://browser/content/preferences/permissions.xul",
                         "_blank", "resizable,dialog=no,centerscreen", params);
   },
 
-  dontShowMessage: function ()
+  dontShowMessage: function()
   {
     var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
     gPrefService.setBoolPref("privacy.popups.showBrowserMessage", !showMessage);
     gBrowser.getNotificationBox().removeCurrentNotification();
   }
 };
 
 function gKeywordURIFixup({ target: browser, data: fixupInfo }) {
@@ -752,29 +752,29 @@ function gKeywordURIFixup({ target: brow
   // 1097347366913 (ff7f000001) gets resolved by using the final bytes,
   // making it the same as 7f000001, which is 127.0.0.1 aka localhost.
   // While 2130706433 would get normalized by network, 1097347366913
   // does not, and we have to deal with both cases here:
   if (isIPv4Address(asciiHost) || /^(?:\d+|0x[a-f0-9]+)$/i.test(asciiHost))
     return;
 
   let onLookupComplete = (request, record, status) => {
-    let browser = weakBrowser.get();
-    if (!Components.isSuccessCode(status) || !browser)
+    let browserRef = weakBrowser.get();
+    if (!Components.isSuccessCode(status) || !browserRef)
       return;
 
-    let currentURI = browser.currentURI;
+    let currentURI = browserRef.currentURI;
     // If we're in case (3) (see above), don't show an info bar.
     if (!currentURI.equals(previousURI) &&
         !currentURI.equals(preferredURI)) {
       return;
     }
 
     // show infobar offering to visit the host
-    let notificationBox = gBrowser.getNotificationBox(browser);
+    let notificationBox = gBrowser.getNotificationBox(browserRef);
     if (notificationBox.getNotificationWithValue("keyword-uri-fixup"))
       return;
 
     let message = gNavigatorBundle.getFormattedString(
       "keywordURIFixup.message", [hostName]);
     let yesMessage = gNavigatorBundle.getFormattedString(
       "keywordURIFixup.goTo", [hostName])
 
@@ -1059,17 +1059,17 @@ var gBrowserInit = {
 
     // Wait until chrome is painted before executing code not critical to making the window visible
     this._boundDelayedStartup = this._delayedStartup.bind(this);
     window.addEventListener("MozAfterPaint", this._boundDelayedStartup);
 
     this._loadHandled = true;
   },
 
-  _cancelDelayedStartup: function () {
+  _cancelDelayedStartup: function() {
     window.removeEventListener("MozAfterPaint", this._boundDelayedStartup);
     this._boundDelayedStartup = null;
   },
 
   _delayedStartup: function() {
     let tmp = {};
     Cu.import("resource://gre/modules/TelemetryTimestamps.jsm", tmp);
     let TelemetryTimestamps = tmp.TelemetryTimestamps;
@@ -1233,17 +1233,16 @@ var gBrowserInit = {
     UpdateUrlbarSearchSplitterState();
 
     if (!(isBlankPageURL(uriToLoad) || uriToLoad == "about:privatebrowsing") ||
         !focusAndSelectUrlBar()) {
       if (gBrowser.selectedBrowser.isRemoteBrowser) {
         // If the initial browser is remote, in order to optimize for first paint,
         // we'll defer switching focus to that browser until it has painted.
         let focusedElement = document.commandDispatcher.focusedElement;
-        let mm = window.messageManager;
         mm.addMessageListener("Browser:FirstPaint", function onFirstPaint() {
           mm.removeMessageListener("Browser:FirstPaint", onFirstPaint);
           // If focus didn't move while we were waiting for first paint, we're okay
           // to move to the browser.
           if (document.commandDispatcher.focusedElement == focusedElement) {
             gBrowser.selectedBrowser.focus();
           }
         });
@@ -1438,17 +1437,17 @@ var gBrowserInit = {
 
     this.delayedStartupFinished = true;
 
     Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
     TelemetryTimestamps.add("delayedStartupFinished");
   },
 
   // Returns the URI(s) to load at startup.
-  _getUriToLoad: function () {
+  _getUriToLoad: function() {
     // window.arguments[0]: URI to load (string), or an nsIArray of
     //                      nsISupportsStrings to load, or a xul:tab of
     //                      a tabbrowser, which will be replaced by this
     //                      window (for this case, all other arguments are
     //                      ignored).
     if (!window.arguments || !window.arguments[0])
       return null;
 
@@ -2543,96 +2542,96 @@ var gMenuButtonBadgeManager = {
   BADGEID_APPUPDATE: "update",
   BADGEID_DOWNLOAD: "download",
   BADGEID_FXA: "fxa",
 
   fxaBadge: null,
   downloadBadge: null,
   appUpdateBadge: null,
 
-  init: function () {
+  init: function() {
     PanelUI.panel.addEventListener("popupshowing", this, true);
   },
 
-  uninit: function () {
+  uninit: function() {
     PanelUI.panel.removeEventListener("popupshowing", this, true);
   },
 
-  handleEvent: function (e) {
+  handleEvent: function(e) {
     if (e.type === "popupshowing") {
       this.clearBadges();
     }
   },
 
-  _showBadge: function () {
+  _showBadge: function() {
     let badgeToShow = this.downloadBadge || this.appUpdateBadge || this.fxaBadge;
 
     if (badgeToShow) {
       PanelUI.menuButton.setAttribute("badge-status", badgeToShow);
     } else {
       PanelUI.menuButton.removeAttribute("badge-status");
     }
   },
 
-  _changeBadge: function (badgeId, badgeStatus = null) {
+  _changeBadge: function(badgeId, badgeStatus = null) {
     if (badgeId == this.BADGEID_APPUPDATE) {
       this.appUpdateBadge = badgeStatus;
     } else if (badgeId == this.BADGEID_DOWNLOAD) {
       this.downloadBadge = badgeStatus;
     } else if (badgeId == this.BADGEID_FXA) {
       this.fxaBadge = badgeStatus;
     } else {
       Cu.reportError("The badge ID '" + badgeId + "' is unknown!");
     }
     this._showBadge();
   },
 
-  addBadge: function (badgeId, badgeStatus) {
+  addBadge: function(badgeId, badgeStatus) {
     if (!badgeStatus) {
       Cu.reportError("badgeStatus must be defined");
       return;
     }
     this._changeBadge(badgeId, badgeStatus);
   },
 
-  removeBadge: function (badgeId) {
+  removeBadge: function(badgeId) {
     this._changeBadge(badgeId);
   },
 
-  clearBadges: function () {
+  clearBadges: function() {
     this.appUpdateBadge = null;
     this.downloadBadge = null;
     this.fxaBadge = null;
     this._showBadge();
   }
 };
 
 // Setup the hamburger button badges for updates, if enabled.
 var gMenuButtonUpdateBadge = {
   enabled: false,
   badgeWaitTime: 0,
   timer: null,
   cancelObserverRegistered: false,
 
-  init: function () {
+  init: function() {
     try {
       this.enabled = Services.prefs.getBoolPref("app.update.badge");
     } catch (e) {}
     if (this.enabled) {
       try {
         this.badgeWaitTime = Services.prefs.getIntPref("app.update.badgeWaitTime");
       } catch (e) {
         this.badgeWaitTime = 345600; // 4 days
       }
       Services.obs.addObserver(this, "update-staged", false);
       Services.obs.addObserver(this, "update-downloaded", false);
     }
   },
 
-  uninit: function () {
+  uninit: function() {
     if (this.timer)
       this.timer.cancel();
     if (this.enabled) {
       Services.obs.removeObserver(this, "update-staged");
       Services.obs.removeObserver(this, "update-downloaded");
       this.enabled = false;
     }
     if (this.cancelObserverRegistered) {
@@ -2653,17 +2652,17 @@ var gMenuButtonUpdateBadge = {
       }
     } else {
       // open the page for manual update
       let url = Services.urlFormatter.formatURLPref("app.update.url.manual");
       openUILinkIn(url, "tab");
     }
   },
 
-  observe: function (subject, topic, status) {
+  observe: function(subject, topic, status) {
     if (topic == "update-canceled") {
       this.reset();
       return;
     }
     if (status == "failed") {
       // Background update has failed, let's show the UI responsible for
       // prompting the user to update manually.
       this.uninit();
@@ -2673,25 +2672,25 @@ var gMenuButtonUpdateBadge = {
 
     // Give the user badgeWaitTime seconds to react before prompting.
     this.timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     this.timer.initWithCallback(this, this.badgeWaitTime * 1000,
                                 this.timer.TYPE_ONE_SHOT);
     // The timer callback will call uninit() when it completes.
   },
 
-  notify: function () {
+  notify: function() {
     // If the update is successfully applied, or if the updater has fallen back
     // to non-staged updates, add a badge to the hamburger menu to indicate an
     // update will be applied once the browser restarts.
     this.uninit();
     this.displayBadge(true);
   },
 
-  displayBadge: function (succeeded) {
+  displayBadge: function(succeeded) {
     let status = succeeded ? "succeeded" : "failed";
     let badgeStatus = "update-" + status;
     gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_APPUPDATE, badgeStatus);
 
     let stringId;
     let updateButtonText;
     if (succeeded) {
       let brandBundle = document.getElementById("bundle_brand");
@@ -2707,17 +2706,17 @@ var gMenuButtonUpdateBadge = {
     }
 
     let updateButton = document.getElementById("PanelUI-update-status");
     updateButton.setAttribute("label", updateButtonText);
     updateButton.setAttribute("update-status", status);
     updateButton.hidden = false;
   },
 
-  reset: function () {
+  reset: function() {
     gMenuButtonBadgeManager.removeBadge(
       gMenuButtonBadgeManager.BADGEID_APPUPDATE);
     let updateButton = document.getElementById("PanelUI-update-status");
     updateButton.hidden = true;
     this.uninit();
     this.init();
   }
 };
@@ -2735,43 +2734,43 @@ const PREF_SSL_IMPACT = PREF_SSL_IMPACT_
 }, []);
 
 /**
  * Handle command events bubbling up from error page content
  * or from about:newtab or from remote error pages that invoke
  * us via async messaging.
  */
 var BrowserOnClick = {
-  init: function () {
+  init: function() {
     let mm = window.messageManager;
     mm.addMessageListener("Browser:CertExceptionError", this);
     mm.addMessageListener("Browser:SiteBlockedError", this);
     mm.addMessageListener("Browser:EnableOnlineMode", this);
     mm.addMessageListener("Browser:SendSSLErrorReport", this);
     mm.addMessageListener("Browser:SetSSLErrorReportAuto", this);
     mm.addMessageListener("Browser:ResetSSLPreferences", this);
     mm.addMessageListener("Browser:SSLErrorReportTelemetry", this);
     mm.addMessageListener("Browser:OverrideWeakCrypto", this);
     mm.addMessageListener("Browser:SSLErrorGoBack", this);
   },
 
-  uninit: function () {
+  uninit: function() {
     let mm = window.messageManager;
     mm.removeMessageListener("Browser:CertExceptionError", this);
     mm.removeMessageListener("Browser:SiteBlockedError", this);
     mm.removeMessageListener("Browser:EnableOnlineMode", this);
     mm.removeMessageListener("Browser:SendSSLErrorReport", this);
     mm.removeMessageListener("Browser:SetSSLErrorReportAuto", this);
     mm.removeMessageListener("Browser:ResetSSLPreferences", this);
     mm.removeMessageListener("Browser:SSLErrorReportTelemetry", this);
     mm.removeMessageListener("Browser:OverrideWeakCrypto", this);
     mm.removeMessageListener("Browser:SSLErrorGoBack", this);
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     if (!event.isTrusted || // Don't trust synthetic events
         event.button == 2) {
       return;
     }
 
     let originalTarget = event.originalTarget;
     let ownerDoc = originalTarget.ownerDocument;
     if (!ownerDoc) {
@@ -2779,17 +2778,17 @@ var BrowserOnClick = {
     }
 
     if (gMultiProcessBrowser &&
         ownerDoc.documentURI.toLowerCase() == "about:newtab") {
       this.onE10sAboutNewTab(event, ownerDoc);
     }
   },
 
-  receiveMessage: function (msg) {
+  receiveMessage: function(msg) {
     switch (msg.name) {
       case "Browser:CertExceptionError":
         this.onCertError(msg.target, msg.data.elementId,
                          msg.data.isTopFrame, msg.data.location,
                          msg.data.securityInfoAsString);
       break;
       case "Browser:SiteBlockedError":
         this.onAboutBlocked(msg.data.elementId, msg.data.reason,
@@ -2851,17 +2850,17 @@ var BrowserOnClick = {
     transportSecurityInfo.QueryInterface(Ci.nsITransportSecurityInfo)
 
     let errorReporter = Cc["@mozilla.org/securityreporter;1"]
                           .getService(Ci.nsISecurityReporter);
     errorReporter.reportTLSError(transportSecurityInfo,
                                  uri.host, uri.port);
   },
 
-  onCertError: function (browser, elementId, isTopFrame, location, securityInfoAsString) {
+  onCertError: function(browser, elementId, isTopFrame, location, securityInfoAsString) {
     let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI");
     let securityInfo;
 
     switch (elementId) {
       case "exceptionDialogButton":
         if (isTopFrame) {
           secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_BAD_CERT_TOP_CLICK_ADD_EXCEPTION);
         }
@@ -2920,17 +2919,17 @@ var BrowserOnClick = {
         let detailedInfo = getDetailedCertErrorInfo(location,
                                                     securityInfo);
         gClipboardHelper.copyString(detailedInfo);
         break;
 
     }
   },
 
-  onAboutBlocked: function (elementId, reason, isTopFrame, location) {
+  onAboutBlocked: function(elementId, reason, isTopFrame, location) {
     // Depending on what page we are displaying here (malware/phishing/unwanted)
     // use the right strings and links for each.
     let bucketName = "";
     let sendTelemetry = false;
     if (reason === 'malware') {
       sendTelemetry = true;
       bucketName = "WARNING_MALWARE_PAGE_";
     } else if (reason === 'phishing') {
@@ -2991,17 +2990,17 @@ var BrowserOnClick = {
     if (anchorTarget instanceof HTMLAnchorElement &&
         anchorTarget.classList.contains("newtab-link")) {
       event.preventDefault();
       let where = whereToOpenLink(event, false, false);
       openLinkIn(anchorTarget.href, where, { charset: ownerDoc.characterSet, referrerURI: ownerDoc.documentURIObject });
     }
   },
 
-  ignoreWarningButton: function (reason) {
+  ignoreWarningButton: function(reason) {
     // Allow users to override and continue through to the site,
     // but add a notify bar as a reminder, so that they don't lose
     // track after, e.g., tab switching.
     gBrowser.loadURIWithFlags(gBrowser.currentURI.spec,
                               nsIWebNavigation.LOAD_FLAGS_BYPASS_CLASSIFIER,
                               null, null, null);
 
     Services.perms.add(gBrowser.currentURI, "safe-browsing",
@@ -3258,78 +3257,78 @@ function getPEMString(cert)
          + "\r\n-----END CERTIFICATE-----\r\n";
 }
 
 var PrintPreviewListener = {
   _printPreviewTab: null,
   _tabBeforePrintPreview: null,
   _simplifyPageTab: null,
 
-  getPrintPreviewBrowser: function () {
+  getPrintPreviewBrowser: function() {
     if (!this._printPreviewTab) {
       let browser = gBrowser.selectedTab.linkedBrowser;
       let forceNotRemote = gMultiProcessBrowser && !browser.isRemoteBrowser;
       this._tabBeforePrintPreview = gBrowser.selectedTab;
       this._printPreviewTab = gBrowser.loadOneTab("about:blank",
                                                   { inBackground: false,
                                                     forceNotRemote,
                                                     relatedBrowser: browser });
       gBrowser.selectedTab = this._printPreviewTab;
     }
     return gBrowser.getBrowserForTab(this._printPreviewTab);
   },
-  createSimplifiedBrowser: function () {
+  createSimplifiedBrowser: function() {
     this._simplifyPageTab = gBrowser.loadOneTab("about:blank",
                                                 { inBackground: true });
     return this.getSimplifiedSourceBrowser();
   },
-  getSourceBrowser: function () {
+  getSourceBrowser: function() {
     return this._tabBeforePrintPreview ?
       this._tabBeforePrintPreview.linkedBrowser : gBrowser.selectedBrowser;
   },
-  getSimplifiedSourceBrowser: function () {
+  getSimplifiedSourceBrowser: function() {
     return this._simplifyPageTab ?
       gBrowser.getBrowserForTab(this._simplifyPageTab) : null;
   },
-  getNavToolbox: function () {
+  getNavToolbox: function() {
     return gNavToolbox;
   },
-  onEnter: function () {
+  onEnter: function() {
     // We might have accidentally switched tabs since the user invoked print
     // preview
     if (gBrowser.selectedTab != this._printPreviewTab) {
       gBrowser.selectedTab = this._printPreviewTab;
     }
     gInPrintPreviewMode = true;
     this._toggleAffectedChrome();
   },
-  onExit: function () {
+  onExit: function() {
     gBrowser.selectedTab = this._tabBeforePrintPreview;
     this._tabBeforePrintPreview = null;
     gInPrintPreviewMode = false;
     this._toggleAffectedChrome();
     if (this._simplifyPageTab) {
       gBrowser.removeTab(this._simplifyPageTab);
       this._simplifyPageTab = null;
     }
     gBrowser.removeTab(this._printPreviewTab);
     gBrowser.deactivatePrintPreviewBrowsers();
     this._printPreviewTab = null;
   },
-  _toggleAffectedChrome: function () {
+  _toggleAffectedChrome: function() {
     gNavToolbox.collapsed = gInPrintPreviewMode;
 
     if (gInPrintPreviewMode)
       this._hideChrome();
     else
       this._showChrome();
 
     TabsInTitlebar.allowedBy("print-preview", !gInPrintPreviewMode);
   },
-  _hideChrome: function () {
+  _hideChrome: function() {
     this._chromeState = {};
 
     this._chromeState.sidebarOpen = SidebarUI.isOpen;
     this._sidebarCommand = SidebarUI.currentID;
     SidebarUI.hide();
 
     var notificationBox = gBrowser.getNotificationBox();
     this._chromeState.notificationsOpen = !notificationBox.notificationsHidden;
@@ -3347,17 +3346,17 @@ var PrintPreviewListener = {
 
     this._chromeState.syncNotificationsOpen = false;
     var syncNotifications = document.getElementById("sync-notifications");
     if (syncNotifications) {
       this._chromeState.syncNotificationsOpen = !syncNotifications.notificationsHidden;
       syncNotifications.notificationsHidden = true;
     }
   },
-  _showChrome: function () {
+  _showChrome: function() {
     if (this._chromeState.notificationsOpen)
       gBrowser.getNotificationBox().notificationsHidden = false;
 
     if (this._chromeState.findOpen)
       gFindBar.open();
 
     if (this._chromeState.globalNotificationsOpen)
       document.getElementById("global-notificationbox").notificationsHidden = false;
@@ -3383,47 +3382,47 @@ function getMarkupDocumentViewer()
 function FillInHTMLTooltip(tipElement)
 {
   document.getElementById("aHTMLTooltip").fillInPageTooltip(tipElement);
 }
 
 var browserDragAndDrop = {
   canDropLink: aEvent => Services.droppedLinkHandler.canDropLink(aEvent, true),
 
-  dragOver: function (aEvent)
+  dragOver: function(aEvent)
   {
     if (this.canDropLink(aEvent)) {
       aEvent.preventDefault();
     }
   },
 
-  dropLinks: function (aEvent, aDisallowInherit) {
+  dropLinks: function(aEvent, aDisallowInherit) {
     return Services.droppedLinkHandler.dropLinks(aEvent, aDisallowInherit);
   }
 };
 
 var homeButtonObserver = {
-  onDrop: function (aEvent)
+  onDrop: function(aEvent)
     {
       // disallow setting home pages that inherit the principal
       let links = browserDragAndDrop.dropLinks(aEvent, true);
       if (links.length) {
         setTimeout(openHomeDialog, 0, links.map(link => link.url).join("|"));
       }
     },
 
-  onDragOver: function (aEvent)
+  onDragOver: function(aEvent)
     {
       if (gPrefService.prefIsLocked("browser.startup.homepage")) {
         return;
       }
       browserDragAndDrop.dragOver(aEvent);
       aEvent.dropEffect = "link";
     },
-  onDragExit: function (aEvent)
+  onDragExit: function(aEvent)
     {
     }
 }
 
 function openHomeDialog(aURL)
 {
   var promptTitle = gNavigatorBundle.getString("droponhometitle");
   var promptMsg;
@@ -3440,17 +3439,17 @@ function openHomeDialog(aURL)
   if (pressedVal == 0) {
     try {
       var homepageStr = Components.classes["@mozilla.org/supports-string;1"]
                         .createInstance(Components.interfaces.nsISupportsString);
       homepageStr.data = aURL;
       gPrefService.setComplexValue("browser.startup.homepage",
                                    Components.interfaces.nsISupportsString, homepageStr);
     } catch (ex) {
-      dump("Failed to set the home page.\n"+ex+"\n");
+      dump("Failed to set the home page.\n" + ex + "\n");
     }
   }
 }
 
 var newTabButtonObserver = {
   onDragOver(aEvent) {
     browserDragAndDrop.dragOver(aEvent);
   },
@@ -3487,17 +3486,17 @@ var newWindowButtonObserver = {
 const DOMLinkHandler = {
   init: function() {
     let mm = window.messageManager;
     mm.addMessageListener("Link:AddFeed", this);
     mm.addMessageListener("Link:SetIcon", this);
     mm.addMessageListener("Link:AddSearch", this);
   },
 
-  receiveMessage: function (aMsg) {
+  receiveMessage: function(aMsg) {
     switch (aMsg.name) {
       case "Link:AddFeed":
         let link = {type: aMsg.data.type, href: aMsg.data.href, title: aMsg.data.title};
         FeedHandler.addFeed(link, aMsg.target);
         break;
 
       case "Link:SetIcon":
         this.setIcon(aMsg.target, aMsg.data.url, aMsg.data.loadingPrincipal);
@@ -3588,17 +3587,17 @@ const BrowserSearch = {
     if (window.location.href != getBrowserURL()) {
       var win = getTopWin();
       if (win) {
         // If there's an open browser window, it should handle this command
         win.focus();
         win.BrowserSearch.webSearch();
       } else {
         // If there are no open browser windows, open a new one
-        var observer = function observer(subject, topic, data) {
+        var observer = function(subject, topic, data) {
           if (subject == win) {
             BrowserSearch.webSearch();
             Services.obs.removeObserver(observer, "browser-delayed-startup-finished");
           }
         }
         win = window.openDialog(getBrowserURL(), "_blank",
                                 "chrome,all,dialog=no", "about:blank");
         Services.obs.addObserver(observer, "browser-delayed-startup-finished", false);
@@ -3654,17 +3653,17 @@ const BrowserSearch = {
    * @param purpose [optional]
    *        A string meant to indicate the context of the search request. This
    *        allows the search service to provide a different nsISearchSubmission
    *        depending on e.g. where the search is triggered in the UI.
    *
    * @return engine The search engine used to perform a search, or null if no
    *                search was performed.
    */
-  _loadSearch: function (searchText, useNewTab, purpose) {
+  _loadSearch: function(searchText, useNewTab, purpose) {
     let engine;
 
     // If the search bar is visible, use the current engine, otherwise, fall
     // back to the default engine.
     if (isElementVisible(this.searchBar))
       engine = Services.search.currentEngine;
     else
       engine = Services.search.defaultEngine;
@@ -3704,24 +3703,24 @@ const BrowserSearch = {
   },
 
   /**
    * Perform a search initiated from the context menu.
    *
    * This should only be called from the context menu. See
    * BrowserSearch.loadSearch for the preferred API.
    */
-  loadSearchFromContext: function (terms) {
+  loadSearchFromContext: function(terms) {
     let engine = BrowserSearch._loadSearch(terms, true, "contextmenu");
     if (engine) {
       BrowserSearch.recordSearchInTelemetry(engine, "contextmenu");
     }
   },
 
-  pasteAndSearch: function (event) {
+  pasteAndSearch: function(event) {
     BrowserSearch.searchBar.select();
     goDoCommand("cmd_paste");
     BrowserSearch.searchBar.handleSearchCommand(event);
   },
 
   /**
    * Returns the search bar element if it is present in the toolbar, null otherwise.
    */
@@ -3734,17 +3733,17 @@ const BrowserSearch = {
   },
 
   loadAddEngines: function BrowserSearch_loadAddEngines() {
     var newWindowPref = gPrefService.getIntPref("browser.link.open_newwindow");
     var where = newWindowPref == 3 ? "tab" : "window";
     openUILinkIn(this.searchEnginesURL, where);
   },
 
-  _getSearchEngineId: function (engine) {
+  _getSearchEngineId: function(engine) {
     if (engine && engine.identifier) {
       return engine.identifier;
     }
 
     if (!engine || (engine.name === undefined) ||
         !Services.prefs.getBoolPref("toolkit.telemetry.enabled"))
       return "other";
 
@@ -3763,17 +3762,17 @@ const BrowserSearch = {
    *        allowed values.
    * @param details [optional]
    *        An optional parameter passed to |BrowserUsageTelemetry.recordSearch|.
    *        See its documentation for allowed options.
    *        Additionally, if the search was a suggested search, |details.selection|
    *        indicates where the item was in the suggestion list and how the user
    *        selected it: {selection: {index: The selected index, kind: "key" or "mouse"}}
    */
-  recordSearchInTelemetry: function (engine, source, details={}) {
+  recordSearchInTelemetry: function(engine, source, details = {}) {
     BrowserUITelemetry.countSearchEvent(source, null, details.selection);
     try {
       BrowserUsageTelemetry.recordSearch(engine, source, details);
     } catch (ex) {
       Cu.reportError(ex);
     }
   },
 
@@ -3787,17 +3786,17 @@ const BrowserSearch = {
    * @param source
    *        (string) Where the search originated from. See BrowserUsageTelemetry for
    *        allowed values.
    * @param type
    *        (string) Indicates how the user selected the search item.
    * @param where
    *        (string) Where was the search link opened (e.g. new tab, current tab, ..).
    */
-  recordOneoffSearchInTelemetry: function (engine, source, type, where) {
+  recordOneoffSearchInTelemetry: function(engine, source, type, where) {
     let id = this._getSearchEngineId(engine) + "." + source;
     BrowserUITelemetry.countOneoffSearchEvent(id, type, where);
     try {
       const details = {type, isOneOff: true};
       BrowserUsageTelemetry.recordSearch(engine, source, details);
     } catch (ex) {
       Cu.reportError(ex);
     }
@@ -3876,17 +3875,17 @@ function FillHistoryMenu(aParent) {
       item.setAttribute("uri", uri);
       item.setAttribute("label", entry.title || uri);
       item.setAttribute("index", j);
 
       // Cache this so that gotoHistoryIndex doesn't need the original index
       item.setAttribute("historyindex", j - index);
 
       if (j != index) {
-        PlacesUtils.favicons.getFaviconURLForPage(entryURI, function (aURI) {
+        PlacesUtils.favicons.getFaviconURLForPage(entryURI, function(aURI) {
           if (aURI) {
             let iconURL = PlacesUtils.favicons.getFaviconLinkForIcon(aURI).spec;
             item.style.listStyleImage = "url(" + iconURL + ")";
           }
         });
       }
 
       if (j < index) {
@@ -4011,17 +4010,17 @@ function OpenBrowserWindow(options)
 
   // if and only if the current window is a browser window and it has a document with a character
   // set, then extract the current charset menu setting from the current document and use it to
   // initialize the new browser window...
   var win;
   if (window && (wintype == "navigator:browser") && window.content && window.content.document)
   {
     var DocCharset = window.content.document.characterSet;
-    charsetArg = "charset="+DocCharset;
+    charsetArg = "charset=" + DocCharset;
 
     // we should "inherit" the charset menu setting in a new window
     win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no" + extraFeatures, defaultArgs, charsetArg);
   }
   else // forget about the charset information.
   {
     win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no" + extraFeatures, defaultArgs);
   }
@@ -4179,112 +4178,112 @@ var XULBrowserWindow = {
   defaultStatus: "",
   overLink: "",
   startTime: 0,
   statusText: "",
   isBusy: false,
   // Left here for add-on compatibility, see bug 752434
   inContentWhitelist: [],
 
-  QueryInterface: function (aIID) {
+  QueryInterface: function(aIID) {
     if (aIID.equals(Ci.nsIWebProgressListener) ||
         aIID.equals(Ci.nsIWebProgressListener2) ||
         aIID.equals(Ci.nsISupportsWeakReference) ||
         aIID.equals(Ci.nsIXULBrowserWindow) ||
         aIID.equals(Ci.nsISupports))
       return this;
     throw Cr.NS_NOINTERFACE;
   },
 
-  get stopCommand () {
+  get stopCommand() {
     delete this.stopCommand;
     return this.stopCommand = document.getElementById("Browser:Stop");
   },
-  get reloadCommand () {
+  get reloadCommand() {
     delete this.reloadCommand;
     return this.reloadCommand = document.getElementById("Browser:Reload");
   },
-  get statusTextField () {
+  get statusTextField() {
     return gBrowser.getStatusPanel();
   },
-  get isImage () {
+  get isImage() {
     delete this.isImage;
     return this.isImage = document.getElementById("isImage");
   },
-  get canViewSource () {
+  get canViewSource() {
     delete this.canViewSource;
     return this.canViewSource = document.getElementById("canViewSource");
   },
 
-  init: function () {
+  init: function() {
     // Initialize the security button's state and tooltip text.
     var securityUI = gBrowser.securityUI;
     this.onSecurityChange(null, null, securityUI.state, true);
   },
 
-  setJSStatus: function () {
+  setJSStatus: function() {
     // unsupported
   },
 
   forceInitialBrowserRemote: function() {
     let initBrowser =
       document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser");
     return initBrowser.frameLoader.tabParent;
   },
 
   forceInitialBrowserNonRemote: function(aOpener) {
     let initBrowser =
       document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser");
     gBrowser.updateBrowserRemoteness(initBrowser, false, aOpener);
   },
 
-  setDefaultStatus: function (status) {
+  setDefaultStatus: function(status) {
     this.defaultStatus = status;
     this.updateStatusField();
   },
 
-  setOverLink: function (url, anchorElt) {
+  setOverLink: function(url, anchorElt) {
     // Encode bidirectional formatting characters.
     // (RFC 3987 sections 3.2 and 4.1 paragraph 6)
     url = url.replace(/[\u200e\u200f\u202a\u202b\u202c\u202d\u202e]/g,
                       encodeURIComponent);
 
     if (gURLBar && gURLBar._mayTrimURLs /* corresponds to browser.urlbar.trimURLs */)
       url = trimURL(url);
 
     this.overLink = url;
     LinkTargetDisplay.update();
   },
 
-  showTooltip: function (x, y, tooltip, direction) {
+  showTooltip: function(x, y, tooltip, direction) {
     if (Cc["@mozilla.org/widget/dragservice;1"].getService(Ci.nsIDragService).
         getCurrentSession()) {
       return;
     }
 
     // The x,y coordinates are relative to the <browser> element using
     // the chrome zoom level.
     let elt = document.getElementById("remoteBrowserTooltip");
     elt.label = tooltip;
     elt.style.direction = direction;
 
     let anchor = gBrowser.selectedBrowser;
     elt.openPopupAtScreen(anchor.boxObject.screenX + x, anchor.boxObject.screenY + y, false, null);
   },
 
-  hideTooltip: function () {
+  hideTooltip: function() {
     let elt = document.getElementById("remoteBrowserTooltip");
     elt.hidePopup();
   },
 
-  getTabCount: function () {
+  getTabCount: function() {
     return gBrowser.tabs.length;
   },
 
-  updateStatusField: function () {
+  updateStatusField: function() {
     var text, type, types = ["overLink"];
     if (this._busyUI)
       types.push("status");
     types.push("defaultStatus");
     for (type of types) {
       text = this[type];
       if (text)
         break;
@@ -4326,32 +4325,32 @@ var XULBrowserWindow = {
     if (!E10SUtils.shouldLoadURI(aDocShell, aURI, aReferrer)) {
       E10SUtils.redirectLoad(aDocShell, aURI, aReferrer);
       return false;
     }
 
     return true;
   },
 
-  onProgressChange: function (aWebProgress, aRequest,
-                              aCurSelfProgress, aMaxSelfProgress,
-                              aCurTotalProgress, aMaxTotalProgress) {
+  onProgressChange: function(aWebProgress, aRequest,
+                             aCurSelfProgress, aMaxSelfProgress,
+                             aCurTotalProgress, aMaxTotalProgress) {
     // Do nothing.
   },
 
-  onProgressChange64: function (aWebProgress, aRequest,
-                                aCurSelfProgress, aMaxSelfProgress,
-                                aCurTotalProgress, aMaxTotalProgress) {
+  onProgressChange64: function(aWebProgress, aRequest,
+                               aCurSelfProgress, aMaxSelfProgress,
+                               aCurTotalProgress, aMaxTotalProgress) {
     return this.onProgressChange(aWebProgress, aRequest,
       aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress,
       aMaxTotalProgress);
   },
 
   // This function fires only for the currently selected tab.
-  onStateChange: function (aWebProgress, aRequest, aStateFlags, aStatus) {
+  onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
     const nsIWebProgressListener = Ci.nsIWebProgressListener;
     const nsIChannel = Ci.nsIChannel;
 
     let browser = gBrowser.selectedBrowser;
 
     if (aStateFlags & nsIWebProgressListener.STATE_START &&
         aStateFlags & nsIWebProgressListener.STATE_IS_NETWORK) {
 
@@ -4425,17 +4424,17 @@ var XULBrowserWindow = {
         this._busyUI = false;
 
         this.stopCommand.setAttribute("disabled", "true");
         CombinedStopReload.switchToReload(aRequest instanceof Ci.nsIRequest);
       }
     }
   },
 
-  onLocationChange: function (aWebProgress, aRequest, aLocationURI, aFlags) {
+  onLocationChange: function(aWebProgress, aRequest, aLocationURI, aFlags) {
     var location = aLocationURI ? aLocationURI.spec : "";
 
     // If displayed, hide the form validation popup.
     FormValidationHandler.hidePopup();
 
     let pageTooltip = document.getElementById("aHTMLTooltip");
     let tooltipNode = pageTooltip.triggerNode;
     if (tooltipNode) {
@@ -4489,34 +4488,34 @@ var XULBrowserWindow = {
 
       SocialUI.updateState();
 
       UITour.onLocationChange(location);
 
       gTabletModePageCounter.inc();
 
       // Utility functions for disabling find
-      var shouldDisableFind = function shouldDisableFind(aDocument) {
+      var shouldDisableFind = function(aDocument) {
         let docElt = aDocument.documentElement;
         return docElt && docElt.getAttribute("disablefastfind") == "true";
       }
 
-      var disableFindCommands = function disableFindCommands(aDisable) {
+      var disableFindCommands = function(aDisable) {
         let findCommands = [document.getElementById("cmd_find"),
                             document.getElementById("cmd_findAgain"),
                             document.getElementById("cmd_findPrevious")];
         for (let elt of findCommands) {
           if (aDisable)
             elt.setAttribute("disabled", "true");
           else
             elt.removeAttribute("disabled");
         }
       }
 
-      var onContentRSChange = function onContentRSChange(e) {
+      var onContentRSChange = function(e) {
         if (e.target.readyState != "interactive" && e.target.readyState != "complete")
           return;
 
         e.target.removeEventListener("readystatechange", onContentRSChange);
         disableFindCommands(shouldDisableFind(e.target));
       }
 
       // Disable find commands in documents that ask for them to be disabled.
@@ -4547,17 +4546,17 @@ var XULBrowserWindow = {
     UpdateBackForwardCommands(gBrowser.webNavigation);
     ReaderParent.updateReaderButton(gBrowser.selectedBrowser);
 
     gGestureSupport.restoreRotationState();
 
     // See bug 358202, when tabs are switched during a drag operation,
     // timers don't fire on windows (bug 203573)
     if (aRequest)
-      setTimeout(function () { XULBrowserWindow.asyncUpdateUI(); }, 0);
+      setTimeout(function() { XULBrowserWindow.asyncUpdateUI(); }, 0);
     else
       this.asyncUpdateUI();
 
     if (AppConstants.MOZ_CRASHREPORTER && aLocationURI) {
       let uri = aLocationURI.clone();
       try {
         // If the current URI contains a username/password, remove it.
         uri.userPass = "";
@@ -4569,40 +4568,40 @@ var XULBrowserWindow = {
         // Don't make noise when the crash reporter is built but not enabled.
         if (ex.result != Components.results.NS_ERROR_NOT_INITIALIZED) {
           throw ex;
         }
       }
     }
   },
 
-  asyncUpdateUI: function () {
+  asyncUpdateUI: function() {
     FeedHandler.updateFeeds();
     BrowserSearch.updateOpenSearchBadge();
   },
 
   // Left here for add-on compatibility, see bug 752434
   hideChromeForLocation: function() {},
 
-  onStatusChange: function (aWebProgress, aRequest, aStatus, aMessage) {
+  onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {
     this.status = aMessage;
     this.updateStatusField();
   },
 
   // Properties used to cache security state used to update the UI
   _state: null,
   _lastLocation: null,
 
   // This is called in multiple ways:
   //  1. Due to the nsIWebProgressListener.onSecurityChange notification.
   //  2. Called by tabbrowser.xml when updating the current browser.
   //  3. Called directly during this object's initializations.
   // aRequest will be null always in case 2 and 3, and sometimes in case 1 (for
   // instance, there won't be a request when STATE_BLOCKED_TRACKING_CONTENT is observed).
-  onSecurityChange: function (aWebProgress, aRequest, aState, aIsSimulated) {
+  onSecurityChange: function(aWebProgress, aRequest, aState, aIsSimulated) {
     // Don't need to do anything if the data we use to update the UI hasn't
     // changed
     let uri = gBrowser.currentURI;
     let spec = uri.spec;
     if (this._state == aState &&
         this._lastLocation == spec)
       return;
     this._state = aState;
@@ -4649,21 +4648,21 @@ var LinkTargetDisplay = {
   get DELAY_SHOW() {
      delete this.DELAY_SHOW;
      return this.DELAY_SHOW = Services.prefs.getIntPref("browser.overlink-delay");
   },
 
   DELAY_HIDE: 250,
   _timer: 0,
 
-  get _isVisible () {
+  get _isVisible() {
     return XULBrowserWindow.statusTextField.label != "";
   },
 
-  update: function () {
+  update: function() {
     clearTimeout(this._timer);
     window.removeEventListener("mousemove", this, true);
 
     if (!XULBrowserWindow.overLink) {
       if (XULBrowserWindow.hideOverLinkImmediately)
         this._hide();
       else
         this._timer = setTimeout(this._hide.bind(this), this.DELAY_HIDE);
@@ -4674,85 +4673,85 @@ var LinkTargetDisplay = {
       XULBrowserWindow.updateStatusField();
     } else {
       // Let the display appear when the mouse doesn't move within the delay
       this._showDelayed();
       window.addEventListener("mousemove", this, true);
     }
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     switch (event.type) {
       case "mousemove":
         // Restart the delay since the mouse was moved
         clearTimeout(this._timer);
         this._showDelayed();
         break;
     }
   },
 
-  _showDelayed: function () {
-    this._timer = setTimeout(function (self) {
+  _showDelayed: function() {
+    this._timer = setTimeout(function(self) {
       XULBrowserWindow.updateStatusField();
       window.removeEventListener("mousemove", self, true);
     }, this.DELAY_SHOW, this);
   },
 
-  _hide: function () {
+  _hide: function() {
     clearTimeout(this._timer);
 
     XULBrowserWindow.updateStatusField();
   }
 };
 
 var CombinedStopReload = {
-  init: function () {
+  init: function() {
     if (this._initialized)
       return;
 
     let reload = document.getElementById("urlbar-reload-button");
     let stop = document.getElementById("urlbar-stop-button");
     if (!stop || !reload || reload.nextSibling != stop)
       return;
 
     this._initialized = true;
     if (XULBrowserWindow.stopCommand.getAttribute("disabled") != "true")
       reload.setAttribute("displaystop", "true");
     stop.addEventListener("click", this, false);
     this.reload = reload;
     this.stop = stop;
   },
 
-  uninit: function () {
+  uninit: function() {
     if (!this._initialized)
       return;
 
     this._cancelTransition();
     this._initialized = false;
     this.stop.removeEventListener("click", this, false);
     this.reload = null;
     this.stop = null;
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     // the only event we listen to is "click" on the stop button
     if (event.button == 0 &&
         !this.stop.disabled)
       this._stopClicked = true;
   },
 
-  switchToStop: function () {
+  switchToStop: function() {
     if (!this._initialized)
       return;
 
     this._cancelTransition();
     this.reload.setAttribute("displaystop", "true");
   },
 
-  switchToReload: function (aDelay) {
+  switchToReload: function(aDelay) {
     if (!this._initialized)
       return;
 
     this.reload.removeAttribute("displaystop");
 
     if (!aDelay || this._stopClicked) {
       this._stopClicked = false;
       this._cancelTransition();
@@ -4762,37 +4761,37 @@ var CombinedStopReload = {
     }
 
     if (this._timer)
       return;
 
     // Temporarily disable the reload button to prevent the user from
     // accidentally reloading the page when intending to click the stop button
     this.reload.disabled = true;
-    this._timer = setTimeout(function (self) {
+    this._timer = setTimeout(function(self) {
       self._timer = 0;
       self.reload.disabled = XULBrowserWindow.reloadCommand
                                              .getAttribute("disabled") == "true";
     }, 650, this);
   },
 
-  _cancelTransition: function () {
+  _cancelTransition: function() {
     if (this._timer) {
       clearTimeout(this._timer);
       this._timer = 0;
     }
   }
 };
 
 var TabsProgressListener = {
   // Keep track of which browsers we've started load timers for, since
   // we won't see STATE_START events for pre-rendered tabs.
   _startedLoadTimer: new WeakSet(),
 
-  onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
+  onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
     // Collect telemetry data about tab load times.
     if (aWebProgress.isTopLevel && (!aRequest.originalURI || aRequest.originalURI.spec.scheme != "about")) {
       if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) {
         if (aStateFlags & Ci.nsIWebProgressListener.STATE_START) {
           this._startedLoadTimer.add(aBrowser);
           TelemetryStopwatch.start("FX_PAGE_LOAD_MS", aBrowser);
           Services.telemetry.getHistogramById("FX_TOTAL_TOP_VISITS").add(true);
         } else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
@@ -4836,18 +4835,18 @@ var TabsProgressListener = {
         aBrowser.removeEventListener("click", BrowserOnClick, true);
         aBrowser.removeEventListener("pagehide", onPageHide, true);
         if (event.target.documentElement)
           event.target.documentElement.removeAttribute("hasBrowserHandlers");
       }, true);
     }
   },
 
-  onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI,
-                              aFlags) {
+  onLocationChange: function(aBrowser, aWebProgress, aRequest, aLocationURI,
+                             aFlags) {
     // Filter out location changes caused by anchor navigation
     // or history.push/pop/replaceState.
     if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
       // Reader mode actually cares about these:
       let mm = gBrowser.selectedBrowser.messageManager;
       mm.sendAsyncMessage("Reader:PushState", {isArticle: gBrowser.selectedBrowser.isArticle});
       return;
     }
@@ -4875,19 +4874,19 @@ var TabsProgressListener = {
 }
 
 function nsBrowserAccess() { }
 
 nsBrowserAccess.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserDOMWindow, Ci.nsISupports]),
 
   _openURIInNewTab: function(aURI, aReferrer, aReferrerPolicy, aIsPrivate,
-                             aIsExternal, aForceNotRemote=false,
-                             aUserContextId=Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID,
-                             aOpener=null) {
+                             aIsExternal, aForceNotRemote = false,
+                             aUserContextId = Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID,
+                             aOpener = null) {
     let win, needToFocusWin;
 
     // try the current window.  if we're in a popup, fall back on the most recent browser window
     if (window.toolbar.visible)
       win = window;
     else {
       win = RecentWindow.getMostRecentBrowserWindow({private: aIsPrivate});
       needToFocusWin = true;
@@ -4918,17 +4917,17 @@ nsBrowserAccess.prototype = {
     let browser = win.gBrowser.getBrowserForTab(tab);
 
     if (needToFocusWin || (!loadInBackground && aIsExternal))
       win.focus();
 
     return browser;
   },
 
-  openURI: function (aURI, aOpener, aWhere, aFlags) {
+  openURI: function(aURI, aOpener, aWhere, aFlags) {
     // This function should only ever be called if we're opening a URI
     // from a non-remote browser window (via nsContentTreeOwner).
     if (aOpener && Cu.isCrossProcessWrapper(aOpener)) {
       Cu.reportError("nsBrowserAccess.openURI was passed a CPOW for aOpener. " +
                      "openURI should only ever be called from non-remote browsers.");
       throw Cr.NS_ERROR_FAILURE;
     }
 
@@ -5032,17 +5031,17 @@ nsBrowserAccess.prototype = {
                                         isExternal, false,
                                         userContextId);
     if (browser)
       return browser.QueryInterface(Ci.nsIFrameLoaderOwner);
 
     return null;
   },
 
-  isTabContentWindow: function (aWindow) {
+  isTabContentWindow: function(aWindow) {
     return gBrowser.browsers.some(browser => browser.contentWindow == aWindow);
   },
 
   canClose() {
     return CanCloseWindow();
   },
 }
 
@@ -5054,17 +5053,17 @@ function getTogglableToolbars() {
 }
 
 function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
   var popup = aEvent.target;
   if (popup != aEvent.currentTarget)
     return;
 
   // Empty the menu
-  for (var i = popup.childNodes.length-1; i >= 0; --i) {
+  for (var i = popup.childNodes.length - 1; i >= 0; --i) {
     var deadItem = popup.childNodes[i];
     if (deadItem.hasAttribute("toolbarId"))
       popup.removeChild(deadItem);
   }
 
   var firstMenuItem = aInsertPoint || popup.firstChild;
 
   let toolbarNodes = getTogglableToolbars();
@@ -5149,17 +5148,17 @@ function onViewToolbarsPopupShowing(aEve
 }
 
 function onViewToolbarCommand(aEvent) {
   var toolbarId = aEvent.originalTarget.getAttribute("toolbarId");
   var isVisible = aEvent.originalTarget.getAttribute("checked") == "true";
   CustomizableUI.setToolbarVisibility(toolbarId, isVisible);
 }
 
-function setToolbarVisibility(toolbar, isVisible, persist=true) {
+function setToolbarVisibility(toolbar, isVisible, persist = true) {
   let hidingAttribute;
   if (toolbar.getAttribute("type") == "menubar") {
     hidingAttribute = "autohide";
     if (AppConstants.platform == "linux") {
       Services.prefs.setBoolPref("ui.key.menuAccessKeyFocuses", !isVisible);
     }
   } else {
     hidingAttribute = "collapsed";
@@ -5248,39 +5247,39 @@ var gTabletModePageCounter = {
 function displaySecurityInfo()
 {
   BrowserPageInfo(null, "securityTab");
 }
 
 
 var gHomeButton = {
   prefDomain: "browser.startup.homepage",
-  observe: function (aSubject, aTopic, aPrefName)
+  observe: function(aSubject, aTopic, aPrefName)
   {
     if (aTopic != "nsPref:changed" || aPrefName != this.prefDomain)
       return;
 
     this.updateTooltip();
   },
 
-  updateTooltip: function (homeButton)
+  updateTooltip: function(homeButton)
   {
     if (!homeButton)
       homeButton = document.getElementById("home-button");
     if (homeButton) {
       var homePage = this.getHomePage();
       homePage = homePage.replace(/\|/g, ', ');
       if (homePage.toLowerCase() == "about:home")
         homeButton.setAttribute("tooltiptext", homeButton.getAttribute("aboutHomeOverrideTooltip"));
       else
         homeButton.setAttribute("tooltiptext", homePage);
     }
   },
 
-  getHomePage: function ()
+  getHomePage: function()
   {
     var url;
     try {
       url = gPrefService.getComplexValue(this.prefDomain,
                                 Components.interfaces.nsIPrefLocalizedString).data;
     } catch (e) {
     }
 
@@ -5771,42 +5770,42 @@ var gPageStyleMenu = {
    * @param browser (optional)
    *        The <xul:browser> to search for stylesheets. If omitted, this
    *        defaults to the currently selected tab's browser.
    * @returns Array
    *        An Array of Objects representing stylesheets in the browser.
    *        See the documentation for gPageStyleMenu for a description
    *        of the Object structure.
    */
-  getBrowserStyleSheets: function (browser) {
+  getBrowserStyleSheets: function(browser) {
     if (!browser) {
       browser = gBrowser.selectedBrowser;
     }
 
     let data = this._pageStyleSheets.get(browser.permanentKey);
     if (!data) {
       return [];
     }
     return data.filteredStyleSheets;
   },
 
-  _getStyleSheetInfo: function (browser) {
+  _getStyleSheetInfo: function(browser) {
     let data = this._pageStyleSheets.get(browser.permanentKey);
     if (!data) {
       return {
         filteredStyleSheets: [],
         authorStyleDisabled: false,
         preferredStyleSheetSet: true
       };
     }
 
     return data;
   },
 
-  fillPopup: function (menuPopup) {
+  fillPopup: function(menuPopup) {
     let styleSheetInfo = this._getStyleSheetInfo(gBrowser.selectedBrowser);
     var noStyle = menuPopup.firstChild;
     var persistentOnly = noStyle.nextSibling;
     var sep = persistentOnly.nextSibling;
     while (sep.nextSibling)
       menuPopup.removeChild(sep.nextSibling);
 
     let styleSheets = styleSheetInfo.filteredStyleSheets;
@@ -5840,22 +5839,22 @@ var gPageStyleMenu = {
     }
 
     noStyle.setAttribute("checked", styleDisabled);
     persistentOnly.setAttribute("checked", !altStyleSelected && !styleDisabled);
     persistentOnly.hidden = styleSheetInfo.preferredStyleSheetSet ? haveAltSheets : false;
     sep.hidden = (noStyle.hidden && persistentOnly.hidden) || !haveAltSheets;
   },
 
-  switchStyleSheet: function (title) {
+  switchStyleSheet: function(title) {
     let mm = gBrowser.selectedBrowser.messageManager;
     mm.sendAsyncMessage("PageStyle:Switch", {title: title});
   },
 
-  disableStyle: function () {
+  disableStyle: function() {
     let mm = gBrowser.selectedBrowser.messageManager;
     mm.sendAsyncMessage("PageStyle:Disable");
   },
 };
 
 /* Legacy global page-style functions */
 var stylesheetFillPopup = gPageStyleMenu.fillPopup.bind(gPageStyleMenu);
 function stylesheetSwitchAll(contentWindow, title) {
@@ -5878,77 +5877,77 @@ var LanguageDetectionListener = {
   }
 };
 
 
 var BrowserOffline = {
   _inited: false,
 
   // BrowserOffline Public Methods
-  init: function ()
+  init: function()
   {
     if (!this._uiElement)
       this._uiElement = document.getElementById("workOfflineMenuitemState");
 
     Services.obs.addObserver(this, "network:offline-status-changed", false);
 
     this._updateOfflineUI(Services.io.offline);
 
     this._inited = true;
   },
 
-  uninit: function ()
+  uninit: function()
   {
     if (this._inited) {
       Services.obs.removeObserver(this, "network:offline-status-changed");
     }
   },
 
-  toggleOfflineStatus: function ()
+  toggleOfflineStatus: function()
   {
     var ioService = Services.io;
 
     if (!ioService.offline && !this._canGoOffline()) {
       this._updateOfflineUI(false);
       return;
     }
 
     ioService.offline = !ioService.offline;
   },
 
   // nsIObserver
-  observe: function (aSubject, aTopic, aState)
+  observe: function(aSubject, aTopic, aState)
   {
     if (aTopic != "network:offline-status-changed")
       return;
 
     // This notification is also received because of a loss in connectivity,
     // which we ignore by updating the UI to the current value of io.offline
     this._updateOfflineUI(Services.io.offline);
   },
 
   // BrowserOffline Implementation Methods
-  _canGoOffline: function ()
+  _canGoOffline: function()
   {
     try {
       var cancelGoOffline = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
       Services.obs.notifyObservers(cancelGoOffline, "offline-requested", null);
 
       // Something aborted the quit process.
       if (cancelGoOffline.data)
         return false;
     }
     catch (ex) {
     }
 
     return true;
   },
 
   _uiElement: null,
-  _updateOfflineUI: function (aOffline)
+  _updateOfflineUI: function(aOffline)
   {
     var offlineLocked = gPrefService.prefIsLocked("network.online");
     if (offlineLocked)
       this._uiElement.setAttribute("disabled", "true");
 
     this._uiElement.setAttribute("checked", aOffline);
   }
 };
@@ -6029,27 +6028,27 @@ var OfflineApps = {
       notification.options.controlledItems.push([
         Cu.getWeakReference(browser), docId, uri
       ]);
     } else {
       let mainAction = {
         label: gNavigatorBundle.getString("offlineApps.allow"),
         accessKey: gNavigatorBundle.getString("offlineApps.allowAccessKey"),
         callback: function() {
-          for (let [browser, docId, uri] of notification.options.controlledItems) {
-            OfflineApps.allowSite(browser, docId, uri);
+          for (let [ciBrowser, ciDocId, ciUri] of notification.options.controlledItems) {
+            OfflineApps.allowSite(ciBrowser, ciDocId, ciUri);
           }
         }
       };
       let secondaryActions = [{
         label: gNavigatorBundle.getString("offlineApps.never"),
         accessKey: gNavigatorBundle.getString("offlineApps.neverAccessKey"),
         callback: function() {
-          for (let [, , uri] of notification.options.controlledItems) {
-            OfflineApps.disallowSite(uri);
+          for (let [, , ciUri] of notification.options.controlledItems) {
+            OfflineApps.disallowSite(ciUri);
           }
         }
       }];
       let message = gNavigatorBundle.getFormattedString("offlineApps.available",
                                                         [host]);
       let anchorID = "indexedDB-notification-icon";
       let options = {
         controlledItems : [[Cu.getWeakReference(browser), docId, uri]]
@@ -6323,53 +6322,53 @@ function warnAboutClosingWindow() {
   // OS X doesn't quit the application when the last window is closed, but keeps
   // the session alive. Hence don't prompt users to save tabs, but warn about
   // closing multiple tabs.
   return AppConstants.platform != "macosx"
          || (isPBWindow || gBrowser.warnAboutClosingTabs(gBrowser.closingTabsEnum.ALL));
 }
 
 var MailIntegration = {
-  sendLinkForBrowser: function (aBrowser) {
+  sendLinkForBrowser: function(aBrowser) {
     this.sendMessage(aBrowser.currentURI.spec, aBrowser.contentTitle);
   },
 
-  sendMessage: function (aBody, aSubject) {
+  sendMessage: function(aBody, aSubject) {
     // generate a mailto url based on the url and the url's title
     var mailtoUrl = "mailto:";
     if (aBody) {
       mailtoUrl += "?body=" + encodeURIComponent(aBody);
       mailtoUrl += "&subject=" + encodeURIComponent(aSubject);
     }
 
     var uri = makeURI(mailtoUrl);
 
     // now pass this uri to the operating system
     this._launchExternalUrl(uri);
   },
 
   // a generic method which can be used to pass arbitrary urls to the operating
   // system.
   // aURL --> a nsIURI which represents the url to launch
-  _launchExternalUrl: function (aURL) {
+  _launchExternalUrl: function(aURL) {
     var extProtocolSvc =
        Cc["@mozilla.org/uriloader/external-protocol-service;1"]
          .getService(Ci.nsIExternalProtocolService);
     if (extProtocolSvc)
       extProtocolSvc.loadUrl(aURL);
   }
 };
 
 function BrowserOpenAddonsMgr(aView) {
   return new Promise(resolve => {
     if (aView) {
       let emWindow;
       let browserWindow;
 
-      var receivePong = function receivePong(aSubject, aTopic, aData) {
+      var receivePong = function(aSubject, aTopic, aData) {
         let browserWin = aSubject.QueryInterface(Ci.nsIInterfaceRequestor)
                                  .getInterface(Ci.nsIWebNavigation)
                                  .QueryInterface(Ci.nsIDocShellTreeItem)
                                  .rootTreeItem
                                  .QueryInterface(Ci.nsIInterfaceRequestor)
                                  .getInterface(Ci.nsIDOMWindow);
         if (!emWindow || browserWin == window /* favor the current window */) {
           emWindow = aSubject;
@@ -6646,107 +6645,107 @@ var gIdentityHandler = {
   get _hasInsecureLoginForms() {
     // checks if the page has been flagged for an insecure login. Also checks
     // if the pref to degrade the UI is set to true
     return LoginManagerParent.hasInsecureLoginForms(gBrowser.selectedBrowser) &&
            Services.prefs.getBoolPref("security.insecure_password.ui.enabled");
   },
 
   // smart getters
-  get _identityPopup () {
+  get _identityPopup() {
     delete this._identityPopup;
     return this._identityPopup = document.getElementById("identity-popup");
   },
-  get _identityBox () {
+  get _identityBox() {
     delete this._identityBox;
     return this._identityBox = document.getElementById("identity-box");
   },
-  get _identityPopupMultiView () {
+  get _identityPopupMultiView() {
     delete _identityPopupMultiView;
     return document.getElementById("identity-popup-multiView");
   },
-  get _identityPopupContentHosts () {
+  get _identityPopupContentHosts() {
     delete this._identityPopupContentHosts;
     let selector = ".identity-popup-headline.host";
     return this._identityPopupContentHosts = [
       ...this._identityPopupMultiView._mainView.querySelectorAll(selector),
       ...document.querySelectorAll(selector)
     ];
   },
-  get _identityPopupContentHostless () {
+  get _identityPopupContentHostless() {
     delete this._identityPopupContentHostless;
     let selector = ".identity-popup-headline.hostless";
     return this._identityPopupContentHostless = [
       ...this._identityPopupMultiView._mainView.querySelectorAll(selector),
       ...document.querySelectorAll(selector)
     ];
   },
-  get _identityPopupContentOwner () {
+  get _identityPopupContentOwner() {
     delete this._identityPopupContentOwner;
     return this._identityPopupContentOwner =
       document.getElementById("identity-popup-content-owner");
   },
-  get _identityPopupContentSupp () {
+  get _identityPopupContentSupp() {
     delete this._identityPopupContentSupp;
     return this._identityPopupContentSupp =
       document.getElementById("identity-popup-content-supplemental");
   },
-  get _identityPopupContentVerif () {
+  get _identityPopupContentVerif() {
     delete this._identityPopupContentVerif;
     return this._identityPopupContentVerif =
       document.getElementById("identity-popup-content-verifier");
   },
-  get _identityPopupMixedContentLearnMore () {
+  get _identityPopupMixedContentLearnMore() {
     delete this._identityPopupMixedContentLearnMore;
     return this._identityPopupMixedContentLearnMore =
       document.getElementById("identity-popup-mcb-learn-more");
   },
-  get _identityPopupInsecureLoginFormsLearnMore () {
+  get _identityPopupInsecureLoginFormsLearnMore() {
     delete this._identityPopupInsecureLoginFormsLearnMore;
     return this._identityPopupInsecureLoginFormsLearnMore =
       document.getElementById("identity-popup-insecure-login-forms-learn-more");
   },
-  get _identityIconLabels () {
+  get _identityIconLabels() {
     delete this._identityIconLabels;
     return this._identityIconLabels = document.getElementById("identity-icon-labels");
   },
-  get _identityIconLabel () {
+  get _identityIconLabel() {
     delete this._identityIconLabel;
     return this._identityIconLabel = document.getElementById("identity-icon-label");
   },
-  get _connectionIcon () {
+  get _connectionIcon() {
     delete this._connectionIcon;
     return this._connectionIcon = document.getElementById("connection-icon");
   },
-  get _overrideService () {
+  get _overrideService() {
     delete this._overrideService;
     return this._overrideService = Cc["@mozilla.org/security/certoverride;1"]
                                      .getService(Ci.nsICertOverrideService);
   },
-  get _identityIconCountryLabel () {
+  get _identityIconCountryLabel() {
     delete this._identityIconCountryLabel;
     return this._identityIconCountryLabel = document.getElementById("identity-icon-country-label");
   },
-  get _identityIcon () {
+  get _identityIcon() {
     delete this._identityIcon;
     return this._identityIcon = document.getElementById("identity-icon");
   },
-  get _permissionList () {
+  get _permissionList() {
     delete this._permissionList;
     return this._permissionList = document.getElementById("identity-popup-permission-list");
   },
   get _permissionEmptyHint() {
     delete this._permissionEmptyHint;
     return this._permissionEmptyHint = document.getElementById("identity-popup-permission-empty-hint");
   },
-  get _permissionReloadHint () {
+  get _permissionReloadHint() {
     delete this._permissionReloadHint;
     return this._permissionReloadHint = document.getElementById("identity-popup-permission-reload-hint");
   },
-  get _permissionAnchors () {
+  get _permissionAnchors() {
     delete this._permissionAnchors;
     let permissionAnchors = {};
     for (let anchor of document.getElementById("blocked-permissions-container").children) {
       permissionAnchors[anchor.getAttribute("data-permission-id")] = anchor;
     }
     return this._permissionAnchors = permissionAnchors;
   },
 
@@ -7088,17 +7087,17 @@ var gIdentityHandler = {
       if (this._uri.port > 0) {
         port = this._uri.port;
       }
     } catch (e) {}
 
     let buttons = [{
       label: gNavigatorBundle.getString("revokeOverride.label"),
       accessKey: gNavigatorBundle.getString("revokeOverride.accesskey"),
-      callback: function (aNotification, aButton) {
+      callback: function(aNotification, aButton) {
         try {
           let weakCryptoOverride = Cc["@mozilla.org/security/weakcryptooverride;1"]
                                      .getService(Ci.nsIWeakCryptoOverride);
           weakCryptoOverride.removeWeakCryptoOverride(host, port,
             PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser));
           BrowserReloadWithFlags(nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);
         } catch (e) {
           Cu.reportError(e);
@@ -7339,52 +7338,52 @@ var gIdentityHandler = {
   },
 
   observe(subject, topic, data) {
     if (topic == "perm-changed") {
       this.refreshIdentityBlock();
     }
   },
 
-  onDragStart: function (event) {
+  onDragStart: function(event) {
     if (gURLBar.getAttribute("pageproxystate") != "valid")
       return;
 
     let value = gBrowser.currentURI.spec;
     let urlString = value + "\n" + gBrowser.contentTitle;
     let htmlString = "<a href=\"" + value + "\">" + value + "</a>";
 
     let dt = event.dataTransfer;
     dt.setData("text/x-moz-url", urlString);
     dt.setData("text/uri-list", value);
     dt.setData("text/plain", value);
     dt.setData("text/html", htmlString);
     dt.setDragImage(this._identityIcon, 16, 16);
   },
 
-  onLocationChange: function () {
+  onLocationChange: function() {
     this._permissionJustRemoved = false;
     this.updatePermissionHint();
   },
 
-  updatePermissionHint: function () {
+  updatePermissionHint: function() {
     if (!this._permissionList.hasChildNodes() && !this._permissionJustRemoved) {
       this._permissionEmptyHint.removeAttribute("hidden");
     } else {
       this._permissionEmptyHint.setAttribute("hidden", "true");
     }
 
     if (this._permissionJustRemoved) {
       this._permissionReloadHint.removeAttribute("hidden");
     } else {
       this._permissionReloadHint.setAttribute("hidden", "true");
     }
   },
 
-  updateSitePermissions: function () {
+  updateSitePermissions: function() {
     while (this._permissionList.hasChildNodes())
       this._permissionList.removeChild(this._permissionList.lastChild);
 
     let uri = gBrowser.currentURI;
 
     let permissions = SitePermissions.getPermissionDetailsByURI(uri);
     if (this._sharingState) {
       // If WebRTC device or screen permissions are in use, we need to find
@@ -7427,17 +7426,17 @@ var gIdentityHandler = {
       heightAfter = parseInt(heightAfter) +
                     parseInt(getComputedStyle(this._permissionList.nextSibling).height);
     }
     let heightChange = parseInt(heightAfter) - parseInt(heightBefore);
     if (heightChange)
       this._identityPopupMultiView.setHeightToFit(heightChange);
   },
 
-  _createPermissionItem: function (aPermission) {
+  _createPermissionItem: function(aPermission) {
     let container = document.createElement("hbox");
     container.setAttribute("class", "identity-popup-permission-item");
     container.setAttribute("align", "center");
 
     let img = document.createElement("image");
     let classes = "identity-popup-permission-icon " + aPermission.id + "-icon";
     if (aPermission.state == SitePermissions.BLOCK)
       classes += " blocked-permission-icon";
@@ -7637,17 +7636,17 @@ var gRemoteTabsUI = {
  *          If set to "whenComparingAndReplace", the fragment will be replaced.
  *        - 'ignoreQueryString' boolean property to be set to true to exclude query string
  *        matching when comparing URIs.
  *        - 'replaceQueryString' boolean property to be set to true to exclude query string
  *        matching when comparing URIs and overwrite the initial query string with
  *        the one from the new URI.
  * @return True if an existing tab was found, false otherwise
  */
-function switchToTabHavingURI(aURI, aOpenNew, aOpenParams={}) {
+function switchToTabHavingURI(aURI, aOpenNew, aOpenParams = {}) {
   // Certain URLs can be switched to irrespective of the source or destination
   // window being in private browsing mode:
   const kPrivateBrowsingWhitelist = new Set([
     "about:addons",
   ]);
 
   let ignoreFragment = aOpenParams.ignoreFragment;
   let ignoreQueryString = aOpenParams.ignoreQueryString;
@@ -7737,25 +7736,25 @@ function switchToTabHavingURI(aURI, aOpe
     else
       openUILinkIn(aURI.spec, "tab", aOpenParams);
   }
 
   return false;
 }
 
 var RestoreLastSessionObserver = {
-  init: function () {
+  init: function() {
     if (SessionStore.canRestoreLastSession &&
         !PrivateBrowsingUtils.isWindowPrivate(window)) {
       Services.obs.addObserver(this, "sessionstore-last-session-cleared", true);
       goSetCommandEnabled("Browser:RestoreLastSession", true);
     }
   },
 
-  observe: function () {
+  observe: function() {
     // The last session can only be restored once so there's
     // no way we need to re-enable our menu item.
     Services.obs.removeObserver(this, "sessionstore-last-session-cleared");
     goSetCommandEnabled("Browser:RestoreLastSession", false);
   },
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
                                          Ci.nsISupportsWeakReference])
@@ -7956,45 +7955,45 @@ var MousePosTracker = {
   _listeners: new Set(),
   _x: 0,
   _y: 0,
   get _windowUtils() {
     delete this._windowUtils;
     return this._windowUtils = window.getInterface(Ci.nsIDOMWindowUtils);
   },
 
-  addListener: function (listener) {
+  addListener: function(listener) {
     if (this._listeners.has(listener))
       return;
 
     listener._hover = false;
     this._listeners.add(listener);
 
     this._callListener(listener);
   },
 
-  removeListener: function (listener) {
+  removeListener: function(listener) {
     this._listeners.delete(listener);
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     var fullZoom = this._windowUtils.fullZoom;
     this._x = event.screenX / fullZoom - window.mozInnerScreenX;
     this._y = event.screenY / fullZoom - window.mozInnerScreenY;
 
-    this._listeners.forEach(function (listener) {
+    this._listeners.forEach(function(listener) {
       try {
         this._callListener(listener);
       } catch (e) {
         Cu.reportError(e);
       }
     }, this);
   },
 
-  _callListener: function (listener) {
+  _callListener: function(listener) {
     let rect = listener.getMouseTargetRect();
     let hover = this._x >= rect.left &&
                 this._x <= rect.right &&
                 this._y >= rect.top &&
                 this._y <= rect.bottom;
 
     if (hover == listener._hover)
       return;
@@ -8006,58 +8005,58 @@ var MousePosTracker = {
         listener.onMouseEnter();
     } else if (listener.onMouseLeave) {
       listener.onMouseLeave();
     }
   }
 };
 
 var ToolbarIconColor = {
-  init: function () {
+  init: function() {
     this._initialized = true;
 
     window.addEventListener("activate", this);
     window.addEventListener("deactivate", this);
     Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
 
     // If the window isn't active now, we assume that it has never been active
     // before and will soon become active such that inferFromText will be
     // called from the initial activate event.
     if (Services.focus.activeWindow == window)
       this.inferFromText();
   },
 
-  uninit: function () {
+  uninit: function() {
     this._initialized = false;
 
     window.removeEventListener("activate", this);
     window.removeEventListener("deactivate", this);
     Services.obs.removeObserver(this, "lightweight-theme-styling-update");
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     switch (event.type) {
       case "activate":
       case "deactivate":
         this.inferFromText();
         break;
     }
   },
 
-  observe: function (aSubject, aTopic, aData) {
+  observe: function(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "lightweight-theme-styling-update":
         // inferFromText needs to run after LightweightThemeConsumer.jsm's
         // lightweight-theme-styling-update observer.
         setTimeout(() => { this.inferFromText(); }, 0);
         break;
     }
   },
 
-  inferFromText: function () {
+  inferFromText: function() {
     if (!this._initialized)
       return;
 
     function parseRGB(aColorString) {
       let rgb = aColorString.match(/^rgba?\((\d+), (\d+), (\d+)/);
       rgb.shift();
       return rgb.map(x => parseInt(x));
     }
@@ -8112,17 +8111,17 @@ var PanicButtonNotifier = {
   },
   close: function() {
     let popup = document.getElementById("panic-button-success-notification");
     popup.hidePopup();
   },
 };
 
 var AboutPrivateBrowsingListener = {
-  init: function () {
+  init: function() {
     window.messageManager.addMessageListener(
       "AboutPrivateBrowsing:OpenPrivateWindow",
       msg => {
         OpenBrowserWindow({private: true});
     });
     window.messageManager.addMessageListener(
       "AboutPrivateBrowsing:ToggleTrackingProtection",
       msg => {
--- a/browser/base/content/content.js
+++ b/browser/base/content/content.js
@@ -78,17 +78,17 @@ addEventListener("pageshow", function(ev
 });
 addEventListener("DOMAutoComplete", function(event) {
   LoginManagerContent.onUsernameInput(event);
 });
 addEventListener("blur", function(event) {
   LoginManagerContent.onUsernameInput(event);
 });
 
-var handleContentContextMenu = function (event) {
+var handleContentContextMenu = function(event) {
   let defaultPrevented = event.defaultPrevented;
   if (!Services.prefs.getBoolPref("dom.event.contextmenu.enabled")) {
     let plugin = null;
     try {
       plugin = event.target.QueryInterface(Ci.nsIObjectLoadingContent);
     } catch (e) {}
     if (plugin && plugin.displayedType == Ci.nsIObjectLoadingContent.TYPE_PLUGIN) {
       // Don't open a context menu for plugins.
@@ -355,17 +355,17 @@ var AboutNetAndCertErrorListener = {
       this.onOverride(aEvent);
       break;
     case "AboutNetErrorResetPreferences":
       this.onResetPreferences(aEvent);
       break;
     }
   },
 
-  changedCertPrefs: function () {
+  changedCertPrefs: function() {
     for (let prefName of PREF_SSL_IMPACT) {
       if (Services.prefs.prefHasUserValue(prefName)) {
         return true;
       }
     }
 
     return false;
   },
@@ -514,44 +514,44 @@ var ClickEventHandler = {
     }
 
     // This might be middle mouse navigation.
     if (event.button == 1) {
       sendAsyncMessage("Content:Click", json);
     }
   },
 
-  onCertError: function (targetElement, ownerDoc) {
+  onCertError: function(targetElement, ownerDoc) {
     let docShell = ownerDoc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor)
                                        .getInterface(Ci.nsIWebNavigation)
                                        .QueryInterface(Ci.nsIDocShell);
     sendAsyncMessage("Browser:CertExceptionError", {
       location: ownerDoc.location.href,
       elementId: targetElement.getAttribute("id"),
       isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView),
       securityInfoAsString: getSerializedSecurityInfo(docShell),
     });
   },
 
-  onAboutBlocked: function (targetElement, ownerDoc) {
+  onAboutBlocked: function(targetElement, ownerDoc) {
     var reason = 'phishing';
     if (/e=malwareBlocked/.test(ownerDoc.documentURI)) {
       reason = 'malware';
     } else if (/e=unwantedBlocked/.test(ownerDoc.documentURI)) {
       reason = 'unwanted';
     }
     sendAsyncMessage("Browser:SiteBlockedError", {
       location: ownerDoc.location.href,
       reason: reason,
       elementId: targetElement.getAttribute("id"),
       isTopFrame: (ownerDoc.defaultView.parent === ownerDoc.defaultView)
     });
   },
 
-  onAboutNetError: function (event, documentURI) {
+  onAboutNetError: function(event, documentURI) {
     let elmId = event.originalTarget.getAttribute("id");
     if (elmId == "returnButton") {
       sendAsyncMessage("Browser:SSLErrorGoBack", {});
       return;
     }
     if (elmId != "errorTryAgain" || !/e=netOffline/.test(documentURI)) {
       return;
     }
@@ -678,17 +678,17 @@ var PageMetadataMessenger = {
         sendAsyncMessage("PageMetadata:MicroformatsResult", result);
         break;
       }
     }
   }
 }
 PageMetadataMessenger.init();
 
-addEventListener("ActivateSocialFeature", function (aEvent) {
+addEventListener("ActivateSocialFeature", function(aEvent) {
   let document = content.document;
   let dwu = content.QueryInterface(Ci.nsIInterfaceRequestor)
                    .getInterface(Ci.nsIDOMWindowUtils);
   if (!dwu.isHandlingUserInput) {
     Cu.reportError("attempt to activate provider without user input from " + document.nodePrincipal.origin);
     return;
   }
 
@@ -830,17 +830,17 @@ addMessageListener("ContextMenu:SearchFi
 
     let type = el.type.toLowerCase();
 
     if (((el instanceof content.HTMLInputElement && el.mozIsTextField(true)) ||
         type == "hidden" || type == "textarea") ||
         ((type == "checkbox" || type == "radio") && el.checked)) {
       formData.push(escapeNameValuePair(el.name, el.value, isURLEncoded));
     } else if (el instanceof content.HTMLSelectElement && el.selectedIndex >= 0) {
-      for (let j=0; j < el.options.length; j++) {
+      for (let j = 0; j < el.options.length; j++) {
         if (el.options[j].selected)
           formData.push(escapeNameValuePair(el.name, el.options[j].value,
                                             isURLEncoded));
       }
     }
   }
 
   let postData;
@@ -868,17 +868,17 @@ var LightWeightThemeWebInstallListener =
   _previewWindow: null,
 
   init: function() {
     addEventListener("InstallBrowserTheme", this, false, true);
     addEventListener("PreviewBrowserTheme", this, false, true);
     addEventListener("ResetBrowserThemePreview", this, false, true);
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     switch (event.type) {
       case "InstallBrowserTheme": {
         sendAsyncMessage("LightWeightThemeWebInstaller:Install", {
           baseURI: event.target.baseURI,
           themeData: event.target.getAttribute("data-browsertheme"),
         });
         break;
       }
@@ -902,17 +902,17 @@ var LightWeightThemeWebInstallListener =
                            {baseURI: event.target.baseURI});
           this._resetPreviewWindow();
         }
         break;
       }
     }
   },
 
-  _resetPreviewWindow: function () {
+  _resetPreviewWindow: function() {
     this._previewWindow.removeEventListener("pagehide", this, true);
     this._previewWindow = null;
   }
 };
 
 LightWeightThemeWebInstallListener.init();
 
 function disableSetDesktopBackground(aTarget) {
@@ -1142,18 +1142,18 @@ var PageInfoListener = {
   getMediaItems: function(document, strings, elem)
   {
     // Check for images defined in CSS (e.g. background, borders)
     let computedStyle = elem.ownerGlobal.getComputedStyle(elem);
     // A node can have multiple media items associated with it - for example,
     // multiple background images.
     let mediaItems = [];
 
-    let addImage = (url, type, alt, elem, isBg) => {
-      let element = this.serializeElementInfo(document, url, type, alt, elem, isBg);
+    let addImage = (url, type, alt, el, isBg) => {
+      let element = this.serializeElementInfo(document, url, type, alt, el, isBg);
       mediaItems.push([url, type, alt, element, isBg]);
     };
 
     if (computedStyle) {
       let addImgFunc = (label, val) => {
         if (val.primitiveType == content.CSSPrimitiveValue.CSS_URI) {
           addImage(val.getStringValue(), label, strings.notSet, elem, true);
         }
--- a/browser/base/content/contentSearchUI.js
+++ b/browser/base/content/contentSearchUI.js
@@ -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/. */
 
 "use strict";
 
-this.ContentSearchUIController = (function () {
+this.ContentSearchUIController = (function() {
 
 const MAX_DISPLAYED_SUGGESTIONS = 6;
 const SUGGESTION_ID_PREFIX = "searchSuggestion";
 const ONE_OFF_ID_PREFIX = "oneOff";
 
 const HTML_NS = "http://www.w3.org/1999/xhtml";
 
 /**
@@ -33,17 +33,17 @@ const HTML_NS = "http://www.w3.org/1999/
  *        This will be sent with the search data for FHR to record the search.
  * @param searchPurpose
  *        Sent with search data, see nsISearchEngine.getSubmission.
  * @param idPrefix
  *        The IDs of elements created by the object will be prefixed with this
  *        string.
  */
 function ContentSearchUIController(inputElement, tableParent, healthReportKey,
-                                   searchPurpose, idPrefix="") {
+                                   searchPurpose, idPrefix = "") {
   this.input = inputElement;
   this._idPrefix = idPrefix;
   this._healthReportKey = healthReportKey;
   this._searchPurpose = searchPurpose;
 
   let tableID = idPrefix + "searchSuggestionTable";
   this.input.autocomplete = "off";
   this.input.setAttribute("aria-autocomplete", "true");
@@ -188,52 +188,52 @@ ContentSearchUIController.prototype = {
     }
     return this.defaultEngine.name;
   },
 
   get numSuggestions() {
     return this._suggestionsList.children.length;
   },
 
-  selectAndUpdateInput: function (idx) {
+  selectAndUpdateInput: function(idx) {
     this.selectedIndex = idx;
     let newValue = this.suggestionAtIndex(idx) || this._stickyInputValue;
     // Setting the input value when the value has not changed commits the current
     // IME composition, which we don't want to do.
     if (this.input.value != newValue) {
       this.input.value = newValue;
     }
     this._updateSearchWithHeader();
   },
 
-  suggestionAtIndex: function (idx) {
+  suggestionAtIndex: function(idx) {
     let row = this._suggestionsList.children[idx];
     return row ? row.textContent : null;
   },
 
-  deleteSuggestionAtIndex: function (idx) {
+  deleteSuggestionAtIndex: function(idx) {
     // Only form history suggestions can be deleted.
     if (this.isFormHistorySuggestionAtIndex(idx)) {
       let suggestionStr = this.suggestionAtIndex(idx);
       this._sendMsg("RemoveFormHistoryEntry", suggestionStr);
       this._suggestionsList.children[idx].remove();
       this.selectAndUpdateInput(-1);
     }
   },
 
-  isFormHistorySuggestionAtIndex: function (idx) {
+  isFormHistorySuggestionAtIndex: function(idx) {
     let row = this._suggestionsList.children[idx];
     return row && row.classList.contains("formHistory");
   },
 
-  addInputValueToFormHistory: function () {
+  addInputValueToFormHistory: function() {
     this._sendMsg("AddFormHistoryEntry", this.input.value);
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     this["_on" + event.type[0].toUpperCase() + event.type.substr(1)](event);
   },
 
   _onCommand: function(aEvent) {
     if (this.selectedButtonIndex == this._oneOffButtons.length) {
       // Settings button was selected.
       this._sendMsg("ManageEngines");
       return;
@@ -241,17 +241,17 @@ ContentSearchUIController.prototype = {
 
     this.search(aEvent);
 
     if (aEvent) {
       aEvent.preventDefault();
     }
   },
 
-  search: function (aEvent) {
+  search: function(aEvent) {
     if (!this.defaultEngine) {
       return; // Not initialized yet.
     }
 
     let searchText = this.input;
     let searchTerms;
     if (this._table.hidden ||
         aEvent.originalTarget.id == "contentSearchDefaultEngineHeader" ||
@@ -290,30 +290,30 @@ ContentSearchUIController.prototype = {
         eventData.selection.kind = "key";
       }
     }
 
     this._sendMsg("Search", eventData);
     this.addInputValueToFormHistory();
   },
 
-  _onInput: function () {
+  _onInput: function() {
     if (!this.input.value) {
       this._stickyInputValue = "";
       this._hideSuggestions();
     }
     else if (this.input.value != this._stickyInputValue) {
       // Only fetch new suggestions if the input value has changed.
       this._getSuggestions();
       this.selectAndUpdateInput(-1);
     }
     this._updateSearchWithHeader();
   },
 
-  _onKeypress: function (event) {
+  _onKeypress: function(event) {
     let selectedIndexDelta = 0;
     let selectedSuggestionDelta = 0;
     let selectedOneOffDelta = 0;
 
     switch (event.keyCode) {
     case event.DOM_VK_UP:
       if (this._table.hidden) {
         return;
@@ -450,92 +450,92 @@ ContentSearchUIController.prototype = {
       this.selectedButtonIndex = newSelectedIndex;
     }
 
     // Prevent the input's caret from moving.
     event.preventDefault();
   },
 
   _currentEngineIndex: -1,
-  _cycleCurrentEngine: function (aReverse) {
+  _cycleCurrentEngine: function(aReverse) {
     if ((this._currentEngineIndex == this._engines.length - 1 && !aReverse) ||
         (this._currentEngineIndex == 0 && aReverse)) {
       return;
     }
     this._currentEngineIndex += aReverse ? -1 : 1;
     let engineName = this._engines[this._currentEngineIndex].name;
     this._sendMsg("SetCurrentEngine", engineName);
   },
 
-  _onFocus: function () {
+  _onFocus: function() {
     if (this._mousedown) {
       return;
     }
     // When the input box loses focus to something in our table, we refocus it
     // immediately. This causes the focus highlight to flicker, so we set a
     // custom attribute which consumers should use for focus highlighting. This
     // attribute is removed only when we do not immediately refocus the input
     // box, thus eliminating flicker.
     this.input.setAttribute("keepfocus", "true");
     this._speculativeConnect();
   },
 
-  _onBlur: function () {
+  _onBlur: function() {
     if (this._mousedown) {
       // At this point, this.input has lost focus, but a new element has not yet
       // received it. If we re-focus this.input directly, the new element will
       // steal focus immediately, so we queue it instead.
       setTimeout(() => this.input.focus(), 0);
       return;
     }
     this.input.removeAttribute("keepfocus");
     this._hideSuggestions();
   },
 
-  _onMousemove: function (event) {
+  _onMousemove: function(event) {
     let idx = this._indexOfTableItem(event.target);
     if (idx >= this.numSuggestions) {
       this.selectedButtonIndex = idx - this.numSuggestions;
       return;
     }
     this.selectedIndex = idx;
   },
 
-  _onMouseup: function (event) {
+  _onMouseup: function(event) {
     if (event.button == 2) {
       return;
     }
     this._onCommand(event);
   },
 
-  _onMouseout: function (event) {
+  _onMouseout: function(event) {
     // We only deselect one-off buttons and the settings button when they are
     // moused out.
     let idx = this._indexOfTableItem(event.originalTarget);
     if (idx >= this.numSuggestions) {
       this.selectedButtonIndex = -1;
     }
   },
 
-  _onClick: function (event) {
+  _onClick: function(event) {
     this._onMouseup(event);
   },
 
-  _onContentSearchService: function (event) {
+  _onContentSearchService: function(event) {
     let methodName = "_onMsg" + event.detail.type;
     if (methodName in this) {
       this[methodName](event.detail.data);
     }
   },
 
-  _onMsgFocusInput: function (event) {
+  _onMsgFocusInput: function(event) {
     this.input.focus();
   },
 
-  _onMsgSuggestions: function (suggestions) {
+  _onMsgSuggestions: function(suggestions) {
     // Ignore the suggestions if their search string or engine doesn't match
     // ours.  Due to the async nature of message passing, this can easily happen
     // when the user types quickly.
     if (this._stickyInputValue != suggestions.searchString ||
         this.defaultEngine.name != suggestions.engineName) {
       return;
     }
 
@@ -580,84 +580,84 @@ ContentSearchUIController.prototype = {
       this.input.setAttribute("aria-expanded", "true");
       this._originalDefaultEngine = {
         name: this.defaultEngine.name,
         icon: this.defaultEngine.icon,
       };
     }
   },
 
-  _onMsgSuggestionsCancelled: function () {
+  _onMsgSuggestionsCancelled: function() {
     if (!this._table.hidden) {
       this._hideSuggestions();
     }
   },
 
-  _onMsgState: function (state) {
+  _onMsgState: function(state) {
     this.engines = state.engines;
     // No point updating the default engine (and the header) if there's no change.
     if (this.defaultEngine &&
         this.defaultEngine.name == state.currentEngine.name &&
         this.defaultEngine.icon == state.currentEngine.icon) {
       return;
     }
     this.defaultEngine = state.currentEngine;
   },
 
-  _onMsgCurrentState: function (state) {
+  _onMsgCurrentState: function(state) {
     this._onMsgState(state);
   },
 
-  _onMsgCurrentEngine: function (engine) {
+  _onMsgCurrentEngine: function(engine) {
     this.defaultEngine = engine;
     this._pendingOneOffRefresh = true;
   },
 
-  _onMsgStrings: function (strings) {
+  _onMsgStrings: function(strings) {
     this._strings = strings;
     this._updateDefaultEngineHeader();
     this._updateSearchWithHeader();
     document.getElementById("contentSearchSettingsButton").textContent =
       this._strings.searchSettings;
     this.input.setAttribute("placeholder", this._strings.searchPlaceholder);
   },
 
-  _updateDefaultEngineHeader: function () {
+  _updateDefaultEngineHeader: function() {
     let header = document.getElementById("contentSearchDefaultEngineHeader");
     header.firstChild.setAttribute("src", this.defaultEngine.icon);
     if (!this._strings) {
       return;
     }
     while (header.firstChild.nextSibling) {
       header.firstChild.nextSibling.remove();
     }
     header.appendChild(document.createTextNode(
       this._strings.searchHeader.replace("%S", this.defaultEngine.name)));
   },
 
-  _updateSearchWithHeader: function () {
+  _updateSearchWithHeader: function() {
     if (!this._strings) {
       return;
     }
     let searchWithHeader = document.getElementById("contentSearchSearchWithHeader");
     if (this.input.value) {
       searchWithHeader.innerHTML = this._strings.searchForSomethingWith;
       searchWithHeader.querySelector('.contentSearchSearchWithHeaderSearchText').textContent = this.input.value;
     } else {
       searchWithHeader.textContent = this._strings.searchWithHeader;
     }
   },
 
-  _speculativeConnect: function () {
+  _speculativeConnect: function() {
     if (this.defaultEngine) {
       this._sendMsg("SpeculativeConnect", this.defaultEngine.name);
     }
   },
 
-  _makeTableRow: function (type, suggestionStr, currentRow, searchWords) {
+  _makeTableRow: function(type, suggestionStr, currentRow, searchWords) {
     let row = document.createElementNS(HTML_NS, "tr");
     row.dir = "auto";
     row.classList.add("contentSearchSuggestionRow");
     row.classList.add(type);
     row.setAttribute("role", "presentation");
     row.addEventListener("mousemove", this);
     row.addEventListener("mouseup", this);
 
@@ -684,79 +684,79 @@ ContentSearchUIController.prototype = {
       }
     }
 
     row.appendChild(entry);
     return row;
   },
 
   // Converts favicon array buffer into a data URI.
-  _getFaviconURIFromBuffer: function (buffer) {
+  _getFaviconURIFromBuffer: function(buffer) {
     let blob = new Blob([buffer]);
     return URL.createObjectURL(blob);
   },
 
   // Adds "@2x" to the name of the given PNG url for "retina" screens.
-  _getImageURIForCurrentResolution: function (uri) {
+  _getImageURIForCurrentResolution: function(uri) {
     if (window.devicePixelRatio > 1) {
       return uri.replace(/\.png$/, "@2x.png");
     }
     return uri;
   },
 
-  _getSearchEngines: function () {
+  _getSearchEngines: function() {
     this._sendMsg("GetState");
   },
 
-  _getStrings: function () {
+  _getStrings: function() {
     this._sendMsg("GetStrings");
   },
 
-  _getSuggestions: function () {
+  _getSuggestions: function() {
     this._stickyInputValue = this.input.value;
     if (this.defaultEngine) {
       this._sendMsg("GetSuggestions", {
         engineName: this.defaultEngine.name,
         searchString: this.input.value,
         remoteTimeout: this.remoteTimeout,
       });
     }
   },
 
   _clearSuggestionRows: function() {
     while (this._suggestionsList.firstElementChild) {
       this._suggestionsList.firstElementChild.remove();
     }
   },
 
-  _hideSuggestions: function () {
+  _hideSuggestions: function() {
     this.input.setAttribute("aria-expanded", "false");
     this.selectedIndex = -1;
     this.selectedButtonIndex = -1;
     this._currentEngineIndex = -1;
     this._table.hidden = true;
   },
 
-  _indexOfTableItem: function (elt) {
+  _indexOfTableItem: function(elt) {
     if (elt.classList.contains("contentSearchOneOffItem")) {
       return this.numSuggestions + this._oneOffButtons.indexOf(elt);
     }
     if (elt.classList.contains("contentSearchSettingsButton")) {
       return this.numSuggestions + this._oneOffButtons.length;
     }
     while (elt && elt.localName != "tr") {
       elt = elt.parentNode;
     }
     if (!elt) {
       throw new Error("Element is not a row");
     }
     return elt.rowIndex;
   },
 
-  _makeTable: function (id) {
+  _makeTable: function(id) {
     this._table = document.createElementNS(HTML_NS, "table");
     this._table.id = id;
     this._table.hidden = true;
     this._table.classList.add("contentSearchSuggestionTable");
     this._table.setAttribute("role", "presentation");
 
     // When the search input box loses focus, we want to immediately give focus
     // back to it if the blur was because the user clicked somewhere in the table.
@@ -815,17 +815,17 @@ ContentSearchUIController.prototype = {
     button.id = "contentSearchSettingsButton";
     button.addEventListener("click", this);
     button.addEventListener("mousemove", this);
     this._table.appendChild(button);
 
     return this._table;
   },
 
-  _setUpOneOffButtons: function () {
+  _setUpOneOffButtons: function() {
     // Sometimes we receive a CurrentEngine message from the ContentSearch service
     // before we've received a State message - i.e. before we have our engines.
     if (!this._engines) {
       return;
     }
 
     while (this._oneOffsTable.firstChild.nextSibling) {
       this._oneOffsTable.firstChild.nextSibling.remove();
@@ -896,17 +896,17 @@ ContentSearchUIController.prototype = {
       cell.appendChild(button);
       this._oneOffButtons.push(button);
     }
     row.appendChild(cell);
     this._oneOffsTable.appendChild(row);
     this._oneOffsTable.hidden = false;
   },
 
-  _sendMsg: function (type, data=null) {
+  _sendMsg: function(type, data = null) {
     dispatchEvent(new CustomEvent("ContentSearchClient", {
       detail: {
         type: type,
         data: data,
       },
     }));
   },
 };
--- a/browser/base/content/pageinfo/pageInfo.js
+++ b/browser/base/content/pageinfo/pageInfo.js
@@ -720,19 +720,19 @@ function selectSaveFolder(aCallback)
   fp.open(fpCallback);
 }
 
 function saveMedia()
 {
   var tree = document.getElementById("imagetree");
   var rowArray = getSelectedRows(tree);
   if (rowArray.length == 1) {
-    var row = rowArray[0];
-    var item = gImageView.data[row][COL_IMAGE_NODE];
-    var url = gImageView.data[row][COL_IMAGE_ADDRESS];
+    let row = rowArray[0];
+    let item = gImageView.data[row][COL_IMAGE_NODE];
+    let url = gImageView.data[row][COL_IMAGE_ADDRESS];
 
     if (url) {
       var titleKey = "SaveImageTitle";
 
       if (item instanceof HTMLVideoElement)
         titleKey = "SaveVideoTitle";
       else if (item instanceof HTMLAudioElement)
         titleKey = "SaveAudioTitle";
@@ -745,21 +745,21 @@ function saveMedia()
       if (aDirectory) {
         var saveAnImage = function(aURIString, aChosenData, aBaseURI) {
           uniqueFile(aChosenData.file);
           internalSave(aURIString, null, null, null, null, false, "SaveImageTitle",
                        aChosenData, aBaseURI, null, false, null, gDocInfo.isContentWindowPrivate);
         };
 
         for (var i = 0; i < rowArray.length; i++) {
-          var v = rowArray[i];
-          var dir = aDirectory.clone();
-          var item = gImageView.data[v][COL_IMAGE_NODE];
-          var uriString = gImageView.data[v][COL_IMAGE_ADDRESS];
-          var uri = makeURI(uriString);
+          let v = rowArray[i];
+          let dir = aDirectory.clone();
+          let item = gImageView.data[v][COL_IMAGE_NODE];
+          let uriString = gImageView.data[v][COL_IMAGE_ADDRESS];
+          let uri = makeURI(uriString);
 
           try {
             uri.QueryInterface(Components.interfaces.nsIURL);
             dir.append(decodeURIComponent(uri.fileName));
           } catch (ex) {
             // data:/blob: uris
             // Supply a dummy filename, otherwise Download Manager
             // will try to delete the base directory on failure.
@@ -999,17 +999,17 @@ function makeBlockImage(url)
       checkbox.checked = perm == nsIPermissionManager.DENY_ACTION;
     }
     else
       checkbox.hidden = true;
   }
 }
 
 var imagePermissionObserver = {
-  observe: function (aSubject, aTopic, aData)
+  observe: function(aSubject, aTopic, aData)
   {
     if (document.getElementById("mediaPreviewBox").collapsed)
       return;
 
     if (aTopic == "perm-changed") {
       var permission = aSubject.QueryInterface(Components.interfaces.nsIPermission);
       if (permission.type == "image") {
         var imageTree = document.getElementById("imagetree");
--- a/browser/base/content/pageinfo/permissions.js
+++ b/browser/base/content/pageinfo/permissions.js
@@ -10,17 +10,17 @@ const nsIQuotaManagerService = Component
 var gPermURI;
 var gPermPrincipal;
 var gUsageRequest;
 
 var gPermissions = SitePermissions.listPermissions();
 gPermissions.push("plugins");
 
 var permissionObserver = {
-  observe: function (aSubject, aTopic, aData)
+  observe: function(aSubject, aTopic, aData)
   {
     if (aTopic == "perm-changed") {
       var permission = aSubject.QueryInterface(Components.interfaces.nsIPermission);
       if (permission.matchesURI(gPermURI, true)) {
         if (gPermissions.indexOf(permission.type) > -1)
           initRow(permission.type);
         else if (permission.type.startsWith("plugin"))
           setPluginsRadioState();
--- a/browser/base/content/pageinfo/security.js
+++ b/browser/base/content/pageinfo/security.js
@@ -10,17 +10,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 
 var security = {
   init: function(uri, windowInfo) {
     this.uri = uri;
     this.windowInfo = windowInfo;
   },
 
   // Display the server certificate (static)
-  viewCert : function () {
+  viewCert : function() {
     var cert = security._cert;
     viewCertHelper(window, cert);
   },
 
   _getSecurityInfo : function() {
     const nsISSLStatusProvider = Components.interfaces.nsISSLStatusProvider;
     const nsISSLStatus = Components.interfaces.nsISSLStatus;
 
--- a/browser/base/content/sanitize.js
+++ b/browser/base/content/sanitize.js
@@ -33,24 +33,24 @@ XPCOMUtils.defineLazyModuleGetter(this, 
  * to the system.
  */
 const YIELD_PERIOD = 10;
 
 function Sanitizer() {
 }
 Sanitizer.prototype = {
   // warning to the caller: this one may raise an exception (e.g. bug #265028)
-  clearItem: function (aItemName)
+  clearItem: function(aItemName)
   {
     this.items[aItemName].clear();
   },
 
   prefDomain: "",
 
-  getNameFromPreference: function (aPreferenceName)
+  getNameFromPreference: function(aPreferenceName)
   {
     return aPreferenceName.substr(this.prefDomain.length);
   },
 
   /**
    * Deletes privacy sensitive data in a batch, according to user preferences.
    * Returns a promise which is resolved if no errors occurred.  If an error
    * occurs, a message is reported to the console and all other items are still
@@ -726,17 +726,17 @@ Sanitizer.TIMESPAN_4HOURS     = 3;
 Sanitizer.TIMESPAN_TODAY      = 4;
 Sanitizer.TIMESPAN_5MIN       = 5;
 Sanitizer.TIMESPAN_24HOURS    = 6;
 
 // Return a 2 element array representing the start and end times,
 // in the uSec-since-epoch format that PRTime likes.  If we should
 // clear everything, return null.  Use ts if it is defined; otherwise
 // use the timeSpan pref.
-Sanitizer.getClearRange = function (ts) {
+Sanitizer.getClearRange = function(ts) {
   if (ts === undefined)
     ts = Sanitizer.prefs.getIntPref("timeSpan");
   if (ts === Sanitizer.TIMESPAN_EVERYTHING)
     return null;
 
   // PRTime is microseconds while JS time is milliseconds
   var endDate = Date.now() * 1000;
   switch (ts) {
@@ -776,17 +776,17 @@ Sanitizer.__defineGetter__("prefs", func
                          .getService(Components.interfaces.nsIPrefService)
                          .getBranch(Sanitizer.PREF_DOMAIN);
 });
 
 // Shows sanitization UI
 Sanitizer.showUI = function(aParentWindow)
 {
   let win = AppConstants.platform == "macosx" ?
-    null: // make this an app-modal window on Mac
+    null : // make this an app-modal window on Mac
     aParentWindow;
   Services.ww.openWindow(win,
                          "chrome://browser/content/sanitize.xul",
                          "Sanitize",
                          "chrome,titlebar,dialog,centerscreen,modal",
                          null);
 };
 
--- a/browser/base/content/sync/aboutSyncTabs.js
+++ b/browser/base/content/sync/aboutSyncTabs.js
@@ -18,50 +18,50 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 if (AppConstants.MOZ_SERVICES_CLOUDSYNC) {
   XPCOMUtils.defineLazyModuleGetter(this, "CloudSync",
                                     "resource://gre/modules/CloudSync.jsm");
 }
 
 var RemoteTabViewer = {
   _tabsList: null,
 
-  init: function () {
+  init: function() {
     Services.obs.addObserver(this, "weave:service:login:finish", false);
     Services.obs.addObserver(this, "weave:engine:sync:finish", false);
 
     Services.obs.addObserver(this, "cloudsync:tabs:update", false);
 
     this._tabsList = document.getElementById("tabsList");
 
     this.buildList(true);
   },
 
-  uninit: function () {
+  uninit: function() {
     Services.obs.removeObserver(this, "weave:service:login:finish");
     Services.obs.removeObserver(this, "weave:engine:sync:finish");
 
     Services.obs.removeObserver(this, "cloudsync:tabs:update");
   },
 
-  createItem: function (attrs) {
+  createItem: function(attrs) {
     let item = document.createElement("richlistitem");
 
     // Copy the attributes from the argument into the item.
     for (let attr in attrs) {
       item.setAttribute(attr, attrs[attr]);
     }
 
     if (attrs["type"] == "tab") {
       item.label = attrs.title != "" ? attrs.title : attrs.url;
     }
 
     return item;
   },
 
-  filterTabs: function (event) {
+  filterTabs: function(event) {
     let val = event.target.value.toLowerCase();
     let numTabs = this._tabsList.getRowCount();
     let clientTabs = 0;
     let currentClient = null;
 
     for (let i = 0; i < numTabs; i++) {
       let item = this._tabsList.getItemAtIndex(i);
       let hide = false;
@@ -84,48 +84,48 @@ var RemoteTabViewer = {
       }
       item.hidden = hide;
     }
     if (clientTabs == 0) {
       currentClient.hidden = true;
     }
   },
 
-  openSelected: function () {
+  openSelected: function() {
     let items = this._tabsList.selectedItems;
     let urls = [];
     for (let i = 0; i < items.length; i++) {
       if (items[i].getAttribute("type") == "tab") {
         urls.push(items[i].getAttribute("url"));
         let index = this._tabsList.getIndexOfItem(items[i]);
         this._tabsList.removeItemAt(index);
       }
     }
     if (urls.length) {
       getTopWin().gBrowser.loadTabs(urls);
       this._tabsList.clearSelection();
     }
   },
 
-  bookmarkSingleTab: function () {
+  bookmarkSingleTab: function() {
     let item = this._tabsList.selectedItems[0];
     let uri = Weave.Utils.makeURI(item.getAttribute("url"));
     let title = item.getAttribute("title");
     PlacesUIUtils.showBookmarkDialog({ action: "add"
                                      , type: "bookmark"
                                      , uri: uri
                                      , title: title
                                      , hiddenRows: [ "description"
                                                    , "location"
                                                    , "loadInSidebar"
                                                    , "keyword" ]
                                      }, window.top);
   },
 
-  bookmarkSelectedTabs: function () {
+  bookmarkSelectedTabs: function() {
     let items = this._tabsList.selectedItems;
     let URIs = [];
     for (let i = 0; i < items.length; i++) {
       if (items[i].getAttribute("type") == "tab") {
         let uri = Weave.Utils.makeURI(items[i].getAttribute("url"));
         if (!uri) {
           continue;
         }
@@ -137,33 +137,33 @@ var RemoteTabViewer = {
       PlacesUIUtils.showBookmarkDialog({ action: "add"
                                        , type: "folder"
                                        , URIList: URIs
                                        , hiddenRows: [ "description" ]
                                        }, window.top);
     }
   },
 
-  getIcon: function (iconUri, defaultIcon) {
+  getIcon: function(iconUri, defaultIcon) {
     try {
       let iconURI = Weave.Utils.makeURI(iconUri);
       return PlacesUtils.favicons.getFaviconLinkForIcon(iconURI).spec;
     } catch (ex) {
       // Do nothing.
     }
 
     // Just give the provided default icon or the system's default.
     return defaultIcon || PlacesUtils.favicons.defaultFavicon.spec;
   },
 
   _waitingForBuildList: false,
 
   _buildListRequested: false,
 
-  buildList: function (forceSync) {
+  buildList: function(forceSync) {
     if (this._waitingForBuildList) {
       this._buildListRequested = true;
       return;
     }
 
     this._waitingForBuildList = true;
     this._buildListRequested = false;
 
@@ -187,29 +187,29 @@ var RemoteTabViewer = {
     if (CloudSync && CloudSync.ready && CloudSync().tabsReady && CloudSync().tabs.hasRemoteTabs()) {
       this._generateCloudSyncTabList()
           .then(complete, complete);
     } else {
       complete();
     }
   },
 
-  _clearTabList: function () {
+  _clearTabList: function() {
     let list = this._tabsList;
 
     // Clear out existing richlistitems.
     let count = list.getRowCount();
     if (count > 0) {
       for (let i = count - 1; i >= 0; i--) {
         list.removeItemAt(i);
       }
     }
   },
 
-  _generateWeaveTabList: function () {
+  _generateWeaveTabList: function() {
     let engine = Weave.Service.engineManager.get("tabs");
     let list = this._tabsList;
 
     let seenURLs = new Set();
     let localURLs = engine.getOpenURLs();
 
     for (let [, client] of Object.entries(engine.getAllClients())) {
       // Create the client node, but don't add it in-case we don't show any tabs
@@ -240,18 +240,18 @@ var RemoteTabViewer = {
           icon:  this.getIcon(icon),
         }
         let tab = this.createItem(attrs);
         list.appendChild(tab);
       }, this);
     }
   },
 
-  _generateCloudSyncTabList: function () {
-    let updateTabList = function (remoteTabs) {
+  _generateCloudSyncTabList: function() {
+    let updateTabList = function(remoteTabs) {
       let list = this._tabsList;
 
       for (let client of remoteTabs) {
         let clientAttrs = {
           type: "client",
           clientName: client.name,
         };
 
@@ -270,17 +270,17 @@ var RemoteTabViewer = {
         }
       }
     }.bind(this);
 
     return CloudSync().tabs.getRemoteTabs()
                            .then(updateTabList, Promise.reject.bind(Promise));
   },
 
-  adjustContextMenu: function (event) {
+  adjustContextMenu: function(event) {
     let mode = "all";
     switch (this._tabsList.selectedItems.length) {
       case 0:
         break;
       case 1:
         mode = "single"
         break;
       default:
@@ -295,17 +295,17 @@ var RemoteTabViewer = {
       if (showFor) {
         el.hidden = showFor != mode && showFor != "all";
       }
 
       el = el.nextSibling;
     }
   },
 
-  _refetchTabs: function (force) {
+  _refetchTabs: function(force) {
     if (!force) {
       // Don't bother refetching tabs if we already did so recently
       let lastFetch = 0;
       try {
         lastFetch = Services.prefs.getIntPref("services.sync.lastTabFetch");
       }
       catch (e) {
         /* Just use the default value of 0 */
@@ -320,17 +320,17 @@ var RemoteTabViewer = {
     // Ask Sync to just do the tabs engine if it can.
     Weave.Service.sync(["tabs"]);
     Services.prefs.setIntPref("services.sync.lastTabFetch",
                               Math.floor(Date.now() / 1000));
 
     return true;
   },
 
-  observe: function (subject, topic, data) {
+  observe: function(subject, topic, data) {
     switch (topic) {
       case "weave:service:login:finish":
         // A login has finished, which means that a Sync is about to start and
         // we will eventually get to the "tabs" engine - but try and force the
         // tab engine to sync first by passing |true| for the forceSync param.
         this.buildList(true);
         break;
       case "weave:engine:sync:finish":
@@ -341,17 +341,17 @@ var RemoteTabViewer = {
         }
         break;
       case "cloudsync:tabs:update":
         this.buildList(false);
         break;
     }
   },
 
-  handleClick: function (event) {
+  handleClick: function(event) {
     if (event.target.getAttribute("type") != "tab") {
       return;
     }
 
     if (event.button == 1) {
       let url = event.target.getAttribute("url");
       openUILink(url, event);
       let index = this._tabsList.getIndexOfItem(event.target);
--- a/browser/base/content/sync/addDevice.js
+++ b/browser/base/content/sync/addDevice.js
@@ -145,13 +145,13 @@ var gSyncAddDevice = {
 
   goToSyncKeyPage: function goToSyncKeyPage() {
     this.wizard.pageIndex = SYNC_KEY_PAGE;
   }
 
 };
 // onWizardAdvance() and onPageShow() are run before init() so we'll set
 // these up as lazy getters.
-["wizard", "pin1", "pin2", "pin3"].forEach(function (id) {
+["wizard", "pin1", "pin2", "pin3"].forEach(function(id) {
   XPCOMUtils.defineLazyGetter(gSyncAddDevice, id, function() {
     return document.getElementById(id);
   });
 });
--- a/browser/base/content/sync/customize.js
+++ b/browser/base/content/sync/customize.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 
-addEventListener("dialogaccept", function () {
+addEventListener("dialogaccept", function() {
   let pane = document.getElementById("sync-customize-pane");
   // First determine what the preference for the "global" sync enabled pref
   // should be based on the engines selected.
   let prefElts = pane.querySelectorAll("preferences > preference");
   let syncEnabled = false;
   for (let elt of prefElts) {
     if (elt.name.startsWith("services.sync.") && elt.value) {
       syncEnabled = true;
--- a/browser/base/content/sync/genericChange.js
+++ b/browser/base/content/sync/genericChange.js
@@ -142,17 +142,17 @@ var Change = {
       case "ResetPassphrase":
         return this.doChangePassphrase();
       case "ChangePassword":
         return this.doChangePassword();
     }
     return undefined;
   },
 
-  doGeneratePassphrase: function () {
+  doGeneratePassphrase: function() {
     let passphrase = Weave.Utils.generatePassphrase();
     this._passphraseBox.value = Weave.Utils.hyphenatePassphrase(passphrase);
     this._dialog.getButton("finish").disabled = false;
   },
 
   doChangePassphrase: function Change_doChangePassphrase() {
     let pp = Weave.Utils.normalizePassphrase(this._passphraseBox.value);
     if (this._updatingPassphrase) {
@@ -196,17 +196,17 @@ var Change = {
         this._updateStatus("change.password.status.success", "success");
       else
         this._updateStatus("change.password.status.error", "error");
     }
 
     return false;
   },
 
-  validate: function (event) {
+  validate: function(event) {
     let valid = false;
     let errorString = "";
 
     if (this._dialogType == "ChangePassword") {
       if (this._currentPasswordInvalid)
         [valid, errorString] = gSyncUtils.validatePassword(this._firstBox);
       else
         [valid, errorString] = gSyncUtils.validatePassword(this._firstBox, this._secondBox);
--- a/browser/base/content/sync/setup.js
+++ b/browser/base/content/sync/setup.js
@@ -56,17 +56,17 @@ var gSyncSetup = {
   },
 
   get _usingMainServers() {
     if (this._settingUpNew)
       return document.getElementById("server").selectedIndex == 0;
     return document.getElementById("existingServer").selectedIndex == 0;
   },
 
-  init: function () {
+  init: function() {
     let obs = [
       ["weave:service:change-passphrase", "onResetPassphrase"],
       ["weave:service:login:start",       "onLoginStart"],
       ["weave:service:login:error",       "onLoginEnd"],
       ["weave:service:login:finish",      "onLoginEnd"]];
 
     // Add the observers now and remove them on unload
     let self = this;
@@ -78,17 +78,17 @@ var gSyncSetup = {
           Weave.Svc.Obs.add(topic, self[func], self);
         else
           Weave.Svc.Obs.remove(topic, self[func], self);
       });
     };
     addRem(true);
     window.addEventListener("unload", () => addRem(false), false);
 
-    window.setTimeout(function () {
+    window.setTimeout(function() {
       // Force Service to be loaded so that engines are registered.
       // See Bug 670082.
       Weave.Service;
     }, 0);
 
     this.captchaBrowser = document.getElementById("captcha");
 
     this.wizardType = null;
@@ -116,24 +116,24 @@ var gSyncSetup = {
     this._nextButtonLabel = this.wizard.getButton("next").label;
     this._nextButtonAccesskey = this.wizard.getButton("next")
                                            .getAttribute("accesskey");
     this._backButtonLabel = this.wizard.getButton("back").label;
     this._backButtonAccesskey = this.wizard.getButton("back")
                                            .getAttribute("accesskey");
   },
 
-  startNewAccountSetup: function () {
+  startNewAccountSetup: function() {
     if (!Weave.Utils.ensureMPUnlocked())
       return;
     this._settingUpNew = true;
     this.wizard.pageIndex = NEW_ACCOUNT_START_PAGE;
   },
 
-  useExistingAccount: function () {
+  useExistingAccount: function() {
     if (!Weave.Utils.ensureMPUnlocked())
       return;
     this._settingUpNew = false;
     if (this.wizardType == "pair") {
       // We're already pairing, so there's no point in pairing again.
       // Go straight to the manual login page.
       this.wizard.pageIndex = EXISTING_ACCOUNT_LOGIN_PAGE;
     } else {
@@ -168,46 +168,46 @@ var gSyncSetup = {
 
     // changePassphrase() will sync, make sure we set the "firstSync" pref
     // according to the user's pref.
     Weave.Svc.Prefs.reset("firstSync");
     this.setupInitialSync();
     gSyncUtils.resetPassphrase(true);
   },
 
-  onResetPassphrase: function () {
+  onResetPassphrase: function() {
     document.getElementById("existingPassphrase").value =
       Weave.Utils.hyphenatePassphrase(Weave.Service.identity.syncKey);
     this.checkFields();
     this.wizard.advance();
   },
 
-  onLoginStart: function () {
+  onLoginStart: function() {
     this.toggleLoginFeedback(false);
   },
 
-  onLoginEnd: function () {
+  onLoginEnd: function() {
     this.toggleLoginFeedback(true);
   },
 
-  sendCredentialsAfterSync: function () {
+  sendCredentialsAfterSync: function() {
     let send = function() {
       Services.obs.removeObserver("weave:service:sync:finish", send);
       Services.obs.removeObserver("weave:service:sync:error", send);
       let credentials = {account:   Weave.Service.identity.account,
                          password:  Weave.Service.identity.basicPassword,
                          synckey:   Weave.Service.identity.syncKey,
                          serverURL: Weave.Service.serverURL};
       this._jpakeclient.sendAndComplete(credentials);
     }.bind(this);
     Services.obs.addObserver("weave:service:sync:finish", send, false);
     Services.obs.addObserver("weave:service:sync:error", send, false);
   },
 
-  toggleLoginFeedback: function (stop) {
+  toggleLoginFeedback: function(stop) {
     document.getElementById("login-throbber").hidden = stop;
     let password = document.getElementById("existingPasswordFeedbackRow");
     let server = document.getElementById("existingServerFeedbackRow");
     let passphrase = document.getElementById("existingPassphraseFeedbackRow");
 
     if (!stop || (Weave.Status.login == Weave.LOGIN_SUCCEEDED)) {
       password.hidden = server.hidden = passphrase.hidden = true;
       return;
@@ -226,38 +226,38 @@ var gSyncSetup = {
         break;
       case Weave.LOGIN_FAILED_INVALID_PASSPHRASE:
         feedback = passphrase;
         break;
     }
     this._setFeedbackMessage(feedback, false, Weave.Status.login);
   },
 
-  setupInitialSync: function () {
+  setupInitialSync: function() {
     let action = document.getElementById("mergeChoiceRadio").selectedItem.id;
     switch (action) {
       case "resetClient":
         // if we're not resetting sync, we don't need to explicitly
         // call resetClient
         if (!this._resettingSync)
           return;
         // otherwise, fall through
       case "wipeClient":
       case "wipeRemote":
         Weave.Svc.Prefs.set("firstSync", action);
         break;
     }
   },
 
   // fun with validation!
-  checkFields: function () {
+  checkFields: function() {
     this.wizard.canAdvance = this.readyToAdvance();
   },
 
-  readyToAdvance: function () {
+  readyToAdvance: function() {
     switch (this.wizard.pageIndex) {
       case INTRO_PAGE:
         return false;
       case NEW_ACCOUNT_START_PAGE:
         for (let i in this.status) {
           if (!this.status[i])
             return false;
         }
@@ -288,21 +288,21 @@ var gSyncSetup = {
     if (textbox && textbox.value.length == PIN_PART_LENGTH) {
       this.nextFocusEl[textbox.id].focus();
     }
     this.wizard.canAdvance = (this.pin1.value.length == PIN_PART_LENGTH &&
                               this.pin2.value.length == PIN_PART_LENGTH &&
                               this.pin3.value.length == PIN_PART_LENGTH);
   },
 
-  onEmailInput: function () {
+  onEmailInput: function() {
     // Check account validity when the user stops typing for 1 second.
     if (this._checkAccountTimer)
       window.clearTimeout(this._checkAccountTimer);
-    this._checkAccountTimer = window.setTimeout(function () {
+    this._checkAccountTimer = window.setTimeout(function() {
       gSyncSetup.checkAccount();
     }, 1000);
   },
 
   checkAccount: function() {
     delete this._checkAccountTimer;
     let value = Weave.Utils.normalizeAccount(
       document.getElementById("weaveEmail").value);
@@ -332,17 +332,17 @@ var gSyncSetup = {
 
     this._setFeedbackMessage(feedback, valid, str);
     this.status.email = valid;
     if (valid)
       Weave.Service.identity.account = value;
     this.checkFields();
   },
 
-  onPasswordChange: function () {
+  onPasswordChange: function() {
     let password = document.getElementById("weavePassword");
     let pwconfirm = document.getElementById("weavePasswordConfirm");
     let [valid, errorString] = gSyncUtils.validatePassword(password, pwconfirm);
 
     let feedback = document.getElementById("passwordFeedbackRow");
     this._setFeedback(feedback, valid, errorString);
 
     this.status.password = valid;
@@ -415,17 +415,17 @@ var gSyncSetup = {
         this.wizard.getButton("back").removeAttribute("accesskey");
         this.wizard.getButton("back").hidden = this._resettingSync;
         this.wizard.getButton("next").hidden = false;
         this.wizard.getButton("finish").hidden = true;
         break;
     }
   },
 
-  onWizardAdvance: function () {
+  onWizardAdvance: function() {
     // Check pageIndex so we don't prompt before the Sync setup wizard appears.
     // This is a fallback in case the Master Password gets locked mid-wizard.
     if ((this.wizard.pageIndex >= 0) &&
         !Weave.Utils.ensureMPUnlocked()) {
       return false;
     }
 
     switch (this.wizard.pageIndex) {
@@ -504,17 +504,17 @@ var gSyncSetup = {
           this.wizardFinish();
           return false;
         }
         return this.returnFromOptions();
     }
     return true;
   },
 
-  onWizardBack: function () {
+  onWizardBack: function() {
     switch (this.wizard.pageIndex) {
       case NEW_ACCOUNT_START_PAGE:
         this.wizard.pageIndex = INTRO_PAGE;
         return false;
       case EXISTING_ACCOUNT_CONNECT_PAGE:
         this.abortEasySetup();
         this.wizard.pageIndex = INTRO_PAGE;
         return false;
@@ -530,17 +530,17 @@ var gSyncSetup = {
       case OPTIONS_CONFIRM_PAGE:
         // Backing up from the confirmation page = resetting first sync to merge.
         document.getElementById("mergeChoiceRadio").selectedIndex = 0;
         return this.returnFromOptions();
     }
     return true;
   },
 
-  wizardFinish: function () {
+  wizardFinish: function() {
     this.setupInitialSync();
 
     if (this.wizardType == "pair") {
       this.completePairing();
     }
 
     if (!this._resettingSync) {
       function isChecked(element) {
@@ -558,26 +558,26 @@ var gSyncSetup = {
 
       Weave.Service.persistLogin();
       Weave.Svc.Obs.notify("weave:service:setup-complete");
     }
     Weave.Utils.nextTick(Weave.Service.sync, Weave.Service);
     window.close();
   },
 
-  onWizardCancel: function () {
+  onWizardCancel: function() {
     if (this._resettingSync)
       return;
 
     this.abortEasySetup();
     this._handleNoScript(false);
     Weave.Service.startOver();
   },
 
-  onSyncOptions: function () {
+  onSyncOptions: function() {
     this._beforeOptionsPage = this.wizard.pageIndex;
     this.wizard.pageIndex = OPTIONS_PAGE;
   },
 
   returnFromOptions: function() {
     this.wizard.getButton("next").label = this._nextButtonLabel;
     this.wizard.getButton("next").setAttribute("accesskey",
                                                this._nextButtonAccesskey);
@@ -639,17 +639,17 @@ var gSyncSetup = {
       // have to pair again?
       return;
     }
     let controller = new Weave.SendCredentialsController(this._jpakeclient,
                                                          Weave.Service);
     this._jpakeclient.controller = controller;
   },
 
-  startEasySetup: function () {
+  startEasySetup: function() {
     // Don't do anything if we have a client already (e.g. we went to
     // Sync Options and just came back).
     if (this._jpakeclient)
       return;
 
     // When onAbort is called, Weave may already be gone
     const JPAKE_ERROR_USERABORT = Weave.JPAKE_ERROR_USERABORT;
 
@@ -686,36 +686,36 @@ var gSyncSetup = {
 
         // Restart on all other errors.
         self.startEasySetup();
       }
     });
     this._jpakeclient.receiveNoPIN();
   },
 
-  abortEasySetup: function () {
+  abortEasySetup: function() {
     document.getElementById("easySetupPIN1").value = "";
     document.getElementById("easySetupPIN2").value = "";
     document.getElementById("easySetupPIN3").value = "";
     if (!this._jpakeclient)
       return;
 
     this._jpakeclient.abort();
     delete this._jpakeclient;
   },
 
-  manualSetup: function () {
+  manualSetup: function() {
     this.abortEasySetup();
     this.wizard.pageIndex = EXISTING_ACCOUNT_LOGIN_PAGE;
   },
 
   // _handleNoScript is needed because it blocks the captcha. So we temporarily
   // allow the necessary sites so that we can verify the user is in fact a human.
   // This was done with the help of Giorgio (NoScript author). See bug 508112.
-  _handleNoScript: function (addExceptions) {
+  _handleNoScript: function(addExceptions) {
     // if NoScript isn't installed, or is disabled, bail out.
     let ns = Cc["@maone.net/noscript-service;1"];
     if (ns == null)
       return;
 
     ns = ns.getService().wrappedJSObject;
     if (addExceptions) {
       this._remoteSites.forEach(function(site) {
@@ -729,42 +729,42 @@ var gSyncSetup = {
     else {
       this._disabledSites.forEach(function(site) {
         ns.setJSEnabled(site, false);
       });
       this._disabledSites = [];
     }
   },
 
-  onExistingServerCommand: function () {
+  onExistingServerCommand: function() {
     let control = document.getElementById("existingServer");
     if (control.selectedIndex == 0) {
       control.removeAttribute("editable");
       Weave.Svc.Prefs.reset("serverURL");
     } else {
       control.setAttribute("editable", "true");
       // Force a style flush to ensure that the binding is attached.
       control.clientTop;
       control.value = "";
       control.inputField.focus();
     }
     document.getElementById("existingServerFeedbackRow").hidden = true;
     this.checkFields();
   },
 
-  onExistingServerInput: function () {
+  onExistingServerInput: function() {
     // Check custom server validity when the user stops typing for 1 second.
     if (this._existingServerTimer)
       window.clearTimeout(this._existingServerTimer);
-    this._existingServerTimer = window.setTimeout(function () {
+    this._existingServerTimer = window.setTimeout(function() {
       gSyncSetup.checkFields();
     }, 1000);
   },
 
-  onServerCommand: function () {
+  onServerCommand: function() {
     setVisibility(document.getElementById("TOSRow"), this._usingMainServers);
     let control = document.getElementById("server");
     if (!this._usingMainServers) {
       control.setAttribute("editable", "true");
       // Force a style flush to ensure that the binding is attached.
       control.clientTop;
       control.value = "";
       control.inputField.focus();
@@ -778,26 +778,26 @@ var gSyncSetup = {
       this.loadCaptcha();
     }
     this.checkAccount();
     this.status.server = true;
     document.getElementById("serverFeedbackRow").hidden = true;
     this.checkFields();
   },
 
-  onServerInput: function () {
+  onServerInput: function() {
     // Check custom server validity when the user stops typing for 1 second.
     if (this._checkServerTimer)
       window.clearTimeout(this._checkServerTimer);
-    this._checkServerTimer = window.setTimeout(function () {
+    this._checkServerTimer = window.setTimeout(function() {
       gSyncSetup.checkServer();
     }, 1000);
   },
 
-  checkServer: function () {
+  checkServer: function() {
     delete this._checkServerTimer;
     let el = document.getElementById("server");
     let valid = false;
     let feedback = document.getElementById("serverFeedbackRow");
     if (el.value) {
       valid = this._validateServer(el);
       let str = valid ? "" : "serverInvalid.label";
       this._setFeedbackMessage(feedback, valid, str);
@@ -808,30 +808,30 @@ var gSyncSetup = {
     // Recheck account against the new server.
     if (valid)
       this.checkAccount();
 
     this.status.server = valid;
     this.checkFields();
   },
 
-  _validateServer: function (element) {
+  _validateServer: function(element) {
     let valid = false;
     let val = element.value;
     if (!val)
       return false;
 
     let uri = Weave.Utils.makeURI(val);
 
     if (!uri)
       uri = Weave.Utils.makeURI("https://" + val);
 
     if (uri && this._settingUpNew) {
-      function isValid(uri) {
-        Weave.Service.serverURL = uri.spec;
+      function isValid(validUri) {
+        Weave.Service.serverURL = validUri.spec;
         let check = Weave.Service.checkAccount("a");
         return (check == "available" || check == "notAvailable");
       }
 
       if (uri.schemeIs("http")) {
         uri.scheme = "https";
         if (isValid(uri))
           valid = true;
@@ -854,17 +854,17 @@ var gSyncSetup = {
     if (valid)
       element.value = Weave.Service.serverURL;
     else
       Weave.Svc.Prefs.reset("serverURL");
 
     return valid;
   },
 
-  _handleChoice: function () {
+  _handleChoice: function() {
     let desc = document.getElementById("mergeChoiceRadio").selectedIndex;
     document.getElementById("chosenActionDeck").selectedIndex = desc;
     switch (desc) {
       case 1:
         if (this._case1Setup)
           break;
 
         let places_db = PlacesUtils.history
@@ -978,27 +978,27 @@ var gSyncSetup = {
         break;
     }
 
     return true;
   },
 
   // sets class and string on a feedback element
   // if no property string is passed in, we clear label/style
-  _setFeedback: function (element, success, string) {
+  _setFeedback: function(element, success, string) {
     element.hidden = success || !string;
     let classname = success ? "success" : "error";
     let image = element.getElementsByAttribute("class", "statusIcon")[0];
     image.setAttribute("status", classname);
     let label = element.getElementsByAttribute("class", "status")[0];
     label.value = string;
   },
 
   // shim
-  _setFeedbackMessage: function (element, success, string) {
+  _setFeedbackMessage: function(element, success, string) {
     let str = "";
     if (string) {
       try {
         str = this._stringBundle.GetStringFromName(string);
       } catch (e) {}
 
       if (!str)
         str = Weave.Utils.getErrorString(string);
@@ -1027,34 +1027,34 @@ var gSyncSetup = {
     // If we didn't find a captcha, assume it's not needed and don't show it.
     let responseStatus = request.QueryInterface(Ci.nsIHttpChannel).responseStatus;
     setVisibility(this.captchaBrowser, responseStatus != 404);
     // XXX TODO we should really log any responseStatus other than 200
   },
   onProgressChange: function() {},
   onStatusChange: function() {},
   onSecurityChange: function() {},
-  onLocationChange: function () {}
+  onLocationChange: function() {}
 };
 
 // Define lazy getters for various XUL elements.
 //
 // onWizardAdvance() and onPageShow() are run before init(), so we'll even
 // define things that will almost certainly be used (like 'wizard') as a lazy
 // getter here.
 ["wizard",
  "pin1",
  "pin2",
  "pin3",
  "pairDeviceErrorRow",
- "pairDeviceThrobber"].forEach(function (id) {
+ "pairDeviceThrobber"].forEach(function(id) {
   XPCOMUtils.defineLazyGetter(gSyncSetup, id, function() {
     return document.getElementById(id);
   });
 });
-XPCOMUtils.defineLazyGetter(gSyncSetup, "nextFocusEl", function () {
+XPCOMUtils.defineLazyGetter(gSyncSetup, "nextFocusEl", function() {
   return {pin1: this.pin2,
           pin2: this.pin3,
           pin3: this.wizard.getButton("next")};
 });
 XPCOMUtils.defineLazyGetter(gSyncSetup, "_stringBundle", function() {
   return Services.strings.createBundle("chrome://browser/locale/syncSetup.properties");
 });
--- a/browser/base/content/sync/utils.js
+++ b/browser/base/content/sync/utils.js
@@ -17,17 +17,17 @@ var gSyncUtils = {
   get fxAccountsEnabled() {
     let service = Components.classes["@mozilla.org/weave/service;1"]
                             .getService(Components.interfaces.nsISupports)
                             .wrappedJSObject;
     return service.fxAccountsEnabled;
   },
 
   // opens in a new window if we're in a modal prefwindow world, in a new tab otherwise
-  _openLink: function (url) {
+  _openLink: function(url) {
     let thisDocEl = document.documentElement,
         openerDocEl = window.opener && window.opener.document.documentElement;
     if (thisDocEl.id == "accountSetup" && window.opener &&
         openerDocEl.id == "BrowserPreferences" && !openerDocEl.instantApply)
       openUILinkIn(url, "window");
     else if (thisDocEl.id == "BrowserPreferences" && !thisDocEl.instantApply)
       openUILinkIn(url, "window");
     else if (document.documentElement.id == "change-dialog")
@@ -53,50 +53,50 @@ var gSyncUtils = {
 
     // Open up the change dialog
     let changeXUL = "chrome://browser/content/sync/genericChange.xul";
     let changeOpt = "centerscreen,chrome,resizable=no";
     Services.ww.activeWindow.openDialog(changeXUL, "", changeOpt,
                                         type, duringSetup);
   },
 
-  changePassword: function () {
+  changePassword: function() {
     if (Weave.Utils.ensureMPUnlocked())
       this.openChange("ChangePassword");
   },
 
-  resetPassphrase: function (duringSetup) {
+  resetPassphrase: function(duringSetup) {
     if (Weave.Utils.ensureMPUnlocked())
       this.openChange("ResetPassphrase", duringSetup);
   },
 
-  updatePassphrase: function () {
+  updatePassphrase: function() {
     if (Weave.Utils.ensureMPUnlocked())
       this.openChange("UpdatePassphrase");
   },
 
-  resetPassword: function () {
+  resetPassword: function() {
     this._openLink(Weave.Service.pwResetURL);
   },
 
   get tosURL() {
     let root = this.fxAccountsEnabled ? "fxa." : "";
     return  Weave.Svc.Prefs.get(root + "termsURL");
   },
 
-  openToS: function () {
+  openToS: function() {
     this._openLink(this.tosURL);
   },
 
   get privacyPolicyURL() {
     let root = this.fxAccountsEnabled ? "fxa." : "";
     return  Weave.Svc.Prefs.get(root + "privacyURL");
   },
 
-  openPrivacyPolicy: function () {
+  openPrivacyPolicy: function() {
     this._openLink(this.privacyPolicyURL);
   },
 
   /**
    * Prepare an invisible iframe with the passphrase backup document.
    * Used by both the print and saving methods.
    *
    * @param elid : ID of the form element containing the passphrase.
@@ -198,17 +198,17 @@ var gSyncUtils = {
   /**
    * validatePassword
    *
    * @param el1 : the first textbox element in the form
    * @param el2 : the second textbox element, if omitted it's an update form
    *
    * returns [valid, errorString]
    */
-  validatePassword: function (el1, el2) {
+  validatePassword: function(el1, el2) {
     let valid = false;
     let val1 = el1.value;
     let val2 = el2 ? el2.value : "";
     let error = "";
 
     if (!el2)
       valid = val1.length >= Weave.MIN_PASS_LENGTH;
     else if (val1 && val1 == Weave.Service.identity.username)
--- a/browser/base/content/tab-content.js
+++ b/browser/base/content/tab-content.js
@@ -47,17 +47,17 @@ addEventListener("MozDOMPointerLock:Ente
   });
 });
 
 addEventListener("MozDOMPointerLock:Exited", function(aEvent) {
   sendAsyncMessage("PointerLock:Exited");
 });
 
 
-addMessageListener("Browser:HideSessionRestoreButton", function (message) {
+addMessageListener("Browser:HideSessionRestoreButton", function(message) {
   // Hide session restore button on about:home
   let doc = content.document;
   let container;
   if (doc.documentURI.toLowerCase() == "about:home" &&
       (container = doc.getElementById("sessionRestoreContainer"))) {
     container.hidden = true;
   }
 });
@@ -396,52 +396,52 @@ AboutReaderListener.init();
 
 var ContentSearchMediator = {
 
   whitelist: new Set([
     "about:home",
     "about:newtab",
   ]),
 
-  init: function (chromeGlobal) {
+  init: function(chromeGlobal) {
     chromeGlobal.addEventListener("ContentSearchClient", this, true, true);
     addMessageListener("ContentSearch", this);
   },
 
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     if (this._contentWhitelisted) {
       this._sendMsg(event.detail.type, event.detail.data);
     }
   },
 
-  receiveMessage: function (msg) {
+  receiveMessage: function(msg) {
     if (msg.data.type == "AddToWhitelist") {
       for (let uri of msg.data.data) {
         this.whitelist.add(uri);
       }
       this._sendMsg("AddToWhitelistAck");
       return;
     }
     if (this._contentWhitelisted) {
       this._fireEvent(msg.data.type, msg.data.data);
     }
   },
 
   get _contentWhitelisted() {
     return this.whitelist.has(content.document.documentURI);
   },
 
-  _sendMsg: function (type, data=null) {
+  _sendMsg: function(type, data = null) {
     sendAsyncMessage("ContentSearch", {
       type: type,
       data: data,
     });
   },
 
-  _fireEvent: function (type, data=null) {
+  _fireEvent: function(type, data = null) {
     let event = Cu.cloneInto({
       detail: {
         type: type,
         data: data,
       },
     }, content);
     content.dispatchEvent(new content.CustomEvent("ContentSearchService",
                                                   event));
@@ -486,41 +486,41 @@ var PageStyleHandler = {
       case "PageStyle:Disable":
         this.markupDocumentViewer.authorStyleDisabled = true;
         break;
     }
 
     this.sendStyleSheetInfo();
   },
 
-  _stylesheetSwitchAll: function (frameset, title) {
+  _stylesheetSwitchAll: function(frameset, title) {
     if (!title || this._stylesheetInFrame(frameset, title)) {
       this._stylesheetSwitchFrame(frameset, title);
     }
 
     for (let i = 0; i < frameset.frames.length; i++) {
       // Recurse into sub-frames.
       this._stylesheetSwitchAll(frameset.frames[i], title);
     }
   },
 
-  _stylesheetSwitchFrame: function (frame, title) {
+  _stylesheetSwitchFrame: function(frame, title) {
     var docStyleSheets = frame.document.styleSheets;
 
     for (let i = 0; i < docStyleSheets.length; ++i) {
       let docStyleSheet = docStyleSheets[i];
       if (docStyleSheet.title) {
         docStyleSheet.disabled = (docStyleSheet.title != title);
       } else if (docStyleSheet.disabled) {
         docStyleSheet.disabled = false;
       }
     }
   },
 
-  _stylesheetInFrame: function (frame, title) {
+  _stylesheetInFrame: function(frame, title) {
     return Array.some(frame.document.styleSheets, (styleSheet) => styleSheet.title == title);
   },
 
   _filterStyleSheets: function(styleSheets) {
     let result = [];
 
     for (let currentStyleSheet of styleSheets) {
       if (!currentStyleSheet.title)
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -560,67 +560,67 @@
             mStateFlags: stateFlags,
             mStatus: 0,
             mMessage: "",
             mTotalProgress: 0,
 
             // count of open requests (should always be 0 or 1)
             mRequestCount: 0,
 
-            destroy: function () {
+            destroy: function() {
               delete this.mTab;
               delete this.mBrowser;
               delete this.mTabBrowser;
             },
 
-            _callProgressListeners: function () {
+            _callProgressListeners: function() {
               Array.unshift(arguments, this.mBrowser);
               return this.mTabBrowser._callProgressListeners.apply(this.mTabBrowser, arguments);
             },
 
-            _shouldShowProgress: function (aRequest) {
+            _shouldShowProgress: function(aRequest) {
               if (this.mBlank)
                 return false;
 
               // Don't show progress indicators in tabs for about: URIs
               // pointing to local resources.
               if ((aRequest instanceof Ci.nsIChannel) &&
                   aRequest.originalURI.schemeIs("about") &&
                   (aRequest.URI.schemeIs("jar") || aRequest.URI.schemeIs("file")))
                 return false;
 
               return true;
             },
 
-            onProgressChange: function (aWebProgress, aRequest,
-                                        aCurSelfProgress, aMaxSelfProgress,
-                                        aCurTotalProgress, aMaxTotalProgress) {
+            onProgressChange: function(aWebProgress, aRequest,
+                                       aCurSelfProgress, aMaxSelfProgress,
+                                       aCurTotalProgress, aMaxTotalProgress) {
               this.mTotalProgress = aMaxTotalProgress ? aCurTotalProgress / aMaxTotalProgress : 0;
 
               if (!this._shouldShowProgress(aRequest))
                 return;
 
               if (this.mTotalProgress)
                 this.mTab.setAttribute("progress", "true");
 
               this._callProgressListeners("onProgressChange",
                                           [aWebProgress, aRequest,
                                            aCurSelfProgress, aMaxSelfProgress,
                                            aCurTotalProgress, aMaxTotalProgress]);
             },
 
-            onProgressChange64: function (aWebProgress, aRequest,
-                                          aCurSelfProgress, aMaxSelfProgress,
-                                          aCurTotalProgress, aMaxTotalProgress) {
+            onProgressChange64: function(aWebProgress, aRequest,
+                                         aCurSelfProgress, aMaxSelfProgress,
+                                         aCurTotalProgress, aMaxTotalProgress) {
               return this.onProgressChange(aWebProgress, aRequest,
                 aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress,
                 aMaxTotalProgress);
             },
 
-            onStateChange: function (aWebProgress, aRequest, aStateFlags, aStatus) {
+            onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
               if (!aRequest)
                 return;
 
               var oldBlank = this.mBlank;
 
               const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
               const nsIChannel = Components.interfaces.nsIChannel;
               let location, originalLocation;
@@ -751,18 +751,18 @@
                 // reset cached temporary values at beginning and end
                 this.mMessage = "";
                 this.mTotalProgress = 0;
               }
               this.mStateFlags = aStateFlags;
               this.mStatus = aStatus;
             },
 
-            onLocationChange: function (aWebProgress, aRequest, aLocation,
-                                        aFlags) {
+            onLocationChange: function(aWebProgress, aRequest, aLocation,
+                                       aFlags) {
               // OnLocationChange is called for both the top-level content
               // and the subframes.
               let topLevel = aWebProgress.isTopLevel;
 
               if (topLevel) {
                 let isSameDocument =
                   !!(aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT);
                 // We need to clear the typed value
@@ -832,37 +832,37 @@
               }
 
               if (topLevel) {
                 this.mBrowser.lastURI = aLocation;
                 this.mBrowser.lastLocationChange = Date.now();
               }
             },
 
-            onStatusChange: function (aWebProgress, aRequest, aStatus, aMessage) {
+            onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {
               if (this.mBlank)
                 return;
 
               this._callProgressListeners("onStatusChange",
                                           [aWebProgress, aRequest, aStatus, aMessage]);
 
               this.mMessage = aMessage;
             },
 
-            onSecurityChange: function (aWebProgress, aRequest, aState) {
+            onSecurityChange: function(aWebProgress, aRequest, aState) {
               this._callProgressListeners("onSecurityChange",
                                           [aWebProgress, aRequest, aState]);
             },
 
-            onRefreshAttempted: function (aWebProgress, aURI, aDelay, aSameURI) {
+            onRefreshAttempted: function(aWebProgress, aURI, aDelay, aSameURI) {
               return this._callProgressListeners("onRefreshAttempted",
                                                  [aWebProgress, aURI, aDelay, aSameURI]);
             },
 
-            QueryInterface: function (aIID) {
+            QueryInterface: function(aIID) {
               if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
                   aIID.equals(Components.interfaces.nsIWebProgressListener2) ||
                   aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
                   aIID.equals(Components.interfaces.nsISupports))
                 return this;
               throw Components.results.NS_NOINTERFACE;
             }
           });
@@ -2185,17 +2185,17 @@
             // When overflowing, new tabs are scrolled into view smoothly, which
             // doesn't go well together with the width transition. So we skip the
             // transition in that case.
             let animate = !aSkipAnimation &&
                           this.tabContainer.getAttribute("overflow") != "true" &&
                           Services.prefs.getBoolPref("browser.tabs.animate");
             if (!animate) {
               t.setAttribute("fadein", "true");
-              setTimeout(function (tabContainer) {
+              setTimeout(function(tabContainer) {
                 tabContainer._handleNewTab(t);
               }, 0, this.tabContainer);
             }
 
             // invalidate cache
             this._visibleTabs = null;
 
             this.tabContainer.appendChild(t);
@@ -2255,17 +2255,17 @@
                 flags |= Ci.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL;
               if (aAllowMixedContent)
                 flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT;
               if (aDisallowInheritPrincipal)
                 flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
               try {
                 b.loadURIWithFlags(aURI, {
                   flags,
-                  referrerURI: aNoReferrer ? null: aReferrerURI,
+                  referrerURI: aNoReferrer ? null : aReferrerURI,
                   referrerPolicy: aReferrerPolicy,
                   charset: aCharset,
                   postData: aPostData,
                 });
               } catch (ex) {
                 Cu.reportError(ex);
               }
             }
@@ -2283,17 +2283,17 @@
                 this._lastRelatedTab.owner = null;
               else
                 t.owner = this.selectedTab;
               this.moveTabTo(t, newTabPos);
               this._lastRelatedTab = t;
             }
 
             if (animate) {
-              requestAnimationFrame(function () {
+              requestAnimationFrame(function() {
                 this.tabContainer._handleTabTelemetryStart(t, aURI);
 
                 // kick the animation off
                 t.setAttribute("fadein", "true");
               }.bind(this));
             }
 
             return t;
@@ -2475,17 +2475,17 @@
             }
 
             this.tabContainer._handleTabTelemetryStart(aTab);
 
             this._blurTab(aTab);
             aTab.style.maxWidth = ""; // ensure that fade-out transition happens
             aTab.removeAttribute("fadein");
 
-            setTimeout(function (tab, tabbrowser) {
+            setTimeout(function(tab, tabbrowser) {
               if (tab.parentNode &&
                   window.getComputedStyle(tab).maxWidth == "0.1px") {
                 NS_ASSERT(false, "Giving up waiting for the tab closing animation to finish (bug 608589)");
                 tabbrowser._endRemoveTab(tab);
               }
             }, 3000, aTab, this);
           ]]>
         </body>
@@ -3240,17 +3240,17 @@
             aIndex = Math.max(aIndex, this._numPinnedTabs);
           if (oldPosition == aIndex)
             return;
 
           this._lastRelatedTab = null;
 
           let wasFocused = (document.activeElement == this.mCurrentTab);
 
-          aIndex = aIndex < aTab._tPos ? aIndex: aIndex+1;
+          aIndex = aIndex < aTab._tPos ? aIndex : aIndex + 1;
 
           // invalidate cache
           this._visibleTabs = null;
 
           // use .item() instead of [] because dragging to the end of the strip goes out of
           // bounds: .item() returns null (so it acts like appendChild), but [] throws
           this.tabContainer.insertBefore(aTab, this.tabs.item(aIndex));
 
@@ -4135,54 +4135,54 @@
               this._processing = false;
             },
 
             /*
              * Telemetry and Profiler related helpers for recording tab switch
              * timing.
              */
 
-            startTabSwitch: function () {
+            startTabSwitch: function() {
               TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
               TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
               this.addMarker("AsyncTabSwitch:Start");
               this.switchInProgress = true;
             },
 
             /**
              * Something has occurred that might mean that we've completed
              * the tab switch (layers are ready, paints are done, spinners
              * are hidden). This checks to make sure all conditions are
              * satisfied, and then records the tab switch as finished.
              */
-            maybeFinishTabSwitch: function () {
+            maybeFinishTabSwitch: function() {
               if (this.switchInProgress && this.requestedTab &&
                   this.getTabState(this.requestedTab) == this.STATE_LOADED) {
                 // After this point the tab has switched from the content thread's point of view.
                 // The changes will be visible after the next refresh driver tick + composite.
                 let time = TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
                 if (time != -1) {
                   TelemetryStopwatch.finish("FX_TAB_SWITCH_TOTAL_E10S_MS", window);
                   this.log("DEBUG: tab switch time = " + time);
                   this.addMarker("AsyncTabSwitch:Finish");
                 }
                 this.switchInProgress = false;
               }
             },
 
-            spinnerDisplayed: function () {
+            spinnerDisplayed: function() {
               this.assert(!this.spinnerTab);
               TelemetryStopwatch.start("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window);
               // We have a second, similar probe for capturing recordings of
               // when the spinner is displayed for very long periods.
               TelemetryStopwatch.start("FX_TAB_SWITCH_SPINNER_VISIBLE_LONG_MS", window);
               this.addMarker("AsyncTabSwitch:SpinnerShown");
             },
 
-            spinnerHidden: function () {
+            spinnerHidden: function() {
               this.assert(this.spinnerTab);
               this.log("DEBUG: spinner time = " +
                        TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window));
               TelemetryStopwatch.finish("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window);
               TelemetryStopwatch.finish("FX_TAB_SWITCH_SPINNER_VISIBLE_LONG_MS", window);
               this.addMarker("AsyncTabSwitch:SpinnerHidden");
               // we do not get a onPaint after displaying the spinner
               this.maybeFinishTabSwitch();
@@ -4196,17 +4196,17 @@
 
             /*
              * Debug related logging for switcher.
              */
 
             _useDumpForLogging: false,
             _logInit: false,
 
-            logging: function () {
+            logging: function() {
               if (this._useDumpForLogging)
                 return true;
               if (this._logInit)
                 return this._shouldLog;
               let result = false;
               try {
                 result = Services.prefs.getBoolPref("browser.tabs.remote.logSwitchTiming");
               } catch (ex) {
@@ -4740,38 +4740,41 @@
 
       <method name="observe">
         <parameter name="aSubject"/>
         <parameter name="aTopic"/>
         <parameter name="aData"/>
         <body><![CDATA[
           let browser;
           switch (aTopic) {
-            case "live-resize-start":
+            case "live-resize-start": {
               browser = this.mCurrentTab.linkedBrowser;
               let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
               if (fl && fl.tabParent && !this.mActiveResizeDisplayportSuppression) {
                 fl.tabParent.suppressDisplayport(true);
                 this.mActiveResizeDisplayportSuppression = browser;
               }
               break;
-            case "live-resize-end":
+            }
+            case "live-resize-end": {
               browser = this.mActiveResizeDisplayportSuppression;
               if (browser) {
                 let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
                 if (fl && fl.tabParent) {
                   fl.tabParent.suppressDisplayport(false);
                   this.mActiveResizeDisplayportSuppression = null;
                 }
               }
               break;
-            case "nsPref:changed":
+            }
+            case "nsPref:changed": {
               // This is the only pref observed.
               this._findAsYouType = Services.prefs.getBoolPref("accessibility.typeaheadfind");
               break;
+            }
           }
         ]]></body>
       </method>
 
       <constructor>
         <![CDATA[
           this.mCurrentBrowser = document.getAnonymousElementByAttribute(this, "anonid", "initialBrowser");
           this.mCurrentBrowser.permanentKey = {};
@@ -4952,24 +4955,24 @@
         -->
       <property name="mStrip" readonly="true">
         <getter>
         <![CDATA[
           return ({
             self: this,
             childNodes: [null, this.tabContextMenu, this.tabContainer],
             firstChild: { nextSibling: this.tabContextMenu },
-            getElementsByAttribute: function (attr, attrValue) {
+            getElementsByAttribute: function(attr, attrValue) {
               if (attr == "anonid" && attrValue == "tabContextMenu")
                 return [this.self.tabContextMenu];
               return [];
             },
             // Also support adding event listeners (forward to the tab container)
-            addEventListener: function (a, b, c) { this.self.tabContainer.addEventListener(a, b, c); },
-            removeEventListener: function (a, b, c) { this.self.tabContainer.removeEventListener(a, b, c); }
+            addEventListener: function(a, b, c) { this.self.tabContainer.addEventListener(a, b, c); },
+            removeEventListener: function(a, b, c) { this.self.tabContainer.removeEventListener(a, b, c); }
           });
         ]]>
         </getter>
       </property>
       <field name="_soundPlayingAttrRemovalTimer">0</field>
     </implementation>
 
     <handlers>
@@ -5009,22 +5012,20 @@
           let tabForEvent = targetIsWindow ?
                             this._getTabForContentWindow(event.target.top) :
                             this.getTabForBrowser(event.originalTarget);
 
           // Don't need to act if the tab is already selected:
           if (tabForEvent.selected)
             return;
 
-          // If this is a tabprompt, we won't switch tabs, unless:
-          // - this is a beforeunload prompt
-          // - this behaviour has been disabled entirely using the pref
-          if (event.detail && event.detail.tabPrompt &&
-              !event.detail.inPermitUnload &&
-              Services.prefs.getBoolPref("browser.tabs.dontfocusfordialogs")) {
+          // We always switch tabs for beforeunload tab-modal prompts.
+          if (event.detail &&
+              event.detail.tabPrompt &&
+              !event.detail.inPermitUnload) {
             let docPrincipal = targetIsWindow ? event.target.document.nodePrincipal : null;
             // At least one of these should/will be non-null:
             let promptPrincipal = event.detail.promptPrincipal || docPrincipal ||
                                   tabForEvent.linkedBrowser.contentPrincipal;
             // For null principals, we bail immediately and don't show the checkbox:
             if (!promptPrincipal || promptPrincipal.isNullPrincipal) {
               tabForEvent.setAttribute("attention", "true");
               return;
@@ -5042,17 +5043,17 @@
                 tabForEvent.setAttribute("attention", "true");
                 return;
               }
             }
             // ... so system and expanded principals, as well as permitted "normal"
             // URI-based principals, always get to steal focus for the tab when prompting.
           }
 
-          // if prefs/permissions/origins so dictate, bring tab to the front:
+          // If permissions/origins dictate so, bring tab to the front.
           this.selectedTab = tabForEvent;
         ]]>
       </handler>
       <handler event="DOMTitleChanged">
         <![CDATA[
           if (!event.isTrusted)
             return;
 
@@ -5562,17 +5563,17 @@
       <!-- Try to keep the active tab's close button under the mouse cursor -->
       <method name="_lockTabSizing">
         <parameter name="aTab"/>
         <body><![CDATA[
           var tabs = this.tabbrowser.visibleTabs;
           if (!tabs.length)
             return;
 
-          var isEndTab = (aTab._tPos > tabs[tabs.length-1]._tPos);
+          var isEndTab = (aTab._tPos > tabs[tabs.length - 1]._tPos);
           var tabWidth = aTab.getBoundingClientRect().width;
 
           if (!this._tabDefaultMaxWidth)
             this._tabDefaultMaxWidth =
               parseFloat(window.getComputedStyle(aTab).maxWidth);
           this._lastTabClosedByMouse = true;
 
           if (this.getAttribute("overflow") == "true") {
@@ -5662,17 +5663,17 @@
 
             let scrollButtonWidth = this.mTabstrip._scrollButtonDown.getBoundingClientRect().width;
             let paddingStart = this.mTabstrip.scrollboxPaddingStart;
             let width = 0;
 
             for (let i = numPinned - 1; i >= 0; i--) {
               let tab = this.childNodes[i];
               width += tab.getBoundingClientRect().width;
-              tab.style.marginInlineStart = - (width + scrollButtonWidth + paddingStart) + "px";
+              tab.style.marginInlineStart = -(width + scrollButtonWidth + paddingStart) + "px";
             }
 
             this.style.paddingInlineStart = width + paddingStart + "px";
 
           } else {
             this.removeAttribute("positionpinnedtabs");
 
             for (let i = 0; i < numPinned; i++) {
@@ -5748,17 +5749,17 @@
           let low = 0;
           let high = tabs.length - 1;
           while (low <= high) {
             let mid = Math.floor((low + high) / 2);
             if (tabs[mid] == draggedTab &&
                 ++mid > high)
               break;
             let boxObject = tabs[mid].boxObject;
-            let screenX = boxObject.screenX + getTabShift(tabs[mid], oldIndex);
+            screenX = boxObject.screenX + getTabShift(tabs[mid], oldIndex);
             if (screenX > tabCenter) {
               high = mid - 1;
             } else if (screenX + boxObject.width < tabCenter) {
               low = mid + 1;
             } else {
               newIndex = tabs[mid]._tPos;
               break;
             }
@@ -5885,17 +5886,17 @@
 
             this.mTabstrip._smoothScrollByPixels(this.mTabstrip._isRTLScrollbox ?
                                                  selected.right - scrollRect.right :
                                                  selected.left - scrollRect.left);
           }
 
           if (!this._animateElement.hasAttribute("notifybgtab")) {
             this._animateElement.setAttribute("notifybgtab", "true");
-            setTimeout(function (ele) {
+            setTimeout(function(ele) {
               ele.removeAttribute("notifybgtab");
             }, 150, this._animateElement);
           }
         ]]></body>
       </method>
 
       <method name="_getDragTargetTab">
         <parameter name="event"/>
@@ -6402,17 +6403,17 @@
           if (!ltr)
             [minMargin, maxMargin] = [this.clientWidth - maxMargin,
                                       this.clientWidth - minMargin];
           newMargin = (pixelsToScroll > 0) ? maxMargin : minMargin;
         }
         else {
           let newIndex = this._getDropIndex(event, effects == "link");
           if (newIndex == this.childNodes.length) {
-            let tabRect = this.childNodes[newIndex-1].getBoundingClientRect();
+            let tabRect = this.childNodes[newIndex - 1].getBoundingClientRect();
             if (ltr)
               newMargin = tabRect.right - rect.left;
             else
               newMargin = rect.right - tabRect.left;
           }
           else {
             let tabRect = this.childNodes[newIndex].getBoundingClientRect();
             if (ltr)
--- a/browser/base/content/test/alerts/browser_notification_close.js
+++ b/browser/base/content/test/alerts/browser_notification_close.js
@@ -11,20 +11,21 @@ add_task(function* test_notificationClos
   let notificationURI = makeURI(notificationURL);
   pm.add(notificationURI, "desktop-notification", pm.ALLOW_ACTION);
 
   oldShowFavicons = Services.prefs.getBoolPref("alerts.showFavicons");
   Services.prefs.setBoolPref("alerts.showFavicons", true);
 
   yield PlacesTestUtils.addVisits(notificationURI);
   let faviconURI = yield new Promise(resolve => {
-    let faviconURI = makeURI("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC");
-    PlacesUtils.favicons.setAndFetchFaviconForPage(notificationURI, faviconURI,
+    let uri =
+      makeURI("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC");
+    PlacesUtils.favicons.setAndFetchFaviconForPage(notificationURI, uri,
       true, PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
-      (faviconURI, iconSize, iconData, mimeType) => resolve(faviconURI),
+      (uriResult) => resolve(uriResult),
       Services.scriptSecurityManager.getSystemPrincipal());
   });
 
   yield BrowserTestUtils.withNewTab({
     gBrowser,
     url: notificationURL
   }, function* dummyTabTask(aBrowser) {
     yield openNotification(aBrowser, "showNotification2");
--- a/browser/base/content/test/alerts/browser_notification_do_not_disturb.js
+++ b/browser/base/content/test/alerts/browser_notification_do_not_disturb.js
@@ -2,17 +2,17 @@
 
 var tab;
 var notificationURL = "http://example.org/browser/browser/base/content/test/alerts/file_dom_notifications.html";
 
 const ALERT_SERVICE = Cc["@mozilla.org/alerts-service;1"]
                         .getService(Ci.nsIAlertsService)
                         .QueryInterface(Ci.nsIAlertsDoNotDisturb);
 
-function test () {
+function test() {
   waitForExplicitFinish();
 
   try {
     // Only run the test if the do-not-disturb
     // interface has been implemented.
     ALERT_SERVICE.manualDoNotDisturb;
     ok(true, "Alert service implements do-not-disturb interface");
   } catch (e) {
--- a/browser/base/content/test/alerts/browser_notification_remove_permission.js
+++ b/browser/base/content/test/alerts/browser_notification_remove_permission.js
@@ -1,16 +1,16 @@
 "use strict";
 
 var tab;
 var notificationURL = "http://example.org/browser/browser/base/content/test/alerts/file_dom_notifications.html";
 var alertWindowClosed = false;
 var permRemoved = false;
 
-function test () {
+function test() {
   waitForExplicitFinish();
 
   let pm = Services.perms;
   registerCleanupFunction(function() {
     pm.remove(makeURI(notificationURL), "desktop-notification");
     gBrowser.removeTab(tab);
     window.restore();
   });
--- a/browser/base/content/test/alerts/browser_notification_tab_switching.js
+++ b/browser/base/content/test/alerts/browser_notification_tab_switching.js
@@ -19,21 +19,21 @@ add_task(function* test_notificationPrev
     url: notificationURL
   }, function* dummyTabTask(aBrowser) {
     // Put new tab in background so it is obvious when it is re-focused.
     yield BrowserTestUtils.switchTab(gBrowser, originalTab);
     isnot(gBrowser.selectedBrowser, aBrowser, "Notification page loaded as a background tab");
 
     // First, show a notification that will be have the tab-switching prevented.
     function promiseNotificationEvent(evt) {
-      return ContentTask.spawn(aBrowser, evt, function* (evt) {
+      return ContentTask.spawn(aBrowser, evt, function* (contentEvt) {
         return yield new Promise(resolve => {
-          let notification = content.wrappedJSObject._notification;
-          notification.addEventListener(evt, function l(event) {
-            notification.removeEventListener(evt, l);
+          let contentNotification = content.wrappedJSObject._notification;
+          contentNotification.addEventListener(contentEvt, function l(event) {
+            contentNotification.removeEventListener(contentEvt, l);
             resolve({ defaultPrevented: event.defaultPrevented });
           });
         });
       });
     }
     yield openNotification(aBrowser, "showNotification1");
     info("Notification alert showing");
     let alertWindow = Services.wm.getMostRecentWindow("alert:alert");
--- a/browser/base/content/test/alerts/head.js
+++ b/browser/base/content/test/alerts/head.js
@@ -37,33 +37,33 @@ function promiseWindowClosed(window) {
  * These two functions work with file_dom_notifications.html to open the
  * notification and close it.
  *
  * |fn| can be showNotification1 or showNotification2.
  * if |timeout| is passed, then the promise returned from this function is
  * rejected after the requested number of miliseconds.
  */
 function openNotification(aBrowser, fn, timeout) {
-  return ContentTask.spawn(aBrowser, { fn, timeout }, function* ({ fn, timeout }) {
+  return ContentTask.spawn(aBrowser, [fn, timeout], function* ([contentFn, contentTimeout]) {
     let win = content.wrappedJSObject;
-    let notification = win[fn]();
+    let notification = win[contentFn]();
     win._notification = notification;
     yield new Promise((resolve, reject) => {
       function listener() {
         notification.removeEventListener("show", listener);
         resolve();
       }
 
       notification.addEventListener("show", listener);
 
-      if (timeout) {
+      if (contentTimeout) {
         content.setTimeout(() => {
           notification.removeEventListener("show", listener);
           reject("timed out");
-        }, timeout);
+        }, contentTimeout);
       }
     });
   });
 }
 
 function closeNotification(aBrowser) {
   return ContentTask.spawn(aBrowser, null, function() {
     content.wrappedJSObject._notification.close();
--- a/browser/base/content/test/general/aboutHome_content_script.js
+++ b/browser/base/content/test/general/aboutHome_content_script.js
@@ -1,6 +1,6 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-addMessageListener("AboutHome:SearchTriggered", function (msg) {
+addMessageListener("AboutHome:SearchTriggered", function(msg) {
   sendAsyncMessage("AboutHomeTest:CheckRecordedSearch", msg.data);
 });
--- a/browser/base/content/test/general/browser_aboutHealthReport.js
+++ b/browser/base/content/test/general/browser_aboutHealthReport.js
@@ -63,17 +63,17 @@ var gTests = [
   desc: "Test the remote commands",
   setup: Task.async(function*()
   {
     Preferences.set(TELEMETRY_LOG_PREF, "Trace");
     yield setupPingArchive();
     Preferences.set("datareporting.healthreport.about.reportUrl",
                     HTTPS_BASE + "healthreport_testRemoteCommands.html");
   }),
-  run: function (iframe)
+  run: function(iframe)
   {
     let deferred = Promise.defer();
     let results = 0;
     try {
       iframe.contentWindow.addEventListener("FirefoxHealthReportTestResponse", function evtHandler(event) {
         let data = event.detail.data;
         if (data.type == "testResult") {
           ok(data.pass, data.info);
@@ -114,17 +114,17 @@ function test()
 
       gBrowser.removeCurrentTab();
     }
 
     finish();
   });
 }
 
-function promiseNewTabLoadEvent(aUrl, aEventType="load")
+function promiseNewTabLoadEvent(aUrl, aEventType = "load")
 {
   let deferred = Promise.defer();
   let tab = gBrowser.selectedTab = gBrowser.addTab(aUrl);
   tab.linkedBrowser.addEventListener(aEventType, function load(event) {
     tab.linkedBrowser.removeEventListener(aEventType, load, true);
     let iframe = tab.linkedBrowser.contentDocument.getElementById("remote-report");
       iframe.addEventListener("load", function frameLoad(e) {
         if (iframe.contentWindow.location.href == "about:blank" ||
--- a/browser/base/content/test/general/browser_aboutHome.js
+++ b/browser/base/content/test/general/browser_aboutHome.js
@@ -287,17 +287,17 @@ add_task(function* () {
       function check(n) {
         let win = Services.wm.getMostRecentWindow("Browser:Preferences");
         ok(!win, "Preferences window not showing");
         if (win) {
           win.close();
         }
 
         if (n > 0) {
-          executeSoon(() => check(n-1));
+          executeSoon(() => check(n - 1));
         } else {
           resolve();
         }
       }
 
       check(5);
     });
   });
@@ -492,17 +492,17 @@ add_task(function* () {
 });
 
 add_task(function* () {
   info("Sync button should open about:preferences#sync");
 
   yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:home" }, function* (browser) {
     let oldOpenPrefs = window.openPreferences;
     let openPrefsPromise = new Promise(resolve => {
-      window.openPreferences = function (pane, params) {
+      window.openPreferences = function(pane, params) {
         resolve({ pane: pane, params: params });
       };
     });
 
     yield BrowserTestUtils.synthesizeMouseAtCenter("#sync", {}, browser);
 
     let result = yield openPrefsPromise;
     window.openPreferences = oldOpenPrefs;
@@ -645,24 +645,24 @@ function promiseContentSearchChange(brow
   });
 }
 
 function promiseNewEngine(basename) {
   info("Waiting for engine to be added: " + basename);
   return new Promise((resolve, reject) => {
     let url = getRootDirectory(gTestPath) + basename;
     Services.search.addEngine(url, null, "", false, {
-      onSuccess: function (engine) {
+      onSuccess: function(engine) {
         info("Search engine added: " + basename);
         registerCleanupFunction(() => {
           try {
             Services.search.removeEngine(engine);
           } catch (ex) { /* Can't remove the engine more than once */ }
         });
         resolve(engine);
       },
-      onError: function (errCode) {
+      onError: function(errCode) {
         ok(false, "addEngine failed with error code " + errCode);
         reject();
       },
     });
   });
 }
--- a/browser/base/content/test/general/browser_alltabslistener.js
+++ b/browser/base/content/test/general/browser_alltabslistener.js
@@ -1,79 +1,79 @@
 var Ci = Components.interfaces;
 
 const gCompleteState = Ci.nsIWebProgressListener.STATE_STOP +
                        Ci.nsIWebProgressListener.STATE_IS_NETWORK;
 
 var gFrontProgressListener = {
-  onProgressChange: function (aWebProgress, aRequest,
-                              aCurSelfProgress, aMaxSelfProgress,
-                              aCurTotalProgress, aMaxTotalProgress) {
+  onProgressChange: function(aWebProgress, aRequest,
+                             aCurSelfProgress, aMaxSelfProgress,
+                             aCurTotalProgress, aMaxTotalProgress) {
   },
 
-  onStateChange: function (aWebProgress, aRequest, aStateFlags, aStatus) {
+  onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
     var state = "onStateChange";
     info("FrontProgress: " + state + " 0x" + aStateFlags.toString(16));
     ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
     is(state, gFrontNotifications[gFrontNotificationsPos], "Got a notification for the front notifications listener");
     gFrontNotificationsPos++;
   },
 
-  onLocationChange: function (aWebProgress, aRequest, aLocationURI, aFlags) {
+  onLocationChange: function(aWebProgress, aRequest, aLocationURI, aFlags) {
     var state = "onLocationChange";
     info("FrontProgress: " + state + " " + aLocationURI.spec);
     ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
     is(state, gFrontNotifications[gFrontNotificationsPos], "Got a notification for the front notifications listener");
     gFrontNotificationsPos++;
   },
 
-  onStatusChange: function (aWebProgress, aRequest, aStatus, aMessage) {
+  onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage) {
   },
 
-  onSecurityChange: function (aWebProgress, aRequest, aState) {
+  onSecurityChange: function(aWebProgress, aRequest, aState) {
     var state = "onSecurityChange";
     info("FrontProgress: " + state + " 0x" + aState.toString(16));
     ok(gFrontNotificationsPos < gFrontNotifications.length, "Got an expected notification for the front notifications listener");
     is(state, gFrontNotifications[gFrontNotificationsPos], "Got a notification for the front notifications listener");
     gFrontNotificationsPos++;
   }
 }
 
 var gAllProgressListener = {
-  onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
+  onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
     var state = "onStateChange";
     info("AllProgress: " + state + " 0x" + aStateFlags.toString(16));
     ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
     ok(gAllNotificationsPos < gAllNotifications.length, "Got an expected notification for the all notifications listener");
     is(state, gAllNotifications[gAllNotificationsPos], "Got a notification for the all notifications listener");
     gAllNotificationsPos++;
 
     if ((aStateFlags & gCompleteState) == gCompleteState) {
       ok(gAllNotificationsPos == gAllNotifications.length, "Saw the expected number of notifications");
       ok(gFrontNotificationsPos == gFrontNotifications.length, "Saw the expected number of frontnotifications");
       executeSoon(gNextTest);
     }
   },
 
-  onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI,
-                              aFlags) {
+  onLocationChange: function(aBrowser, aWebProgress, aRequest, aLocationURI,
+                             aFlags) {
     var state = "onLocationChange";
     info("AllProgress: " + state + " " + aLocationURI.spec);
     ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
     ok(gAllNotificationsPos < gAllNotifications.length, "Got an expected notification for the all notifications listener");
     is(state, gAllNotifications[gAllNotificationsPos], "Got a notification for the all notifications listener");
     gAllNotificationsPos++;
   },
 
-  onStatusChange: function (aBrowser, aWebProgress, aRequest, aStatus, aMessage) {
+  onStatusChange: function(aBrowser, aWebProgress, aRequest, aStatus, aMessage) {
     var state = "onStatusChange";
     ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
   },
 
-  onSecurityChange: function (aBrowser, aWebProgress, aRequest, aState) {
+  onSecurityChange: function(aBrowser, aWebProgress, aRequest, aState) {
     var state = "onSecurityChange";
     info("AllProgress: " + state + " 0x" + aState.toString(16));
     ok(aBrowser == gTestBrowser, state + " notification came from the correct browser");
     ok(gAllNotificationsPos < gAllNotifications.length, "Got an expected notification for the all notifications listener");
     is(state, gAllNotifications[gAllNotificationsPos], "Got a notification for the all notifications listener");
     gAllNotificationsPos++;
   }
 }
--- a/browser/base/content/test/general/browser_blockHPKP.js
+++ b/browser/base/content/test/general/browser_blockHPKP.js
@@ -33,17 +33,17 @@ const kBadPinningDomain = "bad.include-s
 const kURLPath = "/browser/browser/base/content/test/general/pinning_headers.sjs?";
 
 function test() {
   waitForExplicitFinish();
   // Enable enforcing strict pinning and processing headers from
   // non-builtin roots.
   Services.prefs.setIntPref(kpkpEnforcementPref, 2);
   Services.prefs.setBoolPref(khpkpPinninEnablePref, true);
-  registerCleanupFunction(function () {
+  registerCleanupFunction(function() {
     Services.prefs.clearUserPref(kpkpEnforcementPref);
     Services.prefs.clearUserPref(khpkpPinninEnablePref);
     let uri = gIOService.newURI("https://" + kPinningDomain, null, null);
     gSSService.removeState(Ci.nsISiteSecurityService.HEADER_HPKP, uri, 0);
   });
   whenNewTabLoaded(window, loadPinningPage);
 }
 
--- a/browser/base/content/test/general/browser_bookmark_titles.js
+++ b/browser/base/content/test/general/browser_bookmark_titles.js
@@ -37,17 +37,17 @@ add_task(function* () {
     // Network failure test: now that dummy_page.html is in history, bookmarking
     // it should give the last known page title as the default bookmark title.
 
     // Simulate a network outage with offline mode. (Localhost is still
     // accessible in offline mode, so disable the test proxy as well.)
     BrowserOffline.toggleOfflineStatus();
     let proxy = Services.prefs.getIntPref('network.proxy.type');
     Services.prefs.setIntPref('network.proxy.type', 0);
-    registerCleanupFunction(function () {
+    registerCleanupFunction(function() {
         BrowserOffline.toggleOfflineStatus();
         Services.prefs.setIntPref('network.proxy.type', proxy);
     });
 
     // LOAD_FLAGS_BYPASS_CACHE isn't good enough. So clear the cache.
     Services.cache2.clear();
 
     let [uri, title] = tests[0];
--- a/browser/base/content/test/general/browser_bug1064280_changeUrlInPinnedTab.js
+++ b/browser/base/content/test/general/browser_bug1064280_changeUrlInPinnedTab.js
@@ -26,11 +26,11 @@ add_task(function* () {
   goButton.click();
   yield BrowserTestUtils.browserLoaded(browser);
 
   is(appTab.linkedBrowser.currentURI.spec, TEST_LINK_CHANGED,
      "New page loaded in the app tab");
   is(gBrowser.tabs.length, initialTabsNo, "No additional tabs were opened");
 });
 
-registerCleanupFunction(function () {
+registerCleanupFunction(function() {
   gBrowser.removeTab(gBrowser.selectedTab);
 });
--- a/browser/base/content/test/general/browser_bug356571.js
+++ b/browser/base/content/test/general/browser_bug356571.js
@@ -42,17 +42,17 @@ const kDummyPage = "http://example.org/b
 const kURIs = [
   "bad://www.mozilla.org/",
   kDummyPage,
   kDummyPage,
 ];
 
 var gProgressListener = {
   _runCount: 0,
-  onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
+  onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
     if ((aStateFlags & kCompleteState) == kCompleteState) {
       if (++this._runCount != kURIs.length)
         return;
       // Check we failed on unknown protocol (received an alert from docShell)
       ok(didFail, "Correctly failed on unknown protocol");
       // Check we opened all tabs
       ok(gBrowser.tabs.length == kURIs.length, "Correctly opened all expected tabs");
       finishTest();
@@ -81,13 +81,13 @@ function finishTest() {
   Cm.QueryInterface(Ci.nsIComponentRegistrar)
     .registerFactory(Components.ID(kPromptServiceUUID), "Prompt Service",
                      kPromptServiceContractID, kPromptServiceFactory);
 
   // Remove the listener
   gBrowser.removeTabsProgressListener(gProgressListener);
 
   // Close opened tabs
-  for (var i = gBrowser.tabs.length-1; i > 0; i--)
+  for (var i = gBrowser.tabs.length - 1; i > 0; i--)
     gBrowser.removeTab(gBrowser.tabs[i]);
 
   finish();
 }
--- a/browser/base/content/test/general/browser_bug406216.js
+++ b/browser/base/content/test/general/browser_bug406216.js
@@ -19,32 +19,32 @@ function test() {
   URIS.forEach(addTab);
 }
 
 function addTab(aURI, aIndex) {
   var tab = gBrowser.addTab(aURI);
   if (aIndex == 0)
     gBrowser.removeTab(gBrowser.tabs[0], {skipPermitUnload: true});
 
-  tab.linkedBrowser.addEventListener("load", function (event) {
+  tab.linkedBrowser.addEventListener("load", function(event) {
     event.currentTarget.removeEventListener("load", arguments.callee, true);
     if (++count == URIS.length)
       executeSoon(doTabsTest);
   }, true);
 }
 
 function doTabsTest() {
   is(gBrowser.tabs.length, URIS.length, "Correctly opened all expected tabs");
 
   // sample of "close related tabs" feature
-  gBrowser.tabContainer.addEventListener("TabClose", function (event) {
+  gBrowser.tabContainer.addEventListener("TabClose", function(event) {
     event.currentTarget.removeEventListener("TabClose", arguments.callee, true);
     var closedTab = event.originalTarget;
     var scheme = closedTab.linkedBrowser.currentURI.scheme;
-    Array.slice(gBrowser.tabs).forEach(function (aTab) {
+    Array.slice(gBrowser.tabs).forEach(function(aTab) {
       if (aTab != closedTab && aTab.linkedBrowser.currentURI.scheme == scheme)
         gBrowser.removeTab(aTab, {skipPermitUnload: true});
     });
   }, true);
 
   gBrowser.removeTab(gBrowser.tabs[0], {skipPermitUnload: true});
   is(gBrowser.tabs.length, 1, "Related tabs are not closed unexpectedly");
 
--- a/browser/base/content/test/general/browser_bug416661.js
+++ b/browser/base/content/test/general/browser_bug416661.js
@@ -7,17 +7,17 @@ function start_test_prefNotSet() {
     // capture the zoom level to test later
     zoomLevel = ZoomManager.zoom;
     isnot(zoomLevel, 1, "zoom level should have changed");
 
     yield FullZoomHelper.load(gBrowser.selectedTab, "http://mochi.test:8888/browser/browser/base/content/test/general/moz.png");
   }).then(continue_test_prefNotSet, FullZoomHelper.failAndContinue(finish));
 }
 
-function continue_test_prefNotSet () {
+function continue_test_prefNotSet() {
   Task.spawn(function* () {
     is(ZoomManager.zoom, 1, "zoom level pref should not apply to an image");
     yield FullZoom.reset();
 
     yield FullZoomHelper.load(gBrowser.selectedTab, "http://mochi.test:8888/browser/browser/base/content/test/general/zoom_test.html");
   }).then(end_test_prefNotSet, FullZoomHelper.failAndContinue(finish));
 }
 
--- a/browser/base/content/test/general/browser_bug422590.js
+++ b/browser/base/content/test/general/browser_bug422590.js
@@ -5,38 +5,38 @@ function test() {
 }
 
 function testChromeless() {
   // test a chromeless window
   var newWin = openDialog(getBrowserURL(), "_blank",
                           "chrome,dialog=no,location=yes,toolbar=no", "about:blank");
   ok(newWin, "got new window");
 
-  whenDelayedStartupFinished(newWin, function () {
+  whenDelayedStartupFinished(newWin, function() {
     // Check that the search bar is hidden
     var searchBar = newWin.BrowserSearch.searchBar;
     ok(searchBar, "got search bar");
 
     var searchBarBO = searchBar.boxObject;
     is(searchBarBO.width, 0, "search bar hidden");
     is(searchBarBO.height, 0, "search bar hidden");
 
-    testCustomize(newWin, function () {
+    testCustomize(newWin, function() {
       newWin.close();
       finish();
     });
   });
 }
 
 function testCustomize(aWindow, aCallback) {
   var fileMenu = aWindow.document.getElementById("file-menu");
   ok(fileMenu, "got file menu");
   is(fileMenu.disabled, false, "file menu initially enabled");
 
-  openToolbarCustomizationUI(function () {
+  openToolbarCustomizationUI(function() {
     // Can't use the property, since the binding may have since been removed
     // if the element is hidden (see bug 422590)
     is(fileMenu.getAttribute("disabled"), "true",
        "file menu is disabled during toolbar customization");
 
     closeToolbarCustomizationUI(onClose, aWindow);
   }, aWindow);
 
--- a/browser/base/content/test/general/browser_bug423833.js
+++ b/browser/base/content/test/general/browser_bug423833.js
@@ -66,17 +66,17 @@ function test2Setup() {
   // Now let's do the whole thing again, but this time for "Open frame in new tab"
   var badFrame = content.frames[1];
 
   document.popupNode = badFrame.document.firstChild;
 
   var contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
   var contextMenu = new nsContextMenu(contentAreaContextMenu);
 
-  gBrowser.tabContainer.addEventListener("TabOpen", function (event) {
+  gBrowser.tabContainer.addEventListener("TabOpen", function(event) {
     test2tab = event.target;
     gBrowser.tabContainer.removeEventListener("TabOpen", arguments.callee, false);
   }, false);
   contextMenu.openFrameInTab();
   ok(test2tab, "openFrameInTab() opened a tab");
 
   gBrowser.selectedTab = test2tab;
 
@@ -102,17 +102,17 @@ function testOpenFrameInTab() {
 function test3Setup() {
   // One more time, for "Open frame in new window"
   var badFrame = content.frames[1];
   document.popupNode = badFrame.document.firstChild;
 
   var contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
   var contextMenu = new nsContextMenu(contentAreaContextMenu);
 
-  Services.ww.registerNotification(function (aSubject, aTopic, aData) {
+  Services.ww.registerNotification(function(aSubject, aTopic, aData) {
     if (aTopic == "domwindowopened")
       test3window = aSubject;
     Services.ww.unregisterNotification(arguments.callee);
   });
 
   contextMenu.openFrame();
 
   intervalID = setInterval(testOpenFrame, 3000);
--- a/browser/base/content/test/general/browser_bug431826.js
+++ b/browser/base/content/test/general/browser_bug431826.js
@@ -1,16 +1,16 @@
 function remote(task) {
   return ContentTask.spawn(gBrowser.selectedBrowser, null, task);
 }
 
 add_task(function* () {
   gBrowser.selectedTab = gBrowser.addTab();
 
-  let promise = remote(function () {
+  let promise = remote(function() {
     return ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", true, event => {
       return content.document.documentURI != "about:blank";
     }).then(() => 0); // don't want to send the event to the chrome process
   });
   gBrowser.loadURI("https://nocert.example.com/");
   yield promise;
 
   yield remote(() => {
@@ -25,17 +25,17 @@ add_task(function* () {
     Assert.ok(div, "Advanced content div should exist");
     Assert.equal(div.ownerGlobal.getComputedStyle(div).display,
       "none", "Advanced content should not be visible by default");
   });
 
   // Tweak the expert mode pref
   gPrefService.setBoolPref("browser.xul.error_pages.expert_bad_cert", true);
 
-  promise = remote(function () {
+  promise = remote(function() {
     return ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", true);
   });
   gBrowser.reload();
   yield promise;
 
   yield remote(() => {
     let div = content.document.getElementById("badCertAdvancedPanel");
     Assert.ok(div, "Advanced content div should exist");
--- a/browser/base/content/test/general/browser_bug441778.js
+++ b/browser/base/content/test/general/browser_bug441778.js
@@ -24,17 +24,17 @@ function test() {
 
     // Change the zoom level and then save it so we can compare it to the level
     // after loading the sub-document.
     FullZoom.enlarge();
     var zoomLevel = ZoomManager.zoom;
 
     // Start the sub-document load.
     let deferred = Promise.defer();
-    executeSoon(function () {
+    executeSoon(function() {
       BrowserTestUtils.browserLoaded(testBrowser, true).then(url => {
         is(url, TEST_IFRAME_URL, "got the load event for the iframe");
         is(ZoomManager.zoom, zoomLevel, "zoom is retained after sub-document load");
 
         FullZoomHelper.removeTabAndWaitForLocationChange().
           then(() => deferred.resolve());
       });
       ContentTask.spawn(testBrowser, TEST_IFRAME_URL, url => {
--- a/browser/base/content/test/general/browser_bug460146.js
+++ b/browser/base/content/test/general/browser_bug460146.js
@@ -1,25 +1,25 @@
 /* Check proper image url retrieval from all kinds of elements/styles */
 
 function test() {
   waitForExplicitFinish();
 
   gBrowser.selectedTab = gBrowser.addTab();
 
-  gBrowser.selectedBrowser.addEventListener("load", function () {
+  gBrowser.selectedBrowser.addEventListener("load", function() {
     gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
 
     var pageInfo = BrowserPageInfo(gBrowser.selectedBrowser.currentURI.spec,
                                    "mediaTab");
 
-    pageInfo.addEventListener("load", function () {
+    pageInfo.addEventListener("load", function() {
       pageInfo.removeEventListener("load", arguments.callee, true);
-      pageInfo.onFinished.push(function () {
-        executeSoon(function () {
+      pageInfo.onFinished.push(function() {
+        executeSoon(function() {
           var imageTree = pageInfo.document.getElementById("imagetree");
           var imageRowsNum = imageTree.view.rowCount;
 
           ok(imageTree, "Image tree is null (media tab is broken)");
 
           ok(imageRowsNum == 7, "Number of images listed: " +
                                 imageRowsNum + ", should be 7");
 
--- a/browser/base/content/test/general/browser_bug477014.js
+++ b/browser/base/content/test/general/browser_bug477014.js
@@ -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/. */
 
 // That's a gecko!
 const iconURLSpec = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==";
-var testPage="data:text/plain,test bug 477014";
+var testPage = "data:text/plain,test bug 477014";
 
 add_task(function*() {
   let tabToDetach = gBrowser.addTab(testPage);
   yield waitForDocLoadComplete(tabToDetach.linkedBrowser);
 
   gBrowser.setIcon(tabToDetach, iconURLSpec,
                    Services.scriptSecurityManager.getSystemPrincipal());
   tabToDetach.setAttribute("busy", "true");
--- a/browser/base/content/test/general/browser_bug481560.js
+++ b/browser/base/content/test/general/browser_bug481560.js
@@ -1,13 +1,13 @@
 function test() {
   waitForExplicitFinish();
 
-  whenNewWindowLoaded(null, function (win) {
-    waitForFocus(function () {
+  whenNewWindowLoaded(null, function(win) {
+    waitForFocus(function() {
       function onTabClose() {
         ok(false, "shouldn't have gotten the TabClose event for the last tab");
       }
       var tab = win.gBrowser.selectedTab;
       tab.addEventListener("TabClose", onTabClose, false);
 
       EventUtils.synthesizeKey("w", { accelKey: true }, win);
 
--- a/browser/base/content/test/general/browser_bug517902.js
+++ b/browser/base/content/test/general/browser_bug517902.js
@@ -1,27 +1,27 @@
 /* Make sure that "View Image Info" loads the correct image data */
 
 function test() {
   waitForExplicitFinish();
 
   gBrowser.selectedTab = gBrowser.addTab();
 
-  gBrowser.selectedBrowser.addEventListener("load", function () {
+  gBrowser.selectedBrowser.addEventListener("load", function() {
     gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
 
     var doc = gBrowser.contentDocument;
     var testImg = doc.getElementById("test-image");
     var pageInfo = BrowserPageInfo(gBrowser.selectedBrowser.currentURI.spec,
                                    "mediaTab", testImg);
 
-    pageInfo.addEventListener("load", function () {
+    pageInfo.addEventListener("load", function() {
       pageInfo.removeEventListener("load", arguments.callee, true);
-      pageInfo.onFinished.push(function () {
-        executeSoon(function () {
+      pageInfo.onFinished.push(function() {
+        executeSoon(function() {
           var pageInfoImg = pageInfo.document.getElementById("thepreviewimage");
 
           is(pageInfoImg.src, testImg.src, "selected image has the correct source");
           is(pageInfoImg.width, testImg.width, "selected image has the correct width");
           is(pageInfoImg.height, testImg.height, "selected image has the correct height");
 
           pageInfo.close();
           gBrowser.removeCurrentTab();
--- a/browser/base/content/test/general/browser_bug519216.js
+++ b/browser/base/content/test/general/browser_bug519216.js
@@ -23,17 +23,17 @@ var progressListener2 = {
   }
 };
 
 var progressListener3 = {
   onLocationChange: function onLocationChange() {
     ok(calledListener2, "called progressListener2 before progressListener3");
     gBrowser.removeProgressListener(this);
     gBrowser.addProgressListener(progressListener4);
-    executeSoon(function () {
+    executeSoon(function() {
       expectListener4 = true;
       gBrowser.reload();
     });
   }
 };
 
 var expectListener4 = false;
 var progressListener4 = {
--- a/browser/base/content/test/general/browser_bug537013.js
+++ b/browser/base/content/test/general/browser_bug537013.js
@@ -28,17 +28,17 @@ function setFindString(aString) {
   EventUtils.sendString(aString);
   is(gFindBar._findField.value, aString, "Set the field correctly!");
 }
 
 var newWindow;
 
 function test() {
   waitForExplicitFinish();
-  registerCleanupFunction(function () {
+  registerCleanupFunction(function() {
     while (tabs.length) {
       gBrowser.removeTab(tabs.pop());
     }
   });
   texts.forEach(aText => addTabWithText(aText));
 
   // Set up the first tab
   gBrowser.selectedTab = tabs[0];
--- a/browser/base/content/test/general/browser_bug553455.js
+++ b/browser/base/content/test/general/browser_bug553455.js
@@ -494,17 +494,17 @@ function test_multiple() {
        "2 add-ons will be installed after you restart " + gApp + ".",
        "Should have seen the right message");
 
     let installs = yield getInstalls();
     is(installs.length, 1, "Should be one pending install");
     installs[0].cancel();
 
     let addon = yield new Promise(resolve => {
-      AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function (result) {
+      AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(result) {
         resolve(result);
       });
     });
     addon.uninstall();
     Services.perms.remove(makeURI("http://example.com/"), "install");
     yield removeTab();
   });
 },
@@ -1116,17 +1116,17 @@ function test_failedSecurity() {
     yield removeTab();
   });
 }
 ];
 
 var gTestStart = null;
 
 var XPInstallObserver = {
-  observe: function (aSubject, aTopic, aData) {
+  observe: function(aSubject, aTopic, aData) {
     var installInfo = aSubject.QueryInterface(Components.interfaces.amIWebInstallInfo);
     info("Observed " + aTopic + " for " + installInfo.installs.length + " installs");
     installInfo.installs.forEach(function(aInstall) {
       info("Install of " + aInstall.sourceURI.spec + " was in state " + aInstall.state);
     });
   }
 };
 
--- a/browser/base/content/test/general/browser_bug561636.js
+++ b/browser/base/content/test/general/browser_bug561636.js
@@ -12,17 +12,17 @@ function checkPopupHide()
 {
   ok(gInvalidFormPopup.state != 'showing' && gInvalidFormPopup.state != 'open',
      "[Test " + testId + "] The invalid form popup should not be shown");
 }
 
 var gObserver = {
   QueryInterface : XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver]),
 
-  notifyInvalidSubmit : function (aFormElement, aInvalidElements)
+  notifyInvalidSubmit : function(aFormElement, aInvalidElements)
   {
   }
 };
 
 var testId = 0;
 
 function incrementTest()
 {
@@ -292,24 +292,24 @@ add_task(function* ()
 
   let notifierPromise = new Promise((resolve, reject) => {
     gObserver.notifyInvalidSubmit = function() {
       executeSoon(function() {
         checkPopupHide();
 
         // Clean-up
         Services.obs.removeObserver(gObserver, "invalidformsubmit");
-        gObserver.notifyInvalidSubmit = function () {};
+        gObserver.notifyInvalidSubmit = function() {};
         resolve();
       });
     };
 
     Services.obs.addObserver(gObserver, "invalidformsubmit", false);
 
-    executeSoon(function () {
+    executeSoon(function() {
       browser.contentDocument.getElementById('s').click();
     });
   });
 
   yield notifierPromise;
 
   gBrowser.removeTab(gBrowser.getTabForBrowser(browser));
 });
--- a/browser/base/content/test/general/browser_bug585785.js
+++ b/browser/base/content/test/general/browser_bug585785.js
@@ -18,18 +18,18 @@ function checkAnimationState() {
   if (!tab.parentNode) {
     ok(true, "tab removed synchronously since the opening animation hasn't moved yet");
     finish();
     return;
   }
 
   info("tab didn't close immediately, so the tab opening animation must have started moving");
   info("waiting for the tab to close asynchronously");
-  tab.addEventListener("transitionend", function (event) {
+  tab.addEventListener("transitionend", function(event) {
     if (event.propertyName == "max-width") {
       tab.removeEventListener("transitionend", arguments.callee, false);
-      executeSoon(function () {
+      executeSoon(function() {
         ok(!tab.parentNode, "tab removed asynchronously");
         finish();
       });
     }
   }, false);
 }
--- a/browser/base/content/test/general/browser_bug609700.js
+++ b/browser/base/content/test/general/browser_bug609700.js
@@ -1,19 +1,19 @@
 function test() {
   waitForExplicitFinish();
 
-  Services.ww.registerNotification(function (aSubject, aTopic, aData) {
+  Services.ww.registerNotification(function(aSubject, aTopic, aData) {
     if (aTopic == "domwindowopened") {
       Services.ww.unregisterNotification(arguments.callee);
 
       ok(true, "duplicateTabIn opened a new window");
 
-      whenDelayedStartupFinished(aSubject, function () {
-        executeSoon(function () {
+      whenDelayedStartupFinished(aSubject, function() {
+        executeSoon(function() {
           aSubject.close();
           finish();
         });
       }, false);
     }
   });
 
   duplicateTabIn(gBrowser.selectedTab, "window");
--- a/browser/base/content/test/general/browser_bug623893.js
+++ b/browser/base/content/test/general/browser_bug623893.js
@@ -1,24 +1,24 @@
 function test() {
   waitForExplicitFinish();
 
-  loadAndWait("data:text/plain,1", function () {
-    loadAndWait("data:text/plain,2", function () {
+  loadAndWait("data:text/plain,1", function() {
+    loadAndWait("data:text/plain,2", function() {
       loadAndWait("data:text/plain,3", runTests);
     });
   });
 }
 
 function runTests() {
-  duplicate(0, "maintained the original index", function () {
+  duplicate(0, "maintained the original index", function() {
     gBrowser.removeCurrentTab();
 
-    duplicate(-1, "went back", function () {
-      duplicate(1, "went forward", function () {
+    duplicate(-1, "went back", function() {
+      duplicate(1, "went forward", function() {
         gBrowser.removeCurrentTab();
         gBrowser.removeCurrentTab();
         gBrowser.addTab();
         gBrowser.removeCurrentTab();
         finish();
       });
     });
   });
@@ -33,15 +33,15 @@ function duplicate(delta, msg, cb) {
   tab.addEventListener("SSTabRestored", function tabRestoredListener() {
     tab.removeEventListener("SSTabRestored", tabRestoredListener, false);
     is(gBrowser.sessionHistory.index, start + delta, msg);
     executeSoon(cb);
   }, false);
 }
 
 function loadAndWait(url, cb) {
-  gBrowser.selectedBrowser.addEventListener("load", function () {
+  gBrowser.selectedBrowser.addEventListener("load", function() {
     gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
     executeSoon(cb);
   }, true);
 
   gBrowser.loadURI(url);
 }
--- a/browser/base/content/test/general/browser_bug664672.js
+++ b/browser/base/content/test/general/browser_bug664672.js
@@ -1,19 +1,19 @@
 function test() {
   waitForExplicitFinish();
 
   var tab = gBrowser.addTab();
 
-  tab.addEventListener("TabClose", function () {
+  tab.addEventListener("TabClose", function() {
     tab.removeEventListener("TabClose", arguments.callee, false);
 
     ok(tab.linkedBrowser, "linkedBrowser should still exist during the TabClose event");
 
-    executeSoon(function () {
+    executeSoon(function() {
       ok(!tab.linkedBrowser, "linkedBrowser should be gone after the TabClose event");
 
       finish();
     });
   }, false);
 
   gBrowser.removeTab(tab);
 }
--- a/browser/base/content/test/general/browser_bug676619.js
+++ b/browser/base/content/test/general/browser_bug676619.js
@@ -1,29 +1,29 @@
-function test () {
+function test() {
   requestLongerTimeout(3);
   waitForExplicitFinish();
 
   var isHTTPS = false;
 
   function loadListener() {
     function testLocation(link, url, next) {
-      new TabOpenListener(url, function () {
+      new TabOpenListener(url, function() {
         gBrowser.removeTab(this.tab);
-      }, function () {
+      }, function() {
         next();
       });
 
       ContentTask.spawn(gBrowser.selectedBrowser, link, contentLink => {
         content.document.getElementById(contentLink).click();
       });
     }
 
     function testLink(link, name, next) {
-      addWindowListener("chrome://mozapps/content/downloads/unknownContentType.xul", function (win) {
+      addWindowListener("chrome://mozapps/content/downloads/unknownContentType.xul", function(win) {
         ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
           Assert.equal(content.document.getElementById("unload-flag").textContent,
             "Okay", "beforeunload shouldn't have fired");
         }).then(() => {
           is(win.document.getElementById("location").value, name, "file name should match");
           win.close();
           next();
         });
@@ -36,17 +36,17 @@ function test () {
 
     testLink("link1", "test.txt",
       testLink.bind(null, "link2", "video.ogg",
         testLink.bind(null, "link3", "just some video",
           testLink.bind(null, "link4", "with-target.txt",
             testLink.bind(null, "link5", "javascript.txt",
               testLink.bind(null, "link6", "test.blob",
                 testLocation.bind(null, "link7", "http://example.com/",
-                  function () {
+                  function() {
                     if (isHTTPS) {
                       finish();
                     } else {
                       // same test again with https:
                       isHTTPS = true;
                       gBrowser.loadURI("https://example.com:443/browser/browser/base/content/test/general/download_page.html");
                     }
                   })))))));
--- a/browser/base/content/test/general/browser_bug678392.js
+++ b/browser/base/content/test/general/browser_bug678392.js
@@ -8,17 +8,17 @@ function maxSnapshotOverride() {
   return 5;
 }
 
 function test() {
   waitForExplicitFinish();
 
   BrowserOpenTab();
   let tab = gBrowser.selectedTab;
-  registerCleanupFunction(function () { gBrowser.removeTab(tab); });
+  registerCleanupFunction(function() { gBrowser.removeTab(tab); });
 
   ok(gHistorySwipeAnimation, "gHistorySwipeAnimation exists.");
 
   if (!gHistorySwipeAnimation._isSupported()) {
     is(gHistorySwipeAnimation.active, false, "History swipe animation is not " +
        "active when not supported by the platform.");
     finish();
     return;
--- a/browser/base/content/test/general/browser_bug734076.js
+++ b/browser/base/content/test/general/browser_bug734076.js
@@ -10,75 +10,75 @@ add_task(function* ()
 
   let writeDomainURL = encodeURI("data:text/html,<script>document.write(document.domain);</script>");
 
   let tests = [
     {
       name: "view background image",
       url: "http://mochi.test:8888/",
       element: "body",
-      go: function () {
+      go: function() {
         return ContentTask.spawn(gBrowser.selectedBrowser, { writeDomainURL: writeDomainURL }, function* (arg) {
           let contentBody = content.document.body;
           contentBody.style.backgroundImage = "url('" + arg.writeDomainURL + "')";
 
           return "context-viewbgimage";
         });
       },
-      verify: function () {
+      verify: function() {
         return ContentTask.spawn(gBrowser.selectedBrowser, null, function* (arg) {
           Assert.ok(!content.document.body.textContent,
             "no domain was inherited for view background image");
         });
       }
     },
     {
       name: "view image",
       url: "http://mochi.test:8888/",
       element: "img",
-      go: function () {
+      go: function() {
         return ContentTask.spawn(gBrowser.selectedBrowser, { writeDomainURL: writeDomainURL }, function* (arg) {
           let doc = content.document;
           let img = doc.createElement("img");
           img.height = 100;
           img.width = 100;
           img.setAttribute("src", arg.writeDomainURL);
           doc.body.insertBefore(img, doc.body.firstChild);
 
           return "context-viewimage";
         });
       },
-      verify: function () {
+      verify: function() {
         return ContentTask.spawn(gBrowser.selectedBrowser, null, function* (arg) {
           Assert.ok(!content.document.body.textContent,
             "no domain was inherited for view image");
         });
       }
     },
     {
       name: "show only this frame",
       url: "http://mochi.test:8888/",
       element: "iframe",
-      go: function () {
+      go: function() {
         return ContentTask.spawn(gBrowser.selectedBrowser, { writeDomainURL: writeDomainURL }, function* (arg) {
           let doc = content.document;
           let iframe = doc.createElement("iframe");
           iframe.setAttribute("src", arg.writeDomainURL);
           doc.body.insertBefore(iframe, doc.body.firstChild);
 
           // Wait for the iframe to load.
           return new Promise(resolve => {
             iframe.addEventListener("load", function onload() {
               iframe.removeEventListener("load", onload, true);
               resolve("context-showonlythisframe");
             }, true);
           });
         });
       },
-      verify: function () {
+      verify: function() {
         return ContentTask.spawn(gBrowser.selectedBrowser, null, function* (arg) {
           Assert.ok(!content.document.body.textContent,
             "no domain was inherited for 'show only this frame'");
         });
       }
     }
   ];
 
--- a/browser/base/content/test/general/browser_bug735471.js
+++ b/browser/base/content/test/general/browser_bug735471.js
@@ -7,17 +7,17 @@
 
 function test() {
   waitForExplicitFinish();
   // Open a new tab.
   whenNewTabLoaded(window, testPreferences);
 }
 
 function testPreferences() {
-  whenTabLoaded(gBrowser.selectedTab, function () {
+  whenTabLoaded(gBrowser.selectedTab, function() {
     is(content.location.href, "about:preferences", "Checking if the preferences tab was opened");
 
     gBrowser.removeCurrentTab();
     finish();
   });
 
   openPreferences();
 }
--- a/browser/base/content/test/general/browser_bug817947.js
+++ b/browser/base/content/test/general/browser_bug817947.js
@@ -4,46 +4,46 @@
 
 const URL = "http://mochi.test:8888/browser/";
 const PREF = "browser.sessionstore.restore_on_demand";
 
 function test() {
   waitForExplicitFinish();
 
   Services.prefs.setBoolPref(PREF, true);
-  registerCleanupFunction(function () {
+  registerCleanupFunction(function() {
     Services.prefs.clearUserPref(PREF);
   });
 
-  preparePendingTab(function (aTab) {
+  preparePendingTab(function(aTab) {
     let win = gBrowser.replaceTabWithWindow(aTab);
 
-    whenDelayedStartupFinished(win, function () {
+    whenDelayedStartupFinished(win, function() {
       let [tab] = win.gBrowser.tabs;
 
-      whenLoaded(tab.linkedBrowser, function () {
+      whenLoaded(tab.linkedBrowser, function() {
         is(tab.linkedBrowser.currentURI.spec, URL, "correct url should be loaded");
         ok(!tab.hasAttribute("pending"), "tab should not be pending");
 
         win.close();
         finish();
       });
     });
   });
 }
 
 function preparePendingTab(aCallback) {
   let tab = gBrowser.addTab(URL);
 
-  whenLoaded(tab.linkedBrowser, function () {
+  whenLoaded(tab.linkedBrowser, function() {
     BrowserTestUtils.removeTab(tab).then(() => {
       let [{state}] = JSON.parse(SessionStore.getClosedTabData(window));
 
       tab = gBrowser.addTab("about:blank");
-      whenLoaded(tab.linkedBrowser, function () {
+      whenLoaded(tab.linkedBrowser, function() {
         SessionStore.setTabState(tab, JSON.stringify(state));
         ok(tab.hasAttribute("pending"), "tab should be pending");
         aCallback(tab);
       });
     });
   });
 }
 
--- a/browser/base/content/test/general/browser_clipboard_pastefile.js
+++ b/browser/base/content/test/general/browser_clipboard_pastefile.js
@@ -30,17 +30,17 @@ add_task(function*() {
     content.document.getElementById("input").focus();
   });
 
   yield BrowserTestUtils.synthesizeKey("v", { accelKey: true }, browser);
 
   let output = yield ContentTask.spawn(browser, { }, function* (arg) {
     return content.document.getElementById("output").textContent;
   });
-  is (output, "Passed", "Paste file");
+  is(output, "Passed", "Paste file");
 
   textbox.focus();
 
   yield new Promise((resolve, reject) => {
     textbox.addEventListener("paste", function copyEvent(event) {
       textbox.removeEventListener("paste", copyEvent, true);
 
       let dt = event.clipboardData;
--- a/browser/base/content/test/general/browser_contentAltClick.js
+++ b/browser/base/content/test/general/browser_contentAltClick.js
@@ -49,17 +49,17 @@ add_task(function* test_alt_click()
   yield setup();
 
   let downloadList = yield Downloads.getList(Downloads.ALL);
   let downloads = [];
   let downloadView;
   // When 1 download has been attempted then resolve the promise.
   let finishedAllDownloads = new Promise( (resolve) => {
     downloadView = {
-      onDownloadAdded: function (aDownload) {
+      onDownloadAdded: function(aDownload) {
         downloads.push(aDownload);
         resolve();
       },
     };
   });
   yield downloadList.addView(downloadView);
   yield BrowserTestUtils.synthesizeMouseAtCenter("#commonlink", {altKey: true}, gBrowser.selectedBrowser);
 
@@ -78,17 +78,17 @@ add_task(function* test_alt_click_on_xli
   yield setup();
 
   let downloadList = yield Downloads.getList(Downloads.ALL);
   let downloads = [];
   let downloadView;
   // When all 2 downloads have been attempted then resolve the promise.
   let finishedAllDownloads = new Promise( (resolve) => {
     downloadView = {
-      onDownloadAdded: function (aDownload) {
+      onDownloadAdded: function(aDownload) {
         downloads.push(aDownload);
         if (downloads.length == 2) {
           resolve();
         }
       },
     };
   });
   yield downloadList.addView(downloadView);
--- a/browser/base/content/test/general/browser_contentAreaClick.js
+++ b/browser/base/content/test/general/browser_contentAreaClick.js
@@ -178,33 +178,33 @@ var gInvokedMethods = [];
 
 // The test currently running.
 var gCurrentTest = null;
 
 function test() {
   waitForExplicitFinish();
 
   gTestWin = openDialog(location, "", "chrome,all,dialog=no", "about:blank");
-  whenDelayedStartupFinished(gTestWin, function () {
+  whenDelayedStartupFinished(gTestWin, function() {
     info("Browser window opened");
     waitForFocus(function() {
       info("Browser window focused");
       waitForFocus(function() {
         info("Setting up browser...");
         setupTestBrowserWindow();
         info("Running tests...");
         executeSoon(runNextTest);
       }, gTestWin.content, true);
     }, gTestWin);
   });
 }
 
 // Click handler used to steal click events.
 var gClickHandler = {
-  handleEvent: function (event) {
+  handleEvent: function(event) {
     let linkId = event.target.id || event.target.localName;
     is(event.type, "click",
        gCurrentTest.desc + ":Handler received a click event on " + linkId);
 
     let isPanelClick = linkId == "panellink";
     gTestWin.contentAreaClick(event, isPanelClick);
     let prevent = event.defaultPrevented;
     is(prevent, gCurrentTest.preventDefault,
@@ -225,29 +225,29 @@ var gClickHandler = {
     event.stopPropagation();
 
     executeSoon(runNextTest);
   }
 }
 
 // Wraps around the methods' replacement mock function.
 function wrapperMethod(aInvokedMethods, aMethodName) {
-  return function () {
+  return function() {
     aInvokedMethods.push(aMethodName);
     // At least getShortcutOrURIAndPostData requires to return url
     return (aMethodName == "getShortcutOrURIAndPostData") ? arguments.url : arguments[0];
   }
 }
 
 function setupTestBrowserWindow() {
   // Steal click events and don't propagate them.
   gTestWin.addEventListener("click", gClickHandler, true);
 
   // Replace methods.
-  gReplacedMethods.forEach(function (aMethodName) {
+  gReplacedMethods.forEach(function(aMethodName) {
     gTestWin["old_" + aMethodName] = gTestWin[aMethodName];
     gTestWin[aMethodName] = wrapperMethod(gInvokedMethods, aMethodName);
   });
 
   // Inject links in content.
   let doc = gTestWin.content.document;
   let mainDiv = doc.createElement("div");
   mainDiv.innerHTML =
@@ -292,16 +292,16 @@ function runNextTest() {
   EventUtils.synthesizeMouseAtCenter(targetElt, gCurrentTest.event, gTestWin.content);
 }
 
 function finishTest() {
   info("Restoring browser...");
   gTestWin.removeEventListener("click", gClickHandler, true);
 
   // Restore original methods.
-  gReplacedMethods.forEach(function (aMethodName) {
+  gReplacedMethods.forEach(function(aMethodName) {
     gTestWin[aMethodName] = gTestWin["old_" + aMethodName];
     delete gTestWin["old_" + aMethodName];
   });
 
   gTestWin.close();
   finish();
 }
--- a/browser/base/content/test/general/browser_contentSearchUI.js
+++ b/browser/base/content/test/general/browser_contentSearchUI.js
@@ -655,17 +655,17 @@ function setUp(aNoEngine) {
       yield setUpEngines();
       yield promiseTab();
       gDidInitialSetUp = true;
     }
     yield msg("focus");
   });
 }
 
-function msg(type, data=null) {
+function msg(type, data = null) {
   gMsgMan.sendAsyncMessage(TEST_MSG, {
     type: type,
     data: data,
   });
   let deferred = Promise.defer();
   gMsgMan.addMessageListener(TEST_MSG, function onMsg(msgObj) {
     if (msgObj.data.type != type) {
       return;
--- a/browser/base/content/test/general/browser_ctrlTab.js
+++ b/browser/base/content/test/general/browser_ctrlTab.js
@@ -80,17 +80,17 @@ add_task(function* () {
   yield ctrlTabTest([1], 1, 0);
 
   gBrowser.removeTab(gBrowser.tabContainer.lastChild);
   checkTabs(1);
 
   { // test for bug 445768
     let focusedWindow = document.commandDispatcher.focusedWindow;
     let eventConsumed = true;
-    let detectKeyEvent = function (event) {
+    let detectKeyEvent = function(event) {
       eventConsumed = event.defaultPrevented;
     };
     document.addEventListener("keypress", detectKeyEvent, false);
     yield pressCtrlTab();
     document.removeEventListener("keypress", detectKeyEvent, false);
     ok(eventConsumed, "Ctrl+Tab consumed by the tabbed browser if one tab is open");
     is(focusedWindow, document.commandDispatcher.focusedWindow,
        "Ctrl+Tab doesn't change focus if one tab is open");
@@ -138,17 +138,17 @@ add_task(function* () {
     return gPrefService.getBoolPref("browser.ctrlTab.previews") && gBrowser.tabs.length > 2;
   }
 
   function checkTabs(aTabs) {
     is(gBrowser.tabs.length, aTabs, "number of open tabs should be " + aTabs);
   }
 
   function selectTabs(tabs) {
-    tabs.forEach(function (index) {
+    tabs.forEach(function(index) {
       gBrowser.selectedTab = gBrowser.tabs[index];
     });
   }
 
   function* ctrlTabTest(tabsToSelect, tabTimes, expectedIndex) {
     selectTabs(tabsToSelect);
 
     var indexStart = gBrowser.tabContainer.selectedIndex;
@@ -174,12 +174,12 @@ add_task(function* () {
       ok(!isOpen(),
          "Releasing Ctrl closes the preview panel");
     } else {
       ok(!isOpen(),
          "With " + tabCount + " tabs open, Ctrl+Tab doesn't open the preview panel");
     }
 
     is(gBrowser.tabContainer.selectedIndex, expectedIndex,
-       "With "+ tabCount +" tabs open and tab " + indexStart
+       "With " + tabCount + " tabs open and tab " + indexStart
        + " selected, Ctrl+Tab*" + tabTimes + " goes " + where);
   }
 });
--- a/browser/base/content/test/general/browser_devedition.js
+++ b/browser/base/content/test/general/browser_devedition.js
@@ -20,108 +20,108 @@ registerCleanupFunction(() => {
 
   LightweightThemeManager.currentTheme = null;
   LightweightThemeManager.clearBuiltInThemes();
 });
 
 add_task(function* startTests() {
   Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "dark");
 
-  info ("Setting the current theme to null");
+  info("Setting the current theme to null");
   LightweightThemeManager.currentTheme = null;
-  ok (!DevEdition.isStyleSheetEnabled, "There is no devedition style sheet when no lw theme is applied.");
+  ok(!DevEdition.isStyleSheetEnabled, "There is no devedition style sheet when no lw theme is applied.");
 
-  info ("Adding a lightweight theme.");
+  info("Adding a lightweight theme.");
   LightweightThemeManager.currentTheme = dummyLightweightTheme("preview0");
-  ok (!DevEdition.isStyleSheetEnabled, "The devedition stylesheet has been removed when a lightweight theme is applied.");
+  ok(!DevEdition.isStyleSheetEnabled, "The devedition stylesheet has been removed when a lightweight theme is applied.");
 
-  info ("Applying the devedition lightweight theme.");
+  info("Applying the devedition lightweight theme.");
   let onAttributeAdded = waitForBrightTitlebarAttribute();
   LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme("firefox-devedition@mozilla.org");
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet has been added when the devedition lightweight theme is applied");
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet has been added when the devedition lightweight theme is applied");
   yield onAttributeAdded;
-  is (document.documentElement.getAttribute("brighttitlebarforeground"), "true",
+  is(document.documentElement.getAttribute("brighttitlebarforeground"), "true",
      "The brighttitlebarforeground attribute is set on the window.");
 
-  info ("Unapplying all themes.");
+  info("Unapplying all themes.");
   LightweightThemeManager.currentTheme = null;
-  ok (!DevEdition.isStyleSheetEnabled, "There is no devedition style sheet when no lw theme is applied.");
+  ok(!DevEdition.isStyleSheetEnabled, "There is no devedition style sheet when no lw theme is applied.");
 
-  info ("Applying the devedition lightweight theme.");
+  info("Applying the devedition lightweight theme.");
   onAttributeAdded = waitForBrightTitlebarAttribute();
   LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme("firefox-devedition@mozilla.org");
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet has been added when the devedition lightweight theme is applied");
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet has been added when the devedition lightweight theme is applied");
   yield onAttributeAdded;
-  ok (document.documentElement.hasAttribute("brighttitlebarforeground"),
+  ok(document.documentElement.hasAttribute("brighttitlebarforeground"),
      "The brighttitlebarforeground attribute is set on the window with dark devtools theme.");
 });
 
 add_task(function* testDevtoolsTheme() {
-  info ("Checking stylesheet and :root attributes based on devtools theme.");
+  info("Checking stylesheet and :root attributes based on devtools theme.");
   Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "light");
-  is (document.documentElement.getAttribute("devtoolstheme"), "light",
+  is(document.documentElement.getAttribute("devtoolstheme"), "light",
     "The documentElement has an attribute based on devtools theme.");
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet is still there with the light devtools theme.");
-  ok (!document.documentElement.hasAttribute("brighttitlebarforeground"),
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet is still there with the light devtools theme.");
+  ok(!document.documentElement.hasAttribute("brighttitlebarforeground"),
      "The brighttitlebarforeground attribute is not set on the window with light devtools theme.");
 
   Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "dark");
-  is (document.documentElement.getAttribute("devtoolstheme"), "dark",
+  is(document.documentElement.getAttribute("devtoolstheme"), "dark",
     "The documentElement has an attribute based on devtools theme.");
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet is still there with the dark devtools theme.");
-  is (document.documentElement.getAttribute("brighttitlebarforeground"), "true",
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet is still there with the dark devtools theme.");
+  is(document.documentElement.getAttribute("brighttitlebarforeground"), "true",
      "The brighttitlebarforeground attribute is set on the window with dark devtools theme.");
 
   Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "foobar");
-  is (document.documentElement.getAttribute("devtoolstheme"), "light",
+  is(document.documentElement.getAttribute("devtoolstheme"), "light",
     "The documentElement has 'light' as a default for the devtoolstheme attribute");
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet is still there with the foobar devtools theme.");
-  ok (!document.documentElement.hasAttribute("brighttitlebarforeground"),
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet is still there with the foobar devtools theme.");
+  ok(!document.documentElement.hasAttribute("brighttitlebarforeground"),
      "The brighttitlebarforeground attribute is not set on the window with light devtools theme.");
 });
 
 function dummyLightweightTheme(id) {
   return {
     id: id,
     name: id,
     headerURL: "resource:///chrome/browser/content/browser/defaultthemes/devedition.header.png",
     iconURL: "resource:///chrome/browser/content/browser/defaultthemes/devedition.icon.png",
     textcolor: "red",
     accentcolor: "blue"
   };
 }
 
 add_task(function* testLightweightThemePreview() {
-  info ("Setting devedition to current and the previewing others");
+  info("Setting devedition to current and the previewing others");
   LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme("firefox-devedition@mozilla.org");
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet is enabled.");
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet is enabled.");
   LightweightThemeManager.previewTheme(dummyLightweightTheme("preview0"));
-  ok (!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is not enabled after a lightweight theme preview.");
+  ok(!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is not enabled after a lightweight theme preview.");
   LightweightThemeManager.resetPreview();
   LightweightThemeManager.previewTheme(dummyLightweightTheme("preview1"));
-  ok (!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is not enabled after a second lightweight theme preview.");
+  ok(!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is not enabled after a second lightweight theme preview.");
   LightweightThemeManager.resetPreview();
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet is enabled again after resetting the preview.");
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet is enabled again after resetting the preview.");
   LightweightThemeManager.currentTheme = null;
-  ok (!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is gone after removing the current theme.");
+  ok(!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is gone after removing the current theme.");
 
-  info ("Previewing the devedition theme");
+  info("Previewing the devedition theme");
   LightweightThemeManager.previewTheme(LightweightThemeManager.getUsedTheme("firefox-devedition@mozilla.org"));
-  ok (DevEdition.isStyleSheetEnabled, "The devedition stylesheet is enabled.");
+  ok(DevEdition.isStyleSheetEnabled, "The devedition stylesheet is enabled.");
   LightweightThemeManager.previewTheme(dummyLightweightTheme("preview2"));
   LightweightThemeManager.resetPreview();
-  ok (!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is now disabled after resetting the preview.");
+  ok(!DevEdition.isStyleSheetEnabled, "The devedition stylesheet is now disabled after resetting the preview.");
 });
 
 // Use a mutation observer to wait for the brighttitlebarforeground
 // attribute to change.  Using this instead of waiting for the load
 // event on the DevEdition styleSheet.
 function waitForBrightTitlebarAttribute() {
   return new Promise((resolve, reject) => {
-    let mutationObserver = new MutationObserver(function (mutations) {
+    let mutationObserver = new MutationObserver(function(mutations) {
       for (let mutation of mutations) {
         if (mutation.attributeName == "brighttitlebarforeground") {
           mutationObserver.disconnect();
           resolve();
         }
       }
     });
     mutationObserver.observe(document.documentElement, { attributes: true });
--- a/browser/base/content/test/general/browser_discovery.js
+++ b/browser/base/content/test/general/browser_discovery.js
@@ -1,27 +1,27 @@
 var browser;
 
 function doc() {
   return browser.contentDocument;
 }
 
 function setHandlerFunc(aResultFunc) {
-  gBrowser.addEventListener("DOMLinkAdded", function (event) {
+  gBrowser.addEventListener("DOMLinkAdded", function(event) {
     gBrowser.removeEventListener("DOMLinkAdded", arguments.callee, false);
     executeSoon(aResultFunc);
   }, false);
 }
 
 function test() {
   waitForExplicitFinish();
 
   gBrowser.selectedTab = gBrowser.addTab();
   browser = gBrowser.selectedBrowser;
-  browser.addEventListener("load", function (event) {
+  browser.addEventListener("load", function(event) {
     event.currentTarget.removeEventListener("load", arguments.callee, true);
     iconDiscovery();
   }, true);
   var rootDir = getRootDirectory(gTestPath);
   content.location = rootDir + "discovery.html";
 }
 
 var iconDiscoveryTests = [
--- a/browser/base/content/test/general/browser_domFullscreen_fullscreenMode.js
+++ b/browser/base/content/test/general/browser_domFullscreen_fullscreenMode.js
@@ -109,17 +109,17 @@ var gTests = [
     affectsFullscreenMode: false,
     exitFunc: () => {
       executeSoon(() => EventUtils.synthesizeKey("VK_ESCAPE", {}));
     }
   },
   {
     desc: "F11 key",
     affectsFullscreenMode: true,
-    exitFunc: function () {
+    exitFunc: function() {
       executeSoon(() => EventUtils.synthesizeKey("VK_F11", {}));
     }
   }
 ];
 
 function checkState(expectedStates, contentStates) {
   is(contentStates.inDOMFullscreen, expectedStates.inDOMFullscreen,
      "The DOM fullscreen state of the content should match");
--- a/browser/base/content/test/general/browser_drag.js
+++ b/browser/base/content/test/general/browser_drag.js
@@ -30,16 +30,16 @@ function test()
   // Now, the identity information panel is opened by the proxy icon click.
   // We need to close it for next tests.
   EventUtils.synthesizeKey("VK_ESCAPE", {}, window);
 
   // now test dragging onto a tab
   var tab = gBrowser.addTab("about:blank", {skipAnimation: true});
   var browser = gBrowser.getBrowserForTab(tab);
 
-  browser.addEventListener("load", function () {
+  browser.addEventListener("load", function() {
     is(browser.contentWindow.location, "http://mochi.test:8888/", "drop on tab");
     gBrowser.removeTab(tab);
     finish();
   }, true);
 
   EventUtils.synthesizeDrop(tab, tab, [[{type: "text/uri-list", data: "http://mochi.test:8888/"}]], "copy", window);
 }
--- a/browser/base/content/test/general/browser_duplicateIDs.js
+++ b/browser/base/content/test/general/browser_duplicateIDs.js
@@ -1,8 +1,8 @@
 function test() {
   var ids = {};
-  Array.forEach(document.querySelectorAll("[id]"), function (node) {
+  Array.forEach(document.querySelectorAll("[id]"), function(node) {
     var id = node.id;
     ok(!(id in ids), id + " should be unique");
     ids[id] = null;
   });
 }
--- a/browser/base/content/test/general/browser_fullscreen-window-open.js
+++ b/browser/base/content/test/general/browser_fullscreen-window-open.js
@@ -6,25 +6,25 @@ var Ci = Components.interfaces;
 
 const PREF_DISABLE_OPEN_NEW_WINDOW = "browser.link.open_newwindow.disabled_in_fullscreen";
 const isOSX = (Services.appinfo.OS === "Darwin");
 
 const TEST_FILE = "file_fullscreen-window-open.html";
 const gHttpTestRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content/",
                                                           "http://127.0.0.1:8888/");
 
-function test () {
+function test() {
   waitForExplicitFinish();
 
   Services.prefs.setBoolPref(PREF_DISABLE_OPEN_NEW_WINDOW, true);
 
   let newTab = gBrowser.addTab(gHttpTestRoot + TEST_FILE);
   gBrowser.selectedTab = newTab;
 
-  whenTabLoaded(newTab, function () {
+  whenTabLoaded(newTab, function() {
     // Enter browser fullscreen mode.
     BrowserFullScreen();
 
     runNextTest();
   });
 }
 
 registerCleanupFunction(function() {
@@ -43,17 +43,17 @@ var gTests = [
   test_open_with_outerSize,
   test_open_with_innerSize,
   test_open_with_dialog,
   test_open_when_open_new_window_by_pref,
   test_open_with_pref_to_disable_in_fullscreen,
   test_open_from_chrome,
 ];
 
-function runNextTest () {
+function runNextTest() {
   let testCase = gTests.shift();
   if (testCase) {
     executeSoon(testCase);
   }
   else {
     finish();
   }
 }
@@ -61,128 +61,128 @@ function runNextTest () {
 
 // Test for window.open() with no feature.
 function test_open() {
   waitForTabOpen({
     message: {
       title: "test_open",
       param: "",
     },
-    finalizeFn: function () {},
+    finalizeFn: function() {},
   });
 }
 
 // Test for window.open() with width/height.
 function test_open_with_size() {
   waitForTabOpen({
     message: {
       title: "test_open_with_size",
       param: "width=400,height=400",
     },
-    finalizeFn: function () {},
+    finalizeFn: function() {},
   });
 }
 
 // Test for window.open() with top/left.
 function test_open_with_pos() {
   waitForTabOpen({
     message: {
       title: "test_open_with_pos",
       param: "top=200,left=200",
     },
-    finalizeFn: function () {},
+    finalizeFn: function() {},
   });
 }
 
 // Test for window.open() with outerWidth/Height.
 function test_open_with_outerSize() {
   let [outerWidth, outerHeight] = [window.outerWidth, window.outerHeight];
   waitForTabOpen({