remove page-title-updated workaround for #3380
This commit is contained in:
parent
e4524ce42e
commit
5e976be43b
4 changed files with 8 additions and 16 deletions
|
@ -76,13 +76,9 @@ BrowserWindow.prototype._init = function () {
|
|||
|
||||
// Change window title to page title.
|
||||
this.webContents.on('page-title-updated', (event, title) => {
|
||||
// The page-title-updated event is not emitted immediately (see #3645), so
|
||||
// when the callback is called the BrowserWindow might have been closed.
|
||||
if (this.isDestroyed()) return
|
||||
|
||||
// Route the event to BrowserWindow.
|
||||
this.emit('page-title-updated', event, title)
|
||||
if (!event.defaultPrevented) this.setTitle(title)
|
||||
if (!this.isDestroyed() && !event.defaultPrevented) this.setTitle(title)
|
||||
})
|
||||
|
||||
// Sometimes the webContents doesn't get focus when window is shown, so we
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue