If custom file handler is set to Zotero itself, use reader (#5407)

This commit is contained in:
Abe Jellinek 2025-07-24 12:07:27 -04:00 • committed by GitHub
parent 27affb9f14
commit 735922a2bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();
},