From af61732800624284dfc023c124e99757c49965cf Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Fri, 14 May 2021 10:04:08 +1000 Subject: [PATCH 1/3] Copy TOTP after all autofills, remove old UI --- src/_locales/en/messages.json | 6 ------ src/popup/settings/options.component.html | 12 ------------ src/popup/settings/options.component.ts | 8 -------- src/services/autofill.service.ts | 5 +---- 4 files changed, 1 insertion(+), 30 deletions(-) diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 3b5121d7f5..44d98f4cc8 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -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." }, diff --git a/src/popup/settings/options.component.html b/src/popup/settings/options.component.html index fd7563a12d..83bbc329a6 100644 --- a/src/popup/settings/options.component.html +++ b/src/popup/settings/options.component.html @@ -161,17 +161,5 @@ {{'warning' | i18n}}: {{'experimentalFeature' | i18n}} -
-
-
- - -
-
- -
diff --git a/src/popup/settings/options.component.ts b/src/popup/settings/options.component.ts index 355e47a328..60db20ae73 100644 --- a/src/popup/settings/options.component.ts +++ b/src/popup/settings/options.component.ts @@ -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'; @@ -22,7 +21,6 @@ export class OptionsComponent implements OnInit { disableFavicon = false; disableBadgeCounter = false; enableAutoFillOnPageLoad = false; - enableAutoTotpCopyOnAutoFill = false; disableAutoTotpCopy = false; disableContextMenuItem = false; disableAddLoginNotification = false; @@ -72,8 +70,6 @@ export class OptionsComponent implements OnInit { this.enableAutoFillOnPageLoad = await this.storageService.get( ConstantsService.enableAutoFillOnPageLoadKey); - this.enableAutoTotpCopyOnAutoFill = await this.totpService.isAutoCopyOnAutoFillEnabled(); - this.disableAddLoginNotification = await this.storageService.get( ConstantsService.disableAddLoginNotificationKey); @@ -124,10 +120,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 updateDisableFavicon() { await this.storageService.save(ConstantsService.disableFaviconKey, this.disableFavicon); await this.stateService.save(ConstantsService.disableFaviconKey, this.disableFavicon); diff --git a/src/services/autofill.service.ts b/src/services/autofill.service.ts index 08f7b41a2a..e73d7e2708 100644 --- a/src/services/autofill.service.ts +++ b/src/services/autofill.service.ts @@ -259,13 +259,10 @@ 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, + skipTotp: false, skipLastUsed: !fromCommand, skipUsernameOnlyFill: !fromCommand, onlyEmptyFields: !fromCommand, From 59c50f7fb09e50db2142f2b0195a9797a3d92e5d Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Mon, 17 May 2021 13:19:33 +1000 Subject: [PATCH 2/3] remove unused skipTotp option on doAutoFill --- src/services/autofill.service.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/services/autofill.service.ts b/src/services/autofill.service.ts index e73d7e2708..386ad20e78 100644 --- a/src/services/autofill.service.ts +++ b/src/services/autofill.service.ts @@ -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; } @@ -262,7 +262,6 @@ export default class AutofillService implements AutofillServiceInterface { const totpCode = await this.doAutoFill({ cipher: cipher, pageDetails: pageDetails, - skipTotp: false, skipLastUsed: !fromCommand, skipUsernameOnlyFill: !fromCommand, onlyEmptyFields: !fromCommand, From 40ffc9dc21e088a2380d183c042d1206808aebf0 Mon Sep 17 00:00:00 2001 From: Thomas Rittson Date: Mon, 17 May 2021 13:25:39 +1000 Subject: [PATCH 3/3] bump jslib --- jslib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jslib b/jslib index 306aef73d4..8659d0975d 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 306aef73d459dfad8a7a06c32442c9ed2d56922e +Subproject commit 8659d0975ddb7dc70c0246b4b9acf81e013cdde3