diff --git a/src/background/main.background.ts b/src/background/main.background.ts index 890fea89dc..4b79d337f3 100644 --- a/src/background/main.background.ts +++ b/src/background/main.background.ts @@ -577,7 +577,7 @@ export default class MainBackground { }); } - if (cipher == null || (cipher.login.password && cipher.login.password !== '')) { + if (cipher == null || (cipher.login.password && cipher.login.password !== '' && cipher.viewPassword)) { await this.contextMenusCreate({ type: 'normal', id: 'copy-password_' + idSuffix, diff --git a/src/popup/components/action-buttons.component.html b/src/popup/components/action-buttons.component.html index 276666fb97..54039a3057 100644 --- a/src/popup/components/action-buttons.component.html +++ b/src/popup/components/action-buttons.component.html @@ -13,7 +13,7 @@ + [ngClass]="{disabled: (!cipher.login.password || !cipher.viewPassword)}"> diff --git a/src/popup/components/action-buttons.component.ts b/src/popup/components/action-buttons.component.ts index 0401b41e33..4158564b5e 100644 --- a/src/popup/components/action-buttons.component.ts +++ b/src/popup/components/action-buttons.component.ts @@ -53,6 +53,10 @@ export class ActionButtonsComponent { return; } + if (!cipher.viewPassword) { + return; + } + this.analytics.eventTrack.next({ action: 'Copied ' + aType }); this.platformUtilsService.copyToClipboard(value, { window: window }); this.toasterService.popAsync('info', null, diff --git a/src/popup/vault/add-edit.component.html b/src/popup/vault/add-edit.component.html index bd11fca90e..8f60d108f6 100644 --- a/src/popup/vault/add-edit.component.html +++ b/src/popup/vault/add-edit.component.html @@ -40,24 +40,28 @@
+ name="Login.Password" [(ngModel)]="cipher.login.password" appInputVerbatim + [disabled]="!cipher.viewPassword">
+ appA11yTitle="{{'toggleVisibility' | i18n}}" (click)="togglePassword()" + *ngIf="cipher.viewPassword"> + appA11yTitle="{{'generatePassword' | i18n}}" (click)="generatePassword()" + *ngIf="cipher.viewPassword">
diff --git a/src/popup/vault/view.component.html b/src/popup/vault/view.component.html index 8b989c4c6a..f29c29df69 100644 --- a/src/popup/vault/view.component.html +++ b/src/popup/vault/view.component.html @@ -46,19 +46,21 @@
+ (click)="togglePassword()" *ngIf="cipher.viewPassword"> + (click)="copy(cipher.login.password, 'password', 'Password')" + *ngIf="cipher.viewPassword">