BrowserWindow.removeDevToolsExtension('foo')
BrowserWindow.addDevToolsExtension(extensionPath)
- w.webContents.on('devtools-opened', function () {
- var showPanelIntevalId = setInterval(function () {
+ let showPanelIntervalId = null
+
+ w.webContents.once('devtools-opened', function () {
+ showPanelIntervalId = setInterval(function () {
if (w && w.devToolsWebContents) {
var showLastPanel = function () {
var lastPanelId = WebInspector.inspectorView._tabbedPane._tabs.peekLast().id
}
w.devToolsWebContents.executeJavaScript(`(${showLastPanel})()`)
} else {
- clearInterval(showPanelIntevalId)
+ clearInterval(showPanelIntervalId)
}
}, 100)
})
ipcMain.once('answer', function (event, message) {
assert.equal(message.runtimeId, 'foo')
+ clearInterval(showPanelIntervalId)
done()
})
})