1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

separated BrowserUtils from generic Utils

This commit is contained in:
Kyle Spearrin
2018-01-04 12:32:10 -05:00
parent ac0126b210
commit 0dd711471b
42 changed files with 474 additions and 451 deletions

View File

@@ -5,6 +5,7 @@ import AutofillField from '../models/domain/autofillField';
import AutofillPageDetails from '../models/domain/autofillPageDetails';
import AutofillScript from '../models/domain/autofillScript';
import BrowserUtilsService from './browserUtils.service';
import CipherService from './cipher.service';
import TokenService from './token.service';
import TotpService from './totp.service';
@@ -92,7 +93,8 @@ var IsoProvinces: { [id: string]: string; } = {
export default class AutofillService {
constructor(public cipherService: CipherService, public tokenService: TokenService,
public totpService: TotpService, public utilsService: UtilsService) {
public totpService: TotpService, public utilsService: UtilsService,
public browserUtilsService: BrowserUtilsService) {
}
getFormsWithPasswordFields(pageDetails: AutofillPageDetails): any[] {
@@ -167,7 +169,7 @@ export default class AutofillService {
}, { frameId: pd.frameId });
if (options.cipher.type !== CipherType.Login || totpPromise ||
(options.fromBackground && this.utilsService.isFirefox()) || options.skipTotp ||
(options.fromBackground && this.browserUtilsService.isFirefox()) || options.skipTotp ||
!options.cipher.login.totp || !this.tokenService.getPremium()) {
return;
}
@@ -205,7 +207,7 @@ export default class AutofillService {
return;
}
const tabDomain = UtilsService.getDomain(tab.url);
const tabDomain = BrowserUtilsService.getDomain(tab.url);
if (tabDomain == null) {
return;
}