mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
Revert "make clipboardRead optional permission"
This reverts commit a797f18b78.
This commit is contained in:
@@ -16,8 +16,6 @@ import { TotpService } from 'jslib/abstractions/totp.service';
|
||||
|
||||
import { ConstantsService } from 'jslib/services/constants.service';
|
||||
|
||||
import { BrowserApi } from '../../browser/browserApi';
|
||||
|
||||
@Component({
|
||||
selector: 'app-options',
|
||||
templateUrl: 'options.component.html',
|
||||
@@ -37,7 +35,6 @@ export class OptionsComponent implements OnInit {
|
||||
themeOptions: any[];
|
||||
defaultUriMatch = UriMatchType.Domain;
|
||||
uriMatchOptions: any[];
|
||||
clearClipboardOriginalValue: number;
|
||||
clearClipboard: number;
|
||||
clearClipboardOptions: any[];
|
||||
|
||||
@@ -97,7 +94,6 @@ export class OptionsComponent implements OnInit {
|
||||
this.defaultUriMatch = defaultUriMatch == null ? UriMatchType.Domain : defaultUriMatch;
|
||||
|
||||
this.clearClipboard = await this.storageService.get<number>(ConstantsService.clearClipboardKey);
|
||||
this.clearClipboardOriginalValue = this.clearClipboard;
|
||||
}
|
||||
|
||||
async updateAddLoginNotification() {
|
||||
@@ -159,22 +155,10 @@ export class OptionsComponent implements OnInit {
|
||||
}
|
||||
|
||||
async saveClearClipboard() {
|
||||
if (!this.showClearClipboard) {
|
||||
return;
|
||||
}
|
||||
let hasClipboardPermission = await BrowserApi.hasPermission('clipboardRead');
|
||||
if (!hasClipboardPermission) {
|
||||
hasClipboardPermission = await BrowserApi.requestPermission('clipboardRead');
|
||||
}
|
||||
if (hasClipboardPermission) {
|
||||
this.clearClipboardOriginalValue = this.clearClipboard;
|
||||
await this.storageService.save(ConstantsService.clearClipboardKey, this.clearClipboard);
|
||||
this.analytics.eventTrack.next({
|
||||
action: 'Set Clear Clipboard ' + (this.clearClipboard == null ? 'Disabled' : this.clearClipboard),
|
||||
});
|
||||
} else {
|
||||
this.clearClipboard = this.clearClipboardOriginalValue;
|
||||
}
|
||||
await this.storageService.save(ConstantsService.clearClipboardKey, this.clearClipboard);
|
||||
this.analytics.eventTrack.next({
|
||||
action: 'Set Clear Clipboard ' + (this.clearClipboard == null ? 'Disabled' : this.clearClipboard),
|
||||
});
|
||||
}
|
||||
|
||||
private callAnalytics(name: string, enabled: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user