Skip to content

Commit 24bf1be

Browse files
committed
fix(electron): devtools open in detach mode (#8200)
fix AF-1380
1 parent 8bf0458 commit 24bf1be

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

packages/frontend/electron/src/main/windows-manager/main-window.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,9 @@ export async function openUrlInHiddenWindow(urlObj: URL) {
258258
});
259259

260260
if (environment.isDebug) {
261-
win.webContents.openDevTools();
261+
win.webContents.openDevTools({
262+
mode: 'detach',
263+
});
262264
}
263265

264266
win.on('close', e => {

packages/frontend/electron/src/main/windows-manager/tab-views.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,9 @@ export class WebContentViewsManager {
815815

816816
view.webContents.loadURL(shellViewUrl).catch(logger.error);
817817
if (isDev) {
818-
view.webContents.openDevTools();
818+
view.webContents.openDevTools({
819+
mode: 'detach',
820+
});
819821
}
820822
}
821823

@@ -999,13 +1001,17 @@ export const showDevTools = (id?: string) => {
9991001
getCustomThemeWindow()
10001002
.then(w => {
10011003
if (w && w.isFocused()) {
1002-
w.webContents.openDevTools();
1004+
w.webContents.openDevTools({
1005+
mode: 'detach',
1006+
});
10031007
} else {
10041008
const view = id
10051009
? WebContentViewsManager.instance.getViewById(id)
10061010
: WebContentViewsManager.instance.activeWorkbenchView;
10071011
if (view) {
1008-
view.webContents.openDevTools();
1012+
view.webContents.openDevTools({
1013+
mode: 'detach',
1014+
});
10091015
}
10101016
}
10111017
})

0 commit comments

Comments
 (0)