From a0f1bbf8a674ed30d097c311df520ed34cabd67b Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 28 Jan 2013 15:58:35 -0500 Subject: [PATCH] Fix code for determining whether to use defaultView as sandbox scope --- chrome/content/zotero/xpcom/translation/translate.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 06d4791b2..634fce39f 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1584,7 +1584,9 @@ Zotero.Translate.Web.prototype._getTranslatorsGetPotentialTranslators = function Zotero.Translate.Web.prototype._getSandboxLocation = function() { if(this._parentTranslator) { 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; } else { return this.document.location.toString();