mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Update UI strings, remove autofillOnPageLoad enum
This commit is contained in:
@@ -892,25 +892,19 @@
|
|||||||
"message": "This is currently an experimental feature. Use at your own risk."
|
"message": "This is currently an experimental feature. Use at your own risk."
|
||||||
},
|
},
|
||||||
"defaultAutoFillOnPageLoad": {
|
"defaultAutoFillOnPageLoad": {
|
||||||
"message": "Default auto-fill on page load setting"
|
"message": "Default login setting"
|
||||||
},
|
|
||||||
"globalAutoFillOnPageLoadAlways": {
|
|
||||||
"message": "Always auto-fill"
|
|
||||||
},
|
|
||||||
"globalAutoFillOnPageLoadNever": {
|
|
||||||
"message": "Never auto-fill"
|
|
||||||
},
|
},
|
||||||
"itemAutoFillOnPageLoad": {
|
"itemAutoFillOnPageLoad": {
|
||||||
"message": "Auto-fill On Page Load (if enabled)"
|
"message": "Auto-fill On Page Load (if enabled in Options)"
|
||||||
},
|
},
|
||||||
"itemAutoFillOnPageLoadUseGlobal": {
|
"autoFillOnPageLoadUseDefault": {
|
||||||
"message": "Use default setting"
|
"message": "Use default setting"
|
||||||
},
|
},
|
||||||
"itemAutoFillOnPageLoadAlways": {
|
"autoFillOnPageLoadYes": {
|
||||||
"message": "Always auto-fill this login"
|
"message": "Auto-fill"
|
||||||
},
|
},
|
||||||
"itemAutoFillOnPageLoadNever": {
|
"autoFillOnPageLoadNo": {
|
||||||
"message": "Never auto-fill this login"
|
"message": "Do not auto-fill"
|
||||||
},
|
},
|
||||||
"commandOpenPopup": {
|
"commandOpenPopup": {
|
||||||
"message": "Open vault popup"
|
"message": "Open vault popup"
|
||||||
|
|||||||
@@ -3,8 +3,12 @@ document.addEventListener('DOMContentLoaded', event => {
|
|||||||
let filledThisHref = false;
|
let filledThisHref = false;
|
||||||
let delayFillTimeout: number;
|
let delayFillTimeout: number;
|
||||||
|
|
||||||
setInterval(() => doFillIfNeeded(), 500);
|
const enabledKey = 'enableAutoFillOnPageLoad';
|
||||||
|
chrome.storage.local.get(enabledKey, (obj: any) => {
|
||||||
|
if (obj != null && obj[enabledKey] === true) {
|
||||||
|
setInterval(() => doFillIfNeeded(), 500);
|
||||||
|
}
|
||||||
|
});
|
||||||
chrome.runtime.onMessage.addListener((msg: any, sender: any, sendResponse: Function) => {
|
chrome.runtime.onMessage.addListener((msg: any, sender: any, sendResponse: Function) => {
|
||||||
if (msg.command === 'fillForm' && pageHref === msg.url) {
|
if (msg.command === 'fillForm' && pageHref === msg.url) {
|
||||||
filledThisHref = true;
|
filledThisHref = true;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<div class="sub-option">
|
<div class="sub-option">
|
||||||
<label for="defaultAutofill">{{'defaultAutoFillOnPageLoad' | i18n}}</label>
|
<label for="defaultAutofill">{{'defaultAutoFillOnPageLoad' | i18n}}</label>
|
||||||
<select id="defaultAutofill" name="DefaultAutofill" [(ngModel)]="autoFillOnPageLoadDefault"
|
<select id="defaultAutofill" name="DefaultAutofill" [(ngModel)]="autoFillOnPageLoadDefault"
|
||||||
[disabled]="!enableAutoFillOnPageLoad">
|
(change)="updateAutoFillOnPageLoadDefault()" [disabled]="!enableAutoFillOnPageLoad">
|
||||||
<option *ngFor="let o of autoFillOnPageLoadOptions" [ngValue]="o.value">{{o.name}}</option>
|
<option *ngFor="let o of autoFillOnPageLoadOptions" [ngValue]="o.value">{{o.name}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -67,14 +67,17 @@ export class OptionsComponent implements OnInit {
|
|||||||
{ name: i18nService.t('fiveMinutes'), value: 300 },
|
{ name: i18nService.t('fiveMinutes'), value: 300 },
|
||||||
];
|
];
|
||||||
this.autoFillOnPageLoadOptions = [
|
this.autoFillOnPageLoadOptions = [
|
||||||
{ name: i18nService.t('globalAutoFillOnPageLoadAlways'), value: true },
|
{ name: i18nService.t('autoFillOnPageLoadYes'), value: true },
|
||||||
{ name: i18nService.t('globalAutoFillOnPageLoadNever'), value: false },
|
{ name: i18nService.t('autoFillOnPageLoadNo'), value: false },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.enableAutoFillOnPageLoad = await this.storageService.get<boolean>(
|
this.enableAutoFillOnPageLoad = await this.storageService.get<boolean>(
|
||||||
ConstantsService.enableAutoFillOnPageLoadKey);
|
ConstantsService.enableAutoFillOnPageLoadKey);
|
||||||
|
|
||||||
|
this.autoFillOnPageLoadDefault = await this.storageService.get<boolean>(
|
||||||
|
ConstantsService.autoFillOnPageLoadDefaultKey) ?? false;
|
||||||
|
|
||||||
this.disableAddLoginNotification = await this.storageService.get<boolean>(
|
this.disableAddLoginNotification = await this.storageService.get<boolean>(
|
||||||
ConstantsService.disableAddLoginNotificationKey);
|
ConstantsService.disableAddLoginNotificationKey);
|
||||||
@@ -129,6 +132,10 @@ export class OptionsComponent implements OnInit {
|
|||||||
this.callAnalytics('Auto-fill Page Load', this.enableAutoFillOnPageLoad);
|
this.callAnalytics('Auto-fill Page Load', this.enableAutoFillOnPageLoad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async updateAutoFillOnPageLoadDefault() {
|
||||||
|
await this.storageService.save(ConstantsService.autoFillOnPageLoadDefaultKey, this.autoFillOnPageLoadDefault);
|
||||||
|
}
|
||||||
|
|
||||||
async updateDisableFavicon() {
|
async updateDisableFavicon() {
|
||||||
await this.storageService.save(ConstantsService.disableFaviconKey, this.disableFavicon);
|
await this.storageService.save(ConstantsService.disableFaviconKey, this.disableFavicon);
|
||||||
await this.stateService.save(ConstantsService.disableFaviconKey, this.disableFavicon);
|
await this.stateService.save(ConstantsService.disableFaviconKey, this.disableFavicon);
|
||||||
|
|||||||
Reference in New Issue
Block a user