www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit da2dedf7affd75b0f79c258b496bbc5ccbf794f2
parent d1de8b751a3b6594d18de404d18c461669a5cf0b
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 16 Aug 2017 17:58:59 +0200

Use passed URL rather than doc.location in translator processDocuments

Outside of page contexts (e.g., from an XHR with responseType =
'document'), document.location is null.

Diffstat:
Mchrome/content/zotero/xpcom/utilities_translate.js | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/chrome/content/zotero/xpcom/utilities_translate.js b/chrome/content/zotero/xpcom/utilities_translate.js @@ -279,7 +279,7 @@ Zotero.Utilities.Translate.prototype.processDocuments = function(urls, processor } translate.incrementAsyncProcesses("Zotero.Utilities.Translate#processDocuments"); - var hiddenBrowser = Zotero.HTTP.processDocuments(urls, function(doc) { + var hiddenBrowser = Zotero.HTTP.processDocuments(urls, function (doc, url) { if(!processor) return; var newLoc = doc.location; @@ -289,10 +289,10 @@ Zotero.Utilities.Translate.prototype.processDocuments = function(urls, processor // DEBUG: Is there a better fix for this? || Zotero.isServer) { // Cross-site; need to wrap - processor(translate._sandboxManager.wrap(doc), newLoc.toString()); + processor(translate._sandboxManager.wrap(doc), url); } else { // Not cross-site; no need to wrap - processor(doc, newLoc.toString()); + processor(doc, url); } }, function() {