From b23723ecf3b1f93a8da6de2ae1a4005b50b06e9f Mon Sep 17 00:00:00 2001 From: rhysd Date: Mon, 17 Apr 2017 14:56:50 +0900 Subject: [PATCH] delay showing a window until DOM is ready --- main/app.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/app.ts b/main/app.ts index d2d213a..175924c 100644 --- a/main/app.ts +++ b/main/app.ts @@ -21,6 +21,9 @@ export class App { } open() { + this.win.webContents.on('dom-ready', () => { + this.win.show(); + }); this.win.loadURL(`https://${this.account.host}${this.account.default_page}`); this.win.webContents.on('will-navigate', (e, url) => { if (!url.startsWith(`https://${this.account.host}`)) { @@ -49,7 +52,6 @@ export class App { callback(granted); }); }); - this.win.show(); } }