1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-04 17:43:39 +00:00

[PM-14006] Prevent screenshot setting V2 (#12570)

* Add screenshot protection to windows and mac

* Update messaging of screencapture prevention feature

* Rename settings key

* Default allow screenshots

* Update screenshot setting description

* Fix typo

* Add confirm visible prompt
This commit is contained in:
Bernd Schoolmann
2025-02-10 20:02:13 +01:00
committed by GitHub
parent 2b5c7861e2
commit 543cf0fb3f
5 changed files with 106 additions and 1 deletions

View File

@@ -76,6 +76,13 @@ export class WindowMain {
}
});
this.desktopSettingsService.preventScreenshots$.subscribe((prevent) => {
if (this.win == null) {
return;
}
this.win.setContentProtection(prevent);
});
return new Promise<void>((resolve, reject) => {
try {
if (!isMacAppStore()) {
@@ -277,6 +284,14 @@ export class WindowMain {
});
});
firstValueFrom(this.desktopSettingsService.preventScreenshots$)
.then((preventScreenshots) => {
this.win.setContentProtection(preventScreenshots);
})
.catch((e) => {
this.logService.error(e);
});
if (this.createWindowCallback) {
this.createWindowCallback(this.win);
}