From 36cfad3933ea4f4bf1947b7369c226f6a9b479b0 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 5 Mar 2012 23:14:55 -0500 Subject: [PATCH] Fix NS_ERROR_ILLEGAL_VALUE when passing a wrapped DOM document to a translator --- chrome/content/zotero/xpcom/translation/translate.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 6653270e2..c052ca6e9 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1425,7 +1425,16 @@ Zotero.Translate.Web.prototype._getTranslatorsGetPotentialTranslators = function * Bind sandbox to document being translated */ Zotero.Translate.Web.prototype._getSandboxLocation = function() { - return ("defaultView" in this.document ? this.document.defaultView : this.document.location.toString()); + if("defaultView" in this.document) { + var defaultView = this.document.defaultView; + if("__wrappedDOMObject" in defaultView) { + return defaultView.__wrappedDOMObject; + } else { + return defaultView; + } + } else { + return this.document.location.toString(); + } } /**