Bug 1106926 - Insuring that removing a hidden one click search provider also removes it from the browser.search.hiddenOneOffs pref. r=florian
This commit is contained in:
@@ -413,6 +413,18 @@ BrowserGlue.prototype = {
|
||||
#endif
|
||||
break;
|
||||
case "browser-search-engine-modified":
|
||||
// Ensure we cleanup the hiddenOneOffs pref when removing
|
||||
// an engine, and that newly added engines are visible.
|
||||
if (data == "engine-added" || data == "engine-removed") {
|
||||
let engineName = subject.QueryInterface(Ci.nsISearchEngine).name;
|
||||
let hiddenPref =
|
||||
Services.prefs.getCharPref("browser.search.hiddenOneOffs");
|
||||
let hiddenEngines = hiddenPref ? hiddenPref.split(",") : [];
|
||||
hiddenEngines = hiddenEngines.filter(x => x !== engineName);
|
||||
Services.prefs.setCharPref("browser.search.hiddenOneOffs",
|
||||
hiddenEngines.join(","));
|
||||
}
|
||||
|
||||
if (data != "engine-default" && data != "engine-current") {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user