mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-04 23:31:28 +01:00
default match detection setting
This commit is contained in:
parent
62cd97688e
commit
2a3beacbe0
2
jslib
2
jslib
@ -1 +1 @@
|
||||
Subproject commit 65bd33d860f3af71968a15e78491221091c4369e
|
||||
Subproject commit 2e9ce1571514e2b4ae9ed61a1368b2db03a0ca5d
|
@ -544,6 +544,13 @@
|
||||
"disableContextMenuItemDesc": {
|
||||
"message": "Context menu options provide quick access to password generation and logins for the website in your current tab."
|
||||
},
|
||||
"defaultUriMatchDetection": {
|
||||
"message": "Default URI Match Detection",
|
||||
"description": "Default URI match detection for auto-fill."
|
||||
},
|
||||
"defaultUriMatchDetectionDesc": {
|
||||
"message": "Choose the default way that URI match detection is handled for logins when performing actions such as auto-fill."
|
||||
},
|
||||
"theme": {
|
||||
"message": "Theme"
|
||||
},
|
||||
|
@ -24,6 +24,18 @@
|
||||
<b>{{'warning' | i18n}}</b>: {{'experimentalFeature' | i18n}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="box-content">
|
||||
<div class="box-content-row" appBoxRow>
|
||||
<label for="defaultUriMatch">{{'defaultUriMatchDetection' | i18n}}</label>
|
||||
<select id="defaultUriMatch" name="DefaultUriMatch" [(ngModel)]="defaultUriMatch"
|
||||
(change)="saveDefaultUriMatch()">
|
||||
<option *ngFor="let o of uriMatchOptions" [ngValue]="o.value">{{o.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">{{'defaultUriMatchDetectionDesc' | i18n}}</div>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="box-content">
|
||||
<div class="box-content-row box-content-row-checkbox" appBoxRow>
|
||||
|
@ -5,6 +5,8 @@ import {
|
||||
|
||||
import { Angulartics2 } from 'angulartics2';
|
||||
|
||||
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';
|
||||
@ -31,16 +33,26 @@ export class OptionsComponent implements OnInit {
|
||||
disableGa = false;
|
||||
theme: string;
|
||||
themeOptions: any[];
|
||||
defaultUriMatch = UriMatchType.Domain;
|
||||
uriMatchOptions: any[];
|
||||
|
||||
constructor(private analytics: Angulartics2, private messagingService: MessagingService,
|
||||
private platformUtilsService: PlatformUtilsService, private storageService: StorageService,
|
||||
private stateService: StateService, private totpService: TotpService,
|
||||
private i18nService: I18nService) {
|
||||
i18nService: I18nService) {
|
||||
this.themeOptions = [
|
||||
{ name: i18nService.t('default'), value: null },
|
||||
{ name: i18nService.t('light'), value: 'light' },
|
||||
{ name: i18nService.t('dark'), value: 'dark' },
|
||||
];
|
||||
this.uriMatchOptions = [
|
||||
{ name: i18nService.t('baseDomain'), value: UriMatchType.Domain },
|
||||
{ name: i18nService.t('host'), value: UriMatchType.Host },
|
||||
{ name: i18nService.t('startsWith'), value: UriMatchType.StartsWith },
|
||||
{ name: i18nService.t('regEx'), value: UriMatchType.RegularExpression },
|
||||
{ name: i18nService.t('exact'), value: UriMatchType.Exact },
|
||||
{ name: i18nService.t('never'), value: UriMatchType.Never },
|
||||
];
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
@ -70,6 +82,9 @@ export class OptionsComponent implements OnInit {
|
||||
this.disableFavicon = await this.storageService.get<boolean>(ConstantsService.disableFaviconKey);
|
||||
|
||||
this.theme = await this.storageService.get<string>(ConstantsService.themeKey);
|
||||
|
||||
const defaultUriMatch = await this.storageService.get<UriMatchType>(ConstantsService.defaultUriMatch);
|
||||
this.defaultUriMatch = defaultUriMatch == null ? UriMatchType.Domain : defaultUriMatch;
|
||||
}
|
||||
|
||||
async saveGa() {
|
||||
@ -135,6 +150,11 @@ export class OptionsComponent implements OnInit {
|
||||
window.setTimeout(() => window.location.reload(), 200);
|
||||
}
|
||||
|
||||
async saveDefaultUriMatch() {
|
||||
await this.storageService.save(ConstantsService.defaultUriMatch, this.defaultUriMatch);
|
||||
this.analytics.eventTrack.next({ action: 'Set Default URI Match ' + this.defaultUriMatch });
|
||||
}
|
||||
|
||||
private callAnalytics(name: string, enabled: boolean) {
|
||||
const status = enabled ? 'Enabled' : 'Disabled';
|
||||
this.analytics.eventTrack.next({ action: `${status} ${name}` });
|
||||
|
Loading…
Reference in New Issue
Block a user