diff --git a/chrome/content/zotero/xpcom/proxy.js b/chrome/content/zotero/xpcom/proxy.js index 59020b084f..0d57a27c49 100644 --- a/chrome/content/zotero/xpcom/proxy.js +++ b/chrome/content/zotero/xpcom/proxy.js @@ -138,8 +138,13 @@ Zotero.Proxies = new function() { * @type String */ this.proxyToProper = function(url, onlyReturnIfProxied) { - // make sure url has a trailing slash - url = new URL(url).href; + // make sure url has a trailing slash + if (typeof URL === 'undefined') { + url = new (Services.wm.getMostRecentWindow("navigator:browser")).URL(url).href; + } + else { + url = new URL(url).href; + } for (let proxy of Zotero.Proxies.proxies) { if(proxy.regexp) { var m = proxy.regexp.exec(url); @@ -179,10 +184,13 @@ Zotero.Proxies = new function() { * @returns {Object} Unproxied url to proxy object */ this.getPotentialProxies = function(url) { - try { - // make sure url has a trailing slash + // make sure url has a trailing slash + if (typeof URL === 'undefined') { + url = new (Services.wm.getMostRecentWindow("navigator:browser")).URL(url).href; + } + else { url = new URL(url).href; - } catch (e) { } + } var urlToProxy = {}; // If it's a known proxied URL just return it if (Zotero.Proxies.transparent) {