Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Ensure webview is ready before calling setActive
Browse files Browse the repository at this point in the history
Fix #2037

Auditors: @bbondy
  • Loading branch information
diracdeltas committed Jun 2, 2016
1 parent bb4de1f commit c515e72
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,12 @@ class Frame extends ImmutableComponent {
if (this.shouldCreateWebview() || this.props.frame.get('src') !== prevProps.frame.get('src')) {
this.updateWebview(cb)
} else {
cb()
try {
cb()
} catch (e) {
// webview DOM may not be ready yet
this.webview.addEventListener('dom-ready', cb)
}
}
}

Expand Down

1 comment on commit c515e72

@bridiver
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change may be problematic. I changed from dom-ready to did-attach which should have been fine, but I want to look at this more carefully because waiting for dom-ready causes other problems.

Please sign in to comment.