From 654f9c205dbf17faf0ca100497d46bc09c9cd969 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 11 Dec 2006 16:12:12 +0000 Subject: [PATCH] attempt to be better about preserving EZProxy URL. unfortunately, this won't fix everything, since if the domain of the saved URL is different from the domain of the accessed URL, there is no way to map the proxy. as far as I know, this only happens with JSTOR (where the stable URL domain is links.jstor.org instead of jstor.org). --- chrome/content/zotero/xpcom/translate.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/translate.js b/chrome/content/zotero/xpcom/translate.js index 3640829ece..b0f6e4804e 100644 --- a/chrome/content/zotero/xpcom/translate.js +++ b/chrome/content/zotero/xpcom/translate.js @@ -91,9 +91,9 @@ * _exportFileDirectory - the directory to which files will be exported * _hasBOM - whether the given file ready to be imported has a BOM or not * - * WEB-ONLY PRIVATE PROPERTIES: + * WEB-ONLY PROPERTIES: * - * _locationIsProxied - whether the URL being scraped is going through + * locationIsProxied - whether the URL being scraped is going through * an EZProxy * _downloadAssociatedFiles - whether to download content, according to * preferences @@ -1081,6 +1081,12 @@ Zotero.Translate.prototype._itemDone = function(item, attachedTo) { throw("item has no title"); } + // if item was accessed through a proxy, ensure that the proxy + // address remains in the accessed version + if(this.locationIsProxied && item.url) { + item.url = Zotero.Ingester.ProxyMonitor.properToProxy(item.url); + } + // create new item if(type == "attachment") { if(this.type != "import") { @@ -1089,7 +1095,6 @@ Zotero.Translate.prototype._itemDone = function(item, attachedTo) { } Zotero.debug("adding attachment"); - Zotero.debug(item); if(!item.path) { // create from URL