diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index a49269f3b2..2ba8b8ab4b 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -2106,6 +2106,20 @@ Zotero.Prefs = new function(){ } + this.resetBranch = function (exclude = []) { + var keys = this.prefBranch.getChildList("", {}); + for (let key of keys) { + if (this.prefBranch.prefHasUserValue(key)) { + if (exclude.includes(key)) { + continue; + } + Zotero.debug("Clearing " + key); + this.prefBranch.clearUserPref(key); + } + } + }; + + // Import settings bundles this.importSettings = function (str, uri) { var ps = Services.prompt;