collection event for autofill
This commit is contained in:
parent
7bfb8d91e3
commit
fd04be2d98
|
@ -168,9 +168,12 @@ export default class MainBackground {
|
||||||
this.syncService = new SyncService(this.userService, this.apiService, this.settingsService,
|
this.syncService = new SyncService(this.userService, this.apiService, this.settingsService,
|
||||||
this.folderService, this.cipherService, this.cryptoService, this.collectionService,
|
this.folderService, this.cipherService, this.cryptoService, this.collectionService,
|
||||||
this.storageService, this.messagingService, async (expired: boolean) => await this.logout(expired));
|
this.storageService, this.messagingService, async (expired: boolean) => await this.logout(expired));
|
||||||
|
this.eventService = new EventService(this.storageService, this.apiService, this.userService,
|
||||||
|
this.cipherService);
|
||||||
this.passwordGenerationService = new PasswordGenerationService(this.cryptoService, this.storageService);
|
this.passwordGenerationService = new PasswordGenerationService(this.cryptoService, this.storageService);
|
||||||
this.totpService = new TotpService(this.storageService, cryptoFunctionService);
|
this.totpService = new TotpService(this.storageService, cryptoFunctionService);
|
||||||
this.autofillService = new AutofillService(this.cipherService, this.userService, this.totpService);
|
this.autofillService = new AutofillService(this.cipherService, this.userService, this.totpService,
|
||||||
|
this.eventService);
|
||||||
this.containerService = new ContainerService(this.cryptoService);
|
this.containerService = new ContainerService(this.cryptoService);
|
||||||
this.auditService = new AuditService(cryptoFunctionService, this.apiService);
|
this.auditService = new AuditService(cryptoFunctionService, this.apiService);
|
||||||
this.exportService = new ExportService(this.folderService, this.cipherService, this.apiService);
|
this.exportService = new ExportService(this.folderService, this.cipherService, this.apiService);
|
||||||
|
@ -180,8 +183,6 @@ export default class MainBackground {
|
||||||
this.notificationsService);
|
this.notificationsService);
|
||||||
this.analytics = new Analytics(window, () => BrowserApi.gaFilter(), this.platformUtilsService,
|
this.analytics = new Analytics(window, () => BrowserApi.gaFilter(), this.platformUtilsService,
|
||||||
this.storageService, this.appIdService);
|
this.storageService, this.appIdService);
|
||||||
this.eventService = new EventService(this.storageService, this.apiService, this.userService,
|
|
||||||
this.cipherService);
|
|
||||||
this.systemService = new SystemService(this.storageService, this.lockService,
|
this.systemService = new SystemService(this.storageService, this.lockService,
|
||||||
this.messagingService, this.platformUtilsService, () => {
|
this.messagingService, this.platformUtilsService, () => {
|
||||||
const forceWindowReload = this.platformUtilsService.isSafari() ||
|
const forceWindowReload = this.platformUtilsService.isSafari() ||
|
||||||
|
|
|
@ -17,6 +17,9 @@ import {
|
||||||
UserService,
|
UserService,
|
||||||
} from 'jslib/abstractions';
|
} from 'jslib/abstractions';
|
||||||
|
|
||||||
|
import { EventService } from 'jslib/abstractions/event.service';
|
||||||
|
import { EventType } from 'jslib/enums/eventType';
|
||||||
|
|
||||||
const CardAttributes: string[] = ['autoCompleteType', 'data-stripe', 'htmlName', 'htmlID', 'label-tag',
|
const CardAttributes: string[] = ['autoCompleteType', 'data-stripe', 'htmlName', 'htmlID', 'label-tag',
|
||||||
'placeholder', 'label-left', 'label-top'];
|
'placeholder', 'label-left', 'label-top'];
|
||||||
|
|
||||||
|
@ -105,7 +108,7 @@ var IsoProvinces: { [id: string]: string; } = {
|
||||||
|
|
||||||
export default class AutofillService implements AutofillServiceInterface {
|
export default class AutofillService implements AutofillServiceInterface {
|
||||||
constructor(private cipherService: CipherService, private userService: UserService,
|
constructor(private cipherService: CipherService, private userService: UserService,
|
||||||
private totpService: TotpService) { }
|
private totpService: TotpService, private eventService: EventService) { }
|
||||||
|
|
||||||
getFormsWithPasswordFields(pageDetails: AutofillPageDetails): any[] {
|
getFormsWithPasswordFields(pageDetails: AutofillPageDetails): any[] {
|
||||||
const formData: any[] = [];
|
const formData: any[] = [];
|
||||||
|
@ -189,6 +192,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (didAutofill) {
|
if (didAutofill) {
|
||||||
|
this.eventService.collect(EventType.Cipher_ClientAutofilled, options.cipher.id);
|
||||||
if (totpPromise != null) {
|
if (totpPromise != null) {
|
||||||
return await totpPromise;
|
return await totpPromise;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue