Skip to content

Commit ba20507

Browse files
authored
fix: F12 cannot open devTools in development mode (#833)
1 parent 6c4c543 commit ba20507

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

apps/main/src/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ function bootstrap() {
4848
// initialization and is ready to create browser windows.
4949
// Some APIs can only be used after this event occurs.
5050
app.whenReady().then(() => {
51+
// Default open or close DevTools by F12 in development
52+
// and ignore CommandOrControl + R in production.
53+
// see https://github.com/alex8088/electron-toolkit/tree/master/packages/utils
54+
app.on("browser-window-created", (_, window) => {
55+
optimizer.watchWindowShortcuts(window)
56+
})
57+
5158
// Set app user model id for windows
5259
electronApp.setAppUserModelId(`re.${APP_PROTOCOL}`)
5360

@@ -87,13 +94,6 @@ function bootstrap() {
8794
url && handleOpen(url)
8895
})
8996

90-
// Default open or close DevTools by F12 in development
91-
// and ignore CommandOrControl + R in production.
92-
// see https://github.com/alex8088/electron-toolkit/tree/master/packages/utils
93-
app.on("browser-window-created", (_, window) => {
94-
optimizer.watchWindowShortcuts(window)
95-
})
96-
9797
// for dev debug
9898

9999
if (process.env.NODE_ENV === "development") {

0 commit comments

Comments
 (0)