Fix code for determining whether to use defaultView as sandbox scope

This commit is contained in:
Simon Kornblith 2013-01-28 15:58:35 -05:00
parent 0417a1910d
commit a0f1bbf8a6

View file

@ -1584,7 +1584,9 @@ Zotero.Translate.Web.prototype._getTranslatorsGetPotentialTranslators = function
Zotero.Translate.Web.prototype._getSandboxLocation = function() { Zotero.Translate.Web.prototype._getSandboxLocation = function() {
if(this._parentTranslator) { if(this._parentTranslator) {
return this._parentTranslator._sandboxLocation; return this._parentTranslator._sandboxLocation;
} else if(this.document.defaultView && this.document.defaultView.toString() === "[object Window]") { } else if(this.document.defaultView
&& (this.document.defaultView.toString().indexOf("Window") !== -1
|| this.document.defaultView.toString().indexOf("XrayWrapper") !== -1)) {
return this.document.defaultView; return this.document.defaultView;
} else { } else {
return this.document.location.toString(); return this.document.location.toString();