Show last panel by id

This commit is contained in:
Kevin Sawicki 2016-05-17 16:40:34 -07:00
parent 13cfc2d2a0
commit f95c46d987

View file

@ -836,16 +836,14 @@ describe('browser-window module', function () {
w.webContents.on('devtools-opened', function () { w.webContents.on('devtools-opened', function () {
var inputEventIntervalId = setInterval(function () { var inputEventIntervalId = setInterval(function () {
if (w && w.devToolsWebContents) { if (w && w.devToolsWebContents) {
// Switch panels until the custom one is selected and loads w.devToolsWebContents.executeJavaScript('(' + (function () {
w.devToolsWebContents.sendInputEvent({ var lastPanelId = WebInspector.inspectorView._tabbedPane._tabs.peekLast().id
type: 'keyDown', WebInspector.inspectorView.showPanel(lastPanelId);
keyCode:'[', }).toString() + ')()')
modifiers: process.platform === 'darwin' ? ['meta'] : ['control']
})
} else { } else {
clearInterval(inputEventIntervalId) clearInterval(inputEventIntervalId)
} }
}, 200) }, 100)
}) })
w.loadURL('about:blank') w.loadURL('about:blank')