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(); + } } /**