fix: ensure ready-to-show event is fired (#25932)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
This commit is contained in:
Shelley Vohr
2020-10-14 18:02:36 -07:00
committed by GitHub
parent ccaea19e32
commit 13722f83e3
9 changed files with 31 additions and 34 deletions

View File

@@ -605,6 +605,15 @@ WebContents.prototype._init = function () {
app.emit('login', event, this, ...args);
});
this.on('ready-to-show', () => {
const owner = this.getOwnerBrowserWindow();
if (owner && !owner.isDestroyed()) {
process.nextTick(() => {
owner.emit('ready-to-show');
});
}
});
const event = process.electronBinding('event').createEmpty();
app.emit('web-contents-created', event, this);