From e02cf5905c39ffd858dc47d6be4d6135b1d9d070 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 12 Jul 2016 13:24:53 -0700 Subject: [PATCH] Execute command on devtools web contents when focused --- lib/browser/api/menu-item-roles.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/browser/api/menu-item-roles.js b/lib/browser/api/menu-item-roles.js index 32d0d07f4b92..249e5f4b720f 100644 --- a/lib/browser/api/menu-item-roles.js +++ b/lib/browser/api/menu-item-roles.js @@ -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 }