fix: toggleDevTools menu role closes devtools window (#29922)

This commit is contained in:
Jeremy Rose 2021-08-01 18:58:28 -07:00 committed by GitHub
parent c0e72bd335
commit 888ac65c72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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',