diff --git a/chrome/content/zotero/preferences/preferences_general.js b/chrome/content/zotero/preferences/preferences_general.js index 029aa91f94..a9f7795540 100644 --- a/chrome/content/zotero/preferences/preferences_general.js +++ b/chrome/content/zotero/preferences/preferences_general.js @@ -274,6 +274,22 @@ Zotero_Preferences.General = { setFileHandler: function (type, handler) { var pref = this._getFileHandlerPref(type); + + var isZotero = false; + if (Zotero.isMac) { + isZotero = /Zotero.*\.app/.test(handler); + } + else if (Zotero.isWindows) { + isZotero = handler.endsWith('\\zotero.exe'); + } + else if (Zotero.isLinux) { + isZotero = handler.endsWith('/zotero'); + } + // Reset to the internal reader if pointing to Zotero + if (isZotero) { + handler = ''; + } + Zotero.Prefs.set(pref, handler); this._updateFileHandlerUI(); },