fix(electron): do not always enable devtools detach mode (#8273)

This commit is contained in:
pengx17 2024-09-18 04:16:51 +00:00
parent 714b7b863e
commit 7a26c76e53
No known key found for this signature in database
GPG Key ID: 23F23D9E8B3971ED
2 changed files with 4 additions and 12 deletions

View File

@ -258,9 +258,7 @@ export async function openUrlInHiddenWindow(urlObj: URL) {
});
if (BUILD_CONFIG.debug) {
win.webContents.openDevTools({
mode: 'detach',
});
win.webContents.openDevTools();
}
win.on('close', e => {

View File

@ -817,9 +817,7 @@ export class WebContentViewsManager {
view.webContents.loadURL(shellViewUrl).catch(err => logger.error(err));
if (isDev) {
view.webContents.openDevTools({
mode: 'detach',
});
view.webContents.openDevTools();
}
}
@ -1003,17 +1001,13 @@ export const showDevTools = (id?: string) => {
getCustomThemeWindow()
.then(w => {
if (w && w.isFocused()) {
w.webContents.openDevTools({
mode: 'detach',
});
w.webContents.openDevTools();
} else {
const view = id
? WebContentViewsManager.instance.getViewById(id)
: WebContentViewsManager.instance.activeWorkbenchView;
if (view) {
view.webContents.openDevTools({
mode: 'detach',
});
view.webContents.openDevTools();
}
}
})