diff --git a/chrome/content/zotero/xpcom/fileHandlers.js b/chrome/content/zotero/xpcom/fileHandlers.js index 5a9bc2834b..77fa7483af 100644 --- a/chrome/content/zotero/xpcom/fileHandlers.js +++ b/chrome/content/zotero/xpcom/fileHandlers.js @@ -283,7 +283,18 @@ Zotero.FileHandlers = { _handlersWin: { pdf: [ { - name: new RegExp(''), // Match any handler + name: /chrome\.exe|msedge\.exe|firefox\.exe/i, + async open(appPath, { filePath, page }) { + let args = [Zotero.File.pathToFileURI(filePath)]; + if (page !== undefined) { + // Chrome/Edge/Firefox uses URL fragment for page number + args[0] += '#page=' + page; + } + await Zotero.FileHandlers._checkAndExecWithoutBlocking(appPath, args); + } + }, + { + name: new RegExp(''), // Fallback for other handlers async open(appPath, { filePath, page }) { let args = [filePath]; if (page !== undefined) {