commit 36cfad3933ea4f4bf1947b7369c226f6a9b479b0 parent 42cd7752affcd0fd63184e4af7b8df4ed3e35532 Author: Simon Kornblith <simon@simonster.com> Date: Mon, 5 Mar 2012 23:14:55 -0500 Fix NS_ERROR_ILLEGAL_VALUE when passing a wrapped DOM document to a translator Diffstat:
| M | 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 @@ -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(); + } } /**