MOBILE-2986 desktop: Add shortcut to open dev tools
parent
bc4b696966
commit
daa34a7caa
|
@ -68,6 +68,14 @@ function createWindow() {
|
||||||
|
|
||||||
// Append some text to the user agent.
|
// Append some text to the user agent.
|
||||||
mainWindow.webContents.setUserAgent(mainWindow.webContents.getUserAgent() + ' ' + userAgent);
|
mainWindow.webContents.setUserAgent(mainWindow.webContents.getUserAgent() + ' ' + userAgent);
|
||||||
|
|
||||||
|
// Add shortcut to open dev tools: Control/Cmd + Alt + I.
|
||||||
|
mainWindow.webContents.on('before-input-event', function(e, input) {
|
||||||
|
// The "meta" key is Cmd in MacOS and Control in Windows/Linux.
|
||||||
|
if (input.type == 'keyDown' && !input.isAutoRepeat && input.code == 'KeyI' && input.alt && input.meta) {
|
||||||
|
mainWindow.webContents.toggleDevTools();
|
||||||
|
}
|
||||||
|
}, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure that only a single instance of the app is running.
|
// Make sure that only a single instance of the app is running.
|
||||||
|
@ -221,22 +229,18 @@ function setAppMenu() {
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: 'Cut',
|
label: 'Cut',
|
||||||
accelerator: 'CmdOrCtrl+X',
|
|
||||||
role: 'cut'
|
role: 'cut'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Copy',
|
label: 'Copy',
|
||||||
accelerator: 'CmdOrCtrl+C',
|
|
||||||
role: 'copy'
|
role: 'copy'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Paste',
|
label: 'Paste',
|
||||||
accelerator: 'CmdOrCtrl+V',
|
|
||||||
role: 'paste'
|
role: 'paste'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Select All',
|
label: 'Select All',
|
||||||
accelerator: 'CmdOrCtrl+A',
|
|
||||||
role: 'selectall'
|
role: 'selectall'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue