Fix ZoteroPane#loadURI with zotero: URLs (#3904)

This commit is contained in:
windingwind 2024-04-02 04:58:55 +08:00 committed by GitHub
parent a78d1c3876
commit 29c0460930
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3981,9 +3981,8 @@ var ZoteroPane = new function()
// Handle no-content zotero: URLs (e.g., zotero://select) without opening viewer // Handle no-content zotero: URLs (e.g., zotero://select) without opening viewer
if (uri.startsWith('zotero:')) { if (uri.startsWith('zotero:')) {
let nsIURI = Services.io.newURI(uri, null, null); let nsIURI = Services.io.newURI(uri, null, null);
let handler = Components.classes["@mozilla.org/network/protocol;1?name=zotero"] let handler = Services.io.getProtocolHandler("zotero").wrappedJSObject;
.getService(); let extension = handler.getExtension(nsIURI);
let extension = handler.wrappedJSObject.getExtension(nsIURI);
if (extension.noContent) { if (extension.noContent) {
extension.doAction(nsIURI); extension.doAction(nsIURI);
return; return;