Skip to content

Commit e02cf59

Browse files
committed
Execute command on devtools web contents when focused
1 parent fa36d2e commit e02cf59

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/browser/api/menu-item-roles.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ exports.execute = (role, focusedWindow) => {
138138
if (webContentsMethod && focusedWindow != null) {
139139
const {webContents} = focusedWindow
140140
if (webContents) {
141-
webContents[webContentsMethod]()
141+
if (webContents.isDevToolsFocused()) {
142+
webContents.devToolsWebContents[webContentsMethod]()
143+
} else {
144+
webContents[webContentsMethod]()
145+
}
142146
}
143147
return true
144148
}

0 commit comments

Comments
 (0)