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
if (uri.startsWith('zotero:')) {
let nsIURI = Services.io.newURI(uri, null, null);
let handler = Components.classes["@mozilla.org/network/protocol;1?name=zotero"]
.getService();
let extension = handler.wrappedJSObject.getExtension(nsIURI);
let handler = Services.io.getProtocolHandler("zotero").wrappedJSObject;
let extension = handler.getExtension(nsIURI);
if (extension.noContent) {
extension.doAction(nsIURI);
return;