If custom file handler is set to Zotero itself, use reader (#5407)
This commit is contained in:
parent
176d8d7328
commit
c10bb6f318
1 changed files with 16 additions and 0 deletions
|
@ -274,6 +274,22 @@ Zotero_Preferences.General = {
|
||||||
|
|
||||||
setFileHandler: function (type, handler) {
|
setFileHandler: function (type, handler) {
|
||||||
var pref = this._getFileHandlerPref(type);
|
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);
|
Zotero.Prefs.set(pref, handler);
|
||||||
this._updateFileHandlerUI();
|
this._updateFileHandlerUI();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue