From d1b58efc529fcdac06c10b91c4e1f33ea28a4c49 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Sat, 12 Oct 2024 16:19:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 0eea96e..446d0ae 100644 --- a/main.js +++ b/main.js @@ -322,6 +322,13 @@ app.on('ready', () => { childWindow[config.key].show() windowOperation(config) }) + child.webContents.on('before-input-event', (event, input) => { + // if (env === 'development') { + if (input.key === 'F12') { + child.webContents.openDevTools() + } + // } + }); }); // 关闭子窗口 ipcMain.handle('closeChildWindow', (event, key) => { @@ -418,7 +425,6 @@ function quitAndInstall() { function windowOperation(config) { const child = childWindow[config.key]; child.setResizable(false) - if (env === 'development') child.webContents.openDevTools(); if (config.key === 'shareScreenWindow') { const display = screen.getDisplayMatching({ ...child.getBounds() }); const x = Math.round((display.workArea.width - child.getSize()[0]) / 2);