1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

Merge branch 'master' into feature-aopl-options

This commit is contained in:
Thomas Rittson
2021-05-18 10:11:40 +10:00
7 changed files with 26 additions and 56 deletions

View File

@@ -898,12 +898,6 @@
"enableAutoFillOnPageLoadDesc": {
"message": "If a login form is detected, automatically perform an auto-fill when the web page loads."
},
"enableAutoTotpCopyOnAutoFill": {
"message": "Automatic TOTP Copy after Page Load"
},
"enableAutoTotpCopyOnAutoFillDesc": {
"message": "If Auto-fill On Page Load is enabled, the TOTP verification code is automatically copied to your clipboard after loading the web page. This is overridden by Disable Automatic TOTP Copy."
},
"experimentalFeature": {
"message": "This is currently an experimental feature. Use at your own risk."
},

View File

@@ -173,17 +173,5 @@
</div>
<div class="box-footer">{{'defaultAutoFillOnPageLoadDesc' | i18n}}</div>
</div>
<div class="box">
<div class="box-content">
<div class="box-content-row box-content-row-checkbox" appBoxRow>
<label for="autoCopyTotp">{{'enableAutoTotpCopyOnAutoFill' | i18n}}</label>
<input id="autoCopyTotp" type="checkbox" (change)="updateAutoTotpCopyOnAutoFill()"
[(ngModel)]="enableAutoTotpCopyOnAutoFill" [disabled]="!enableAutoFillOnPageLoad">
</div>
</div>
<div class="box-footer">
{{'enableAutoTotpCopyOnAutoFillDesc' | i18n}}
</div>
</div>
</ng-container>
</content>

View File

@@ -7,7 +7,6 @@ import { UriMatchType } from 'jslib/enums/uriMatchType';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { MessagingService } from 'jslib/abstractions/messaging.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { StateService } from 'jslib/abstractions/state.service';
import { StorageService } from 'jslib/abstractions/storage.service';
import { TotpService } from 'jslib/abstractions/totp.service';
@@ -24,7 +23,6 @@ export class OptionsComponent implements OnInit {
enableAutoFillOnPageLoad = false;
autoFillOnPageLoadDefault = false;
autoFillOnPageLoadOptions: any[];
enableAutoTotpCopyOnAutoFill = false;
disableAutoTotpCopy = false;
disableContextMenuItem = false;
disableAddLoginNotification = false;
@@ -81,8 +79,6 @@ export class OptionsComponent implements OnInit {
this.autoFillOnPageLoadDefault = await this.storageService.get<boolean>(
ConstantsService.autoFillOnPageLoadDefaultKey) ?? false;
this.enableAutoTotpCopyOnAutoFill = await this.totpService.isAutoCopyOnAutoFillEnabled();
this.disableAddLoginNotification = await this.storageService.get<boolean>(
ConstantsService.disableAddLoginNotificationKey);
@@ -133,10 +129,6 @@ export class OptionsComponent implements OnInit {
await this.storageService.save(ConstantsService.enableAutoFillOnPageLoadKey, this.enableAutoFillOnPageLoad);
}
async updateAutoTotpCopyOnAutoFill() {
await this.storageService.save(ConstantsService.enableAutoTotpCopyOnAutoFillKey, this.enableAutoTotpCopyOnAutoFill);
}
async updateAutoFillOnPageLoadDefault() {
await this.storageService.save(ConstantsService.autoFillOnPageLoadDefaultKey, this.autoFillOnPageLoadDefault);
}

View File

@@ -211,8 +211,8 @@ export default class AutofillService implements AutofillServiceInterface {
url: tab.url,
}, { frameId: pd.frameId });
if (options.cipher.type !== CipherType.Login || totpPromise || options.skipTotp ||
!options.cipher.login.totp || (!canAccessPremium && !options.cipher.organizationUseTotp)) {
if (options.cipher.type !== CipherType.Login || totpPromise || !options.cipher.login.totp ||
(!canAccessPremium && !options.cipher.organizationUseTotp)) {
return;
}
@@ -263,13 +263,9 @@ export default class AutofillService implements AutofillServiceInterface {
return;
}
const copyTotpOnAutoFill = await this.totpService.isAutoCopyOnAutoFillEnabled();
const shouldCopyTotp = fromCommand || copyTotpOnAutoFill;
const totpCode = await this.doAutoFill({
cipher: cipher,
pageDetails: pageDetails,
skipTotp: !shouldCopyTotp,
skipLastUsed: !fromCommand,
skipUsernameOnlyFill: !fromCommand,
onlyEmptyFields: !fromCommand,