Bug 1447879 - Cannot customize about:preferences#home content when sync or preference searching is disabled. r=k88hudson, a=RyanVM
authorEd Lee <edilee@mozilla.com>
Wed, 30 May 2018 17:32:44 -0700
changeset 471307 7e89c803d7da
parent 471306 27f04b430755
child 471308 c1e1ada55d72
push id9364
push userryanvm@gmail.com
push dateWed, 13 Jun 2018 23:32:57 +0000
treeherdermozilla-beta@91934961833a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersk88hudson, RyanVM
bugs1447879
milestone61.0
Bug 1447879 - Cannot customize about:preferences#home content when sync or preference searching is disabled. r=k88hudson, a=RyanVM Have the home preferences page notify when it loads instead of relying on findInPage to trigger sync pane to init. MozReview-Commit-ID: EJlJDfYBHFO
browser/components/preferences/in-content/home.js
browser/extensions/activity-stream/lib/AboutPreferences.jsm
--- a/browser/components/preferences/in-content/home.js
+++ b/browser/components/preferences/in-content/home.js
@@ -367,10 +367,13 @@ let gHomePane = {
     window.addEventListener("focus", this._updateUseCurrentButton.bind(this));
 
     // Extension/override-related events
     this.watchNewTab();
     document.getElementById("disableHomePageExtension").addEventListener("command",
       makeDisableControllingExtension(PREF_SETTING_TYPE, HOMEPAGE_OVERRIDE_KEY));
     document.getElementById("disableNewTabExtension").addEventListener("command",
       makeDisableControllingExtension(URL_OVERRIDES_TYPE, NEW_TAB_KEY));
+
+    // Notify observers that the UI is now ready
+    Services.obs.notifyObservers(window, "home-pane-loaded");
   }
 };
--- a/browser/extensions/activity-stream/lib/AboutPreferences.jsm
+++ b/browser/extensions/activity-stream/lib/AboutPreferences.jsm
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 Cu.importGlobalProperties(["fetch"]);
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.defineModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm");
 const {actionTypes: at} = ChromeUtils.import("resource://activity-stream/common/Actions.jsm", {});
 
-const PREFERENCES_LOADED_EVENT = "sync-pane-loaded";
+const PREFERENCES_LOADED_EVENT = "home-pane-loaded";
 const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
 // These "section" objects are formatted in a way to be similar to the ones from
 // SectionsManager to construct the preferences view.
 const PREFS_BEFORE_SECTIONS = [
   {
     id: "search",
     pref: {