parent
1106685f2d
commit
dfdc66a41c
1 changed files with 13 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue