mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-23 21:31:29 +01:00
default match detection setting
This commit is contained in:
parent
65bd33d860
commit
2e9ce15715
@ -43,6 +43,8 @@ import { SettingsService } from '../abstractions/settings.service';
|
|||||||
import { StorageService } from '../abstractions/storage.service';
|
import { StorageService } from '../abstractions/storage.service';
|
||||||
import { UserService } from '../abstractions/user.service';
|
import { UserService } from '../abstractions/user.service';
|
||||||
|
|
||||||
|
import { ConstantsService } from './constants.service';
|
||||||
|
|
||||||
import { sequentialize } from '../misc/sequentialize';
|
import { sequentialize } from '../misc/sequentialize';
|
||||||
import { Utils } from '../misc/utils';
|
import { Utils } from '../misc/utils';
|
||||||
|
|
||||||
@ -343,6 +345,11 @@ export class CipherService implements CipherServiceAbstraction {
|
|||||||
const matchingDomains = result[0];
|
const matchingDomains = result[0];
|
||||||
const ciphers = result[1];
|
const ciphers = result[1];
|
||||||
|
|
||||||
|
let defaultMatch = await this.storageService.get<UriMatchType>(ConstantsService.defaultUriMatch);
|
||||||
|
if (defaultMatch == null) {
|
||||||
|
defaultMatch = UriMatchType.Domain;
|
||||||
|
}
|
||||||
|
|
||||||
return ciphers.filter((cipher) => {
|
return ciphers.filter((cipher) => {
|
||||||
if (includeOtherTypes && includeOtherTypes.indexOf(cipher.type) > -1) {
|
if (includeOtherTypes && includeOtherTypes.indexOf(cipher.type) > -1) {
|
||||||
return true;
|
return true;
|
||||||
@ -355,9 +362,8 @@ export class CipherService implements CipherServiceAbstraction {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (u.match) {
|
const match = u.match == null ? defaultMatch : u.match;
|
||||||
case null:
|
switch (match) {
|
||||||
case undefined:
|
|
||||||
case UriMatchType.Domain:
|
case UriMatchType.Domain:
|
||||||
if (domain != null && u.domain != null && matchingDomains.indexOf(u.domain) > -1) {
|
if (domain != null && u.domain != null && matchingDomains.indexOf(u.domain) > -1) {
|
||||||
if (DomainMatchBlacklist.has(u.domain)) {
|
if (DomainMatchBlacklist.has(u.domain)) {
|
||||||
|
@ -17,6 +17,7 @@ export class ConstantsService {
|
|||||||
static readonly autoConfirmFingerprints: string = 'autoConfirmFingerprints';
|
static readonly autoConfirmFingerprints: string = 'autoConfirmFingerprints';
|
||||||
static readonly dontShowCardsCurrentTab: string = 'dontShowCardsCurrentTab';
|
static readonly dontShowCardsCurrentTab: string = 'dontShowCardsCurrentTab';
|
||||||
static readonly dontShowIdentitiesCurrentTab: string = 'dontShowIdentitiesCurrentTab';
|
static readonly dontShowIdentitiesCurrentTab: string = 'dontShowIdentitiesCurrentTab';
|
||||||
|
static readonly defaultUriMatch: string = 'defaultUriMatch';
|
||||||
|
|
||||||
readonly environmentUrlsKey: string = ConstantsService.environmentUrlsKey;
|
readonly environmentUrlsKey: string = ConstantsService.environmentUrlsKey;
|
||||||
readonly disableGaKey: string = ConstantsService.disableGaKey;
|
readonly disableGaKey: string = ConstantsService.disableGaKey;
|
||||||
@ -35,4 +36,5 @@ export class ConstantsService {
|
|||||||
readonly autoConfirmFingerprints: string = ConstantsService.autoConfirmFingerprints;
|
readonly autoConfirmFingerprints: string = ConstantsService.autoConfirmFingerprints;
|
||||||
readonly dontShowCardsCurrentTab: string = ConstantsService.dontShowCardsCurrentTab;
|
readonly dontShowCardsCurrentTab: string = ConstantsService.dontShowCardsCurrentTab;
|
||||||
readonly dontShowIdentitiesCurrentTab: string = ConstantsService.dontShowIdentitiesCurrentTab;
|
readonly dontShowIdentitiesCurrentTab: string = ConstantsService.dontShowIdentitiesCurrentTab;
|
||||||
|
readonly defaultUriMatch: string = ConstantsService.defaultUriMatch;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user