Make sure rootDocument is set in Zotero.Translate.Web.setDocument()
For non-browser documents that we wrap, defaultView.top.document can be
undefined without being inaccessible.
Fixes regression from dae0986b9b
This commit is contained in:
parent
871cbae499
commit
de36a6e833
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue