Use destroyed event instead of closed event
This commit is contained in:
parent
4f46f75d8f
commit
4c1ede32cf
1 changed files with 3 additions and 3 deletions
|
@ -81,13 +81,13 @@ const removeBackgroundPages = function (manifest) {
|
|||
}
|
||||
|
||||
// Dispatch tabs events.
|
||||
const hookWindowForTabEvents = function (win, webContents) {
|
||||
const hookWindowForTabEvents = function (webContents) {
|
||||
const tabId = webContents.id
|
||||
for (const page of objectValues(backgroundPages)) {
|
||||
page.webContents.sendToAll('CHROME_TABS_ONCREATED', tabId)
|
||||
}
|
||||
|
||||
win.once('closed', () => {
|
||||
webContents.once('destroyed', () => {
|
||||
for (const page of objectValues(backgroundPages)) {
|
||||
page.webContents.sendToAll('CHROME_TABS_ONREMOVED', tabId)
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ app.once('ready', function () {
|
|||
}
|
||||
|
||||
BrowserWindow.prototype._loadDevToolsExtensions = function (webContents) {
|
||||
hookWindowForTabEvents(this, webContents)
|
||||
hookWindowForTabEvents(webContents)
|
||||
webContents.on('devtools-opened', function () {
|
||||
loadDevToolsExtensions(webContents, objectValues(manifestMap))
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue