Execute command on devtools web contents when focused

This commit is contained in:
Kevin Sawicki 2016-07-12 13:24:53 -07:00
parent fa36d2e8c6
commit e02cf5905c

View file

@ -138,7 +138,11 @@ exports.execute = (role, focusedWindow) => {
if (webContentsMethod && focusedWindow != null) {
const {webContents} = focusedWindow
if (webContents) {
webContents[webContentsMethod]()
if (webContents.isDevToolsFocused()) {
webContents.devToolsWebContents[webContentsMethod]()
} else {
webContents[webContentsMethod]()
}
}
return true
}