[PM-6006] Restrict desktop devtools to dev mode only (#7765)
This commit is contained in:
parent
cbcd5d9747
commit
8e1ccb293e
|
@ -3,6 +3,8 @@ import { MenuItemConstructorOptions } from "electron";
|
||||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||||
|
|
||||||
|
import { isDev } from "../../utils";
|
||||||
|
|
||||||
import { IMenubarMenu } from "./menubar";
|
import { IMenubarMenu } from "./menubar";
|
||||||
|
|
||||||
export class ViewMenu implements IMenubarMenu {
|
export class ViewMenu implements IMenubarMenu {
|
||||||
|
@ -13,7 +15,7 @@ export class ViewMenu implements IMenubarMenu {
|
||||||
}
|
}
|
||||||
|
|
||||||
get items(): MenuItemConstructorOptions[] {
|
get items(): MenuItemConstructorOptions[] {
|
||||||
return [
|
const items = [
|
||||||
this.searchVault,
|
this.searchVault,
|
||||||
this.separator,
|
this.separator,
|
||||||
this.generator,
|
this.generator,
|
||||||
|
@ -26,8 +28,13 @@ export class ViewMenu implements IMenubarMenu {
|
||||||
this.toggleFullscreen,
|
this.toggleFullscreen,
|
||||||
this.separator,
|
this.separator,
|
||||||
this.reload,
|
this.reload,
|
||||||
this.toggleDevTools,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (isDev()) {
|
||||||
|
items.push(this.toggleDevTools);
|
||||||
|
}
|
||||||
|
|
||||||
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly _i18nService: I18nService;
|
private readonly _i18nService: I18nService;
|
||||||
|
|
|
@ -166,6 +166,7 @@ export class WindowMain {
|
||||||
backgroundThrottling: false,
|
backgroundThrottling: false,
|
||||||
contextIsolation: true,
|
contextIsolation: true,
|
||||||
session: this.session,
|
session: this.session,
|
||||||
|
devTools: isDev(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue