From 76b7fd0dc129b7357f9d016744ff5acfdfe63a7b Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Thu, 25 May 2023 17:28:16 +0300 Subject: [PATCH] Set preventDefault flag when URL is passed to CLH Fixes #3132 --- components/zotero-service.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/zotero-service.js b/components/zotero-service.js index ae0ccc6d67..43585a40cf 100644 --- a/components/zotero-service.js +++ b/components/zotero-service.js @@ -535,11 +535,13 @@ ZoteroCommandLineHandler.prototype = { if(isStandalone()) { var fileToOpen; - // Special handler for "zotero" URIs at the command line to prevent them from opening a new window + // Handle zotero:// and file URIs and prevent them from opening a new window var param = cmdLine.handleFlagWithParam("url", false); if (param) { + cmdLine.preventDefault = true; + var uri = cmdLine.resolveURI(param); - if(uri.schemeIs("zotero")) { + if (uri.schemeIs("zotero")) { addInitCallback(function (Zotero) { Zotero.uiReadyPromise .then(function () {