From 5c7b4019d9d6498e41cb76dbbdfd9e768e3cb3e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Tue, 28 Aug 2018 15:03:08 +0300 Subject: [PATCH] Ensure Services.jsm shorthands are used in translate_item.js --- .../content/zotero/xpcom/translation/translate_item.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translate_item.js b/chrome/content/zotero/xpcom/translation/translate_item.js index 21831df6a8..b090f89afa 100644 --- a/chrome/content/zotero/xpcom/translation/translate_item.js +++ b/chrome/content/zotero/xpcom/translation/translate_item.js @@ -64,8 +64,7 @@ Zotero.Translate.ItemSaver = function(options) { } else { // try to convert to a URI try { - this._baseURI = Components.classes["@mozilla.org/network/io-service;1"]. - getService(Components.interfaces.nsIIOService).newURI(options.baseURI, null, null); + this._baseURI = Services.io.newURI(options.baseURI, null, null); } catch(e) {}; } this._saveOptions = options.saveOptions || {}; @@ -581,8 +580,7 @@ Zotero.Translate.ItemSaver.prototype = { } attachment.url = url; - url = Components.classes["@mozilla.org/network/io-service;1"] - .getService(Components.interfaces.nsIIOService) + url = Services.io .newURI(url, null, null); // This cannot fail, since we check above // see if this is actually a file URL @@ -791,8 +789,7 @@ Zotero.Translate.ItemSaver.prototype = { if (!cleanURI) { throw new Error("Translate: Invalid attachment URL specified <" + url + ">"); } - url = Components.classes["@mozilla.org/network/io-service;1"] - .getService(Components.interfaces.nsIIOService) + url = Services.io .newURI(cleanURI, null, null); // This cannot fail, since we check above // Only HTTP/HTTPS links are allowed