Always open the DevTools in the detached mode – closes 1173

This commit is contained in:
Matheus Fernandes 2017-01-21 16:42:33 -02:00
parent bbd14bca09
commit a0a8484158
No known key found for this signature in database
GPG key ID: DD07CA4EA7B65C4F

View file

@ -211,7 +211,12 @@ module.exports = ({createWindow, updatePlugins}) => {
accelerator: accelerators.toggleDevTools,
click(item, focusedWindow) {
if (focusedWindow) {
focusedWindow.webContents.toggleDevTools();
const webContents = focusedWindow.webContents;
if (webContents.isDevToolsOpened()) {
webContents.closeDevTools();
} else {
webContents.openDevTools({mode: 'detach'});
}
}
}
},