Execute command on devtools web contents when focused
This commit is contained in:
parent
fa36d2e8c6
commit
e02cf5905c
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue