Fix zotero://open-pdf links on Windows if no handler is set in registry
This commit is contained in:
parent
c81ac1f642
commit
2a804d5d4a
2 changed files with 30 additions and 25 deletions
|
@ -1036,24 +1036,19 @@ function ZoteroProtocolHandler() {
|
|||
return;
|
||||
}
|
||||
|
||||
// If no page number, just open normally
|
||||
if (!page) {
|
||||
let zp = Zotero.getActiveZoteroPane();
|
||||
// TODO: Open pane if closed (macOS)
|
||||
if (zp) {
|
||||
zp.viewAttachment([item.id]);
|
||||
var opened = false;
|
||||
if (page) {
|
||||
try {
|
||||
opened = await Zotero.OpenPDF.openToPage(path, page);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
var opened = Zotero.OpenPDF.openToPage(path, page);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
}
|
||||
// If something went wrong, just open PDF without page
|
||||
if (!opened) {
|
||||
Zotero.debug("Launching PDF without page number");
|
||||
let zp = Zotero.getActiveZoteroPane();
|
||||
// TODO: Open pane if closed (macOS)
|
||||
if (zp) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue