www

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

commit 78a79abfab57bb64a3a5f69129b6f33008ee7675
parent b4aa23fc0e81d85a1d7bd1b9c362ce37f259fc84
Author: Simon Kornblith <simon@simonster.com>
Date:   Mon, 19 Dec 2011 23:11:19 -0500

Fix ISBN lookup on branch

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

diff --git a/chrome/content/zotero/xpcom/utilities_translate.js b/chrome/content/zotero/xpcom/utilities_translate.js @@ -226,14 +226,27 @@ Zotero.Utilities.Translate.prototype.processDocuments = function(urls, processor } } - var translate = this._translate; - var loc = translate.document.location; + if(Zotero.isFx) { + var translate = this._translate; + if(translate.document) { + var protocol = translate.document.location.protocol, + host = translate.document.location.host; + } else { + var url = Components.classes["@mozilla.org/network/io-service;1"] + .getService(Components.interfaces.nsIIOService) + .newURI(typeof translate._sandboxLocation === "object" ? + translate._sandboxLocation.location : translate._sandboxLocation, null, null), + protocol = url.scheme+":", + host = url.host; + } + } + translate.incrementAsyncProcesses("Zotero.Utilities.Translate#processDocuments"); var hiddenBrowser = Zotero.HTTP.processDocuments(urls, function(doc) { if(!processor) return; var newLoc = doc.location; - if(Zotero.isFx && (loc.protocol !== newLoc.protocol || loc.host !== newLoc.host)) { + if(Zotero.isFx && (protocol != newLoc.protocol || host != newLoc.host)) { // Cross-site; need to wrap processor(Zotero.Translate.SandboxManager.Fx5DOMWrapper(doc), newLoc.toString()); } else {