新增打开主窗口开发者工具快捷键

pull/930/merge
lyswhut 2022-01-11 16:58:33 +08:00
parent 57122c6eea
commit 5146f083ff
4 changed files with 19 additions and 0 deletions

View File

@ -11,6 +11,7 @@ const names = {
clear_env_params_deeplink: 'clear_env_params_deeplink',
wait: 'wait',
wait_cancel: 'wait_cancel',
open_dev_tools: 'open_dev_tools',
set_music_meta: 'set_music_meta',
progress: 'progress',

View File

@ -21,6 +21,7 @@ require('./lyric')
require('./musicUrl')
require('./systemFonts')
require('./wait')
require('./openDevtools')
// require('./kw_decodeLyric')

View File

@ -0,0 +1,13 @@
const { mainOn, NAMES: { mainWindow: ipcMainWindowNames } } = require('../../common/ipc')
mainOn(ipcMainWindowNames.open_dev_tools, event => {
if (global.modules.mainWindow) {
if (global.modules.mainWindow.isDevToolsOpened()) {
global.modules.mainWindow.webContents.closeDevTools()
} else {
global.modules.mainWindow.webContents.openDevTools({
mode: 'undocked',
})
}
}
})

View File

@ -105,3 +105,7 @@ eventHub.on(syncName.send_sync_list, ({ action, data }) => {
if (!sync.enable) return
rendererSend(NAMES.mainWindow.sync_list, { action, data })
})
eventHub.on('key_mod+f12_down', ({ action, data }) => {
if (!sync.enable) return
rendererSend(NAMES.mainWindow.open_dev_tools)
})