Bug 1447879 - Cannot customize about:preferences#home content when sync or preference searching is disabled. r?k88hudson
Have the home preferences page notify when it loads instead of relying on findInPage to trigger sync pane to init.
MozReview-Commit-ID: EJlJDfYBHFO
--- 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: {