fix: `F12` cannot open devTools in development mode (#833)

This commit is contained in:
Cesaryuan 2024-10-09 17:59:25 +08:00 committed by GitHub
parent 6c4c543708
commit ba20507cbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 7 deletions

View File

@ -48,6 +48,13 @@ function bootstrap() {
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(() => {
// Default open or close DevTools by F12 in development
// and ignore CommandOrControl + R in production.
// see https://github.com/alex8088/electron-toolkit/tree/master/packages/utils
app.on("browser-window-created", (_, window) => {
optimizer.watchWindowShortcuts(window)
})
// Set app user model id for windows
electronApp.setAppUserModelId(`re.${APP_PROTOCOL}`)
@ -87,13 +94,6 @@ function bootstrap() {
url && handleOpen(url)
})
// Default open or close DevTools by F12 in development
// and ignore CommandOrControl + R in production.
// see https://github.com/alex8088/electron-toolkit/tree/master/packages/utils
app.on("browser-window-created", (_, window) => {
optimizer.watchWindowShortcuts(window)
})
// for dev debug
if (process.env.NODE_ENV === "development") {