diff --git a/chrome/content/zotero/xpcom/connector/translator.js b/chrome/content/zotero/xpcom/connector/translator.js index 56acb305f..7c90db0d9 100644 --- a/chrome/content/zotero/xpcom/connector/translator.js +++ b/chrome/content/zotero/xpcom/connector/translator.js @@ -141,66 +141,47 @@ Zotero.Translators = new function() { * @return {Promise} - A promise for a 2-item array containing an array of translators and * an array of functions for converting URLs from proper to proxied forms */ - this.getWebTranslatorsForLocation = Zotero.Promise.method(function (uri) { + this.getWebTranslatorsForLocation = Zotero.Promise.method(function (URI, rootURI) { + var isFrame = URI !== rootURI; if(!_initialized) Zotero.Translators.init(); var allTranslators = _cache["web"]; var potentialTranslators = []; - var searchURIs = [uri]; - - Zotero.debug("Translators: Looking for translators for "+uri); - - // if there is a subdomain that is also a TLD, also test against URI with the domain - // dropped after the TLD - // (i.e., www.nature.com.mutex.gmu.edu => www.nature.com) - var m = /^(https?:\/\/)([^\/]+)/i.exec(uri); - var properHosts = []; - var proxyHosts = []; - if(m) { - // First, drop the 0- if it exists (this is an III invention) - var host = m[2]; - if(host.substr(0, 2) === "0-") host = host.substr(2); - var hostnames = host.split("."); - for(var i=1; i www.nature.com) + var m = /^(https?:\/\/)([^\/]+)/i.exec(URI); + if (m) { + // First, drop the 0- if it exists (this is an III invention) + var host = m[2]; + if(host.substr(0, 2) === "0-") host = host.substr(2); + var hostnames = host.split("."); + for (var i=1; i