From 71550deb98826b4d593c98ad19cf6fd7377601a4 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 5 Oct 2020 23:38:28 -0400 Subject: [PATCH] Fix URL resolving during translation in Zotero client Regression in c0b6712923 The URL constructor isn't available in XPCOM. --- chrome/content/zotero/xpcom/translation/translate.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 565b93c2a5..cdec61e735 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1396,7 +1396,12 @@ Zotero.Translate.Base.prototype = { resolved; if (!m) { if (this.location) { - resolved = new URL(url, this.location).toString(); + if (Zotero.isFx) { + resolved = Services.io.newURI(this.location, "", null).resolve(url); + } + else { + resolved = new URL(url, this.location).toString(); + } } else if (url.startsWith('//')) { // Use HTTPS by default for protocol-relative URL with no associated web page