From 41f8c8e399d4a5ee8f53422c82e56643d711274c Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Wed, 2 Jul 2025 10:29:31 -0400 Subject: [PATCH] Fix ZoteroProtocolHandler URI parsing nsIURI#pathQueryRef no longer includes the authority component. A URI that would've had pathQueryRef '//authority/path' before will now have pathQueryRef '/path'. Reader seems to be functional after this change. --- chrome/content/zotero/ZoteroProtocolHandler.mjs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/ZoteroProtocolHandler.mjs b/chrome/content/zotero/ZoteroProtocolHandler.mjs index a2e6d9ef67..9c207b5fd0 100644 --- a/chrome/content/zotero/ZoteroProtocolHandler.mjs +++ b/chrome/content/zotero/ZoteroProtocolHandler.mjs @@ -69,7 +69,7 @@ export function ZoteroProtocolHandler() { if (!uriPath) { return this._errorChannel('Invalid URL'); } - uriPath = uriPath.substr('//attachment/'.length); + uriPath = uriPath.substring(1); var params = {}; var router = new Zotero.Router(params); @@ -185,7 +185,7 @@ export function ZoteroProtocolHandler() { if (!path) { return 'Invalid URL'; } - path = path.substr('//report/'.length); + path = path.substring(1); // Proxy CSS files if (path.endsWith('.css')) { @@ -823,8 +823,7 @@ export function ZoteroProtocolHandler() { if (!path) { return 'Invalid URL'; } - path = path.substr('//select/'.length); - var mimeType, content = ''; + path = path.substring(1); var params = { objectType: 'item' @@ -1049,7 +1048,7 @@ export function ZoteroProtocolHandler() { if (!uriPath) { return 'Invalid URL'; } - uriPath = uriPath.replace(/^\/\/open(-pdf)?\//, ''); + uriPath = uriPath.substring(1); var params = { objectType: 'item'