Fix URL resolving during translation in Zotero client

Regression in c0b6712923

The URL constructor isn't available in XPCOM.
This commit is contained in:
Dan Stillman 2020-10-05 23:38:28 -04:00
parent d3c481fcf6
commit 71550deb98

View file

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