From 735922a2bfcbc8eff4df5a7b0586e3ce05857ad4 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Thu, 24 Jul 2025 12:07:27 -0400 Subject: [PATCH] If custom file handler is set to Zotero itself, use reader (#5407) --- .../zotero/preferences/preferences_general.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/chrome/content/zotero/preferences/preferences_general.js b/chrome/content/zotero/preferences/preferences_general.js index 95bdad67b9..f6d57a5092 100644 --- a/chrome/content/zotero/preferences/preferences_general.js +++ b/chrome/content/zotero/preferences/preferences_general.js @@ -273,6 +273,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(); },