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

This commit is contained in:
CezaryKulakowski 2020-09-28 22:36:45 +02:00 committed by GitHub
parent ac25f4d2ff
commit b85195ee5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 33 deletions

View file

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