From b3077182d2b42cc9dd74d88f62ca0b63083fdf45 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 20 Jun 2022 01:12:57 -0400 Subject: [PATCH] fx-compat: Fix Zotero.MIME.getMIMETypeFromURL() Replace ``` Components.classes["@mozilla.org/network/standard-url;1"] .createInstance(Components.interfaces.nsIURL) ``` with ``` Services.io.newURI(url).QueryInterface(Ci.nsIURL); ``` --- chrome/content/zotero/xpcom/mime.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/mime.js b/chrome/content/zotero/xpcom/mime.js index 2c767fda7c..0800c20ca4 100644 --- a/chrome/content/zotero/xpcom/mime.js +++ b/chrome/content/zotero/xpcom/mime.js @@ -344,9 +344,7 @@ Zotero.MIME = new function(){ var mimeType = xmlhttp.channel.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); // Override MIME type to application/pdf if extension is .pdf -- // workaround for sites that respond to the HEAD request with an