diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 11e051bab..fd785c2fe 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1960,6 +1960,8 @@ Zotero.Translate.Web.prototype.setDocument = function(doc) { this.rootDocument = doc.defaultView.top.document; } catch (e) { // Cross-origin frames won't be able to access top.document and will throw an error + } + if (!this.rootDocument) { this.rootDocument = doc; } this.setLocation(doc.location.href, this.rootDocument.location.href);