FileHandlers: Don't await long-running exec() on Windows/Linux

We can await /usr/bin/open on macOS because it returns as soon as the
application has begun launching, but we can't await when we exec a
program directly on other platforms.

Fixes #3799
This commit is contained in:
Abe Jellinek 2024-03-06 14:03:17 -05:00
parent ba86e9b4c9
commit 1ca23fedb2

View file

@ -276,7 +276,7 @@ Zotero.FileHandlers = {
// PDF-XChange: http://help.tracker-software.com/eu/default.aspx?pageid=PDFXView25:command_line_options // PDF-XChange: http://help.tracker-software.com/eu/default.aspx?pageid=PDFXView25:command_line_options
args.unshift('/A', 'page=' + page); args.unshift('/A', 'page=' + page);
} }
await Zotero.Utilities.Internal.exec(appPath, args); Zotero.Utilities.Internal.exec(appPath, args);
} }
} }
], ],
@ -291,7 +291,7 @@ Zotero.FileHandlers = {
if (location?.position?.value) { if (location?.position?.value) {
args.push('--open-at=' + location.position.value); args.push('--open-at=' + location.position.value);
} }
await Zotero.Utilities.Internal.exec(appPath, args); Zotero.Utilities.Internal.exec(appPath, args);
} }
} }
] ]
@ -331,7 +331,7 @@ Zotero.FileHandlers = {
if (page !== undefined) { if (page !== undefined) {
args.unshift('-p', page); args.unshift('-p', page);
} }
await Zotero.Utilities.Internal.exec(appPath, args); Zotero.Utilities.Internal.exec(appPath, args);
} }
} }
], ],
@ -346,7 +346,7 @@ Zotero.FileHandlers = {
if (location?.position?.value) { if (location?.position?.value) {
args.push('--open-at=' + location.position.value); args.push('--open-at=' + location.position.value);
} }
await Zotero.Utilities.Internal.exec(appPath, args); Zotero.Utilities.Internal.exec(appPath, args);
} }
} }
] ]