Use Services.io getter

This commit is contained in:
Sylvester Keil 2018-08-02 23:05:17 +02:00
parent dc688a876f
commit 6fd25419a9
No known key found for this signature in database
GPG key ID: 878933BCEAB25A10

View file

@ -164,11 +164,9 @@ Zotero.QuickCopy = new function() {
return quickCopyPref;
}
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var nsIURI;
try {
nsIURI = ioService.newURI(url, null, null);
nsIURI = Services.io.newURI(url, null, null);
// Accessing some properties may throw for URIs that do not support those
// parts. E.g. hostPort throws NS_ERROR_FAILURE for about:blank
var urlHostPort = nsIURI.hostPort;