diff --git a/browser/components/preferences/in-content/search.js b/browser/components/preferences/in-content/search.js index f25f65c48ba5..9c96b8b906c2 100644 --- a/browser/components/preferences/in-content/search.js +++ b/browser/components/preferences/in-content/search.js @@ -10,19 +10,21 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task", const ENGINE_FLAVOR = "text/x-moz-search-engine"; +document.addEventListener("Initialized", () => { + if (Services.prefs.getBoolPref("browser.search.showOneOffButtons")) + return; + + document.getElementById("category-search").hidden = true; + if (document.location.hash == "#search") + document.location.hash = ""; +}); + var gEngineView = null; var gSearchPane = { init: function () { - if (!Services.prefs.getBoolPref("browser.search.showOneOffButtons")) { - document.getElementById("category-search").hidden = true; - if (document.location.hash == "#search") - document.location.hash = ""; - return; - } - gEngineView = new EngineView(new EngineStore()); document.getElementById("engineList").view = gEngineView; this.buildDefaultEngineDropDown();