feat: open developer tool detach to prevent overlap

This commit is contained in:
linonetwo 2023-12-29 21:54:22 +08:00
parent fb6e895710
commit cf87bf7bef
3 changed files with 2 additions and 4 deletions

View file

@ -365,7 +365,7 @@ export default class ContextMenuBuilder {
const inspect = new MenuItem({
label: this.stringTable.developerTools(),
click: () => {
this.webContents.openDevTools();
this.webContents.openDevTools({ mode: 'detach' });
},
});
menu.append(inspect);

View file

@ -349,8 +349,6 @@ export class View implements IViewService {
didFailLoadErrorMessage: null,
isLoading: true,
});
// DEBUG devTool
// view.webContents.openDevTools({ mode: 'detach' });
await view.webContents.loadURL(urlToLoad);
logger.debug('loadUrlForView() await loadURL() done');
const unregisterContextMenu = await this.menuService.initContextMenuForWindowWebContents(view.webContents);

View file

@ -258,7 +258,7 @@ export class WorkspaceView implements IWorkspaceViewService {
{
label: () => i18n.t('Menu.DeveloperToolsActiveWorkspace'),
accelerator: 'CmdOrCtrl+Option+I',
click: async () => (await this.viewService.getActiveBrowserView())?.webContents?.openDevTools(),
click: async () => (await this.viewService.getActiveBrowserView())?.webContents?.openDevTools?.({ mode: 'detach' }),
enabled: hasWorkspaces,
},
]);