Bug 1352505 - Fix enabling the 'Restore Default Search Engines' button when removing a default engine. r?gijs
Re-apply the patch from
bug 1327953 since it got lost in the re-arrangement of preference code in
bug 1335907.
MozReview-Commit-ID: 1L4A2QC3Bns
--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
@@ -1071,19 +1071,19 @@ EngineStore.prototype = {
}
let engineName = aEngine.name;
let index = this._engines.findIndex(element => element.name == engineName);
if (index == -1)
throw new Error("invalid engine?");
- this._engines.splice(index, 1);
+ let removedEngine = this._engines.splice(index, 1)[0];
- if (this._defaultEngines.some(this._isSameEngine, this._engines[index]))
+ if (this._defaultEngines.some(this._isSameEngine, removedEngine))
gMainPane.showRestoreDefaults(true);
gMainPane.buildDefaultEngineDropDown();
return index;
},
restoreDefaultEngines() {
var added = 0;