Fix NS_ERROR_ILLEGAL_VALUE when passing a wrapped DOM document to a translator

This commit is contained in:
Simon Kornblith 2012-03-05 23:14:55 -05:00
parent 42cd7752af
commit 36cfad3933

View File

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