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);
```
This commit is contained in:
Dan Stillman 2022-06-20 01:12:57 -04:00
parent 30f636274b
commit b3077182d2

View file

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