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 }