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.
This commit is contained in:
Abe Jellinek 2025-07-02 10:29:31 -04:00
parent 2e0a10f732
commit 41f8c8e399

View file

@ -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'