From 87decd0f8df4a68c63783a5ebc84211f0baf28d5 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Tue, 24 May 2022 12:07:30 -0600 Subject: [PATCH] fx-compat: Fix _getExtensionFromURL() --- chrome/content/zotero/xpcom/attachments.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index c8ae27a311..09fcfe2847 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -2842,9 +2842,8 @@ Zotero.Attachments = new function(){ this._getExtensionFromURL = function(url, contentType) { - var nsIURL = Components.classes["@mozilla.org/network/standard-url;1"] - .createInstance(Components.interfaces.nsIURL); - nsIURL.spec = url; + var nsIURL = Services.io.newURI(url) + .QueryInterface(Ci.nsIURL); return Zotero.MIME.getPrimaryExtension(contentType, nsIURL.fileExtension); }