Skip to content

Commit

Permalink
fix: toggleDevTools menu role closes devtools window (electron#29922)
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon authored and BlackHole1 committed Aug 27, 2021
1 parent fede981 commit 73460ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/browser/api/menu-item-roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ export const roleList: Record<RoleId, Role> = {
label: 'Toggle Developer Tools',
accelerator: isMac ? 'Alt+Command+I' : 'Ctrl+Shift+I',
nonNativeMacOSRole: true,
windowMethod: w => w.webContents.toggleDevTools()
webContentsMethod: wc => {
const bw = wc.getOwnerBrowserWindow();
if (bw) bw.webContents.toggleDevTools();
}
},
togglefullscreen: {
label: 'Toggle Full Screen',
Expand Down

0 comments on commit 73460ca

Please sign in to comment.