Add setting options to enable auto submit fill and totp

This commit is contained in:
AKORA 2024-10-06 19:43:04 +02:00
parent 325fe1f3ee
commit 9a07a9d7c5
2 changed files with 24 additions and 3 deletions

View file

@ -741,6 +741,9 @@
<th scope="col"><span data-i18n="optionsColumnUsernameOnly"></span></th>
<th scope="col"><span data-i18n="optionsColumnImprovedInputFieldDetection"></span></th>
<th scope="col"><span data-i18n="optionsColumnAllowIframes"></span></th>
<th scope="col"><span data-i18n="optionsCheckboxAutoSubmit"></span></th>
<th scope="col"><span data-i18n="optionsCheckboxAutoFillSingleEntry"></span></th>
<th scope="col"><span data-i18n="optionsCheckboxAutoFillSingleTotp"></span></th>
<th scope="col"><span data-i18n="optionsColumnDelete"></span></th>
</tr>
</thead>
@ -761,6 +764,9 @@
<td><input class="form-check-input" type="checkbox" name="usernameOnly" value="false" data-i18n="[title]optionsColumnUsernameOnly"></td>
<td><input class="form-check-input" type="checkbox" name="improvedFieldDetection" value="false" data-i18n="[title]optionsColumnImprovedInputFieldDetection"></td>
<td><input class="form-check-input" type="checkbox" name="allowIframes" value="false" data-i18n="[title]optionsColumnAllowIframes"></td>
<td><input class="form-check-input" type="checkbox" name="autoSubmit" value="false" data-i18n="[title]optionsColumnAutoSubmit"></td>
<td><input class="form-check-input" type="checkbox" name="autoFillCredentials" value="false" data-i18n="[title]optionsColumnAutoFillCredentials"></td>
<td><input class="form-check-input" type="checkbox" name="autoFillTOTP" value="false" data-i18n="[title]optionsColumnAutoFillTOTP"></td>
<td class="text-nowrap">
<button class="btn btn-sm delete btn-danger btn" data-i18n="[title]removeSitePreferencesButtonTitle">
<i class="fa fa-remove" aria-hidden="true"></i>

View file

@ -545,6 +545,12 @@ options.initSitePreferences = function() {
site.improvedFieldDetection = this.checked;
} else if (this.name === 'allowIframes') {
site.allowIframes = this.checked;
} else if (this.name === 'autoSubmit') {
site.autoSubmit = this.checked;
} else if (this.name === 'autoFillCredentials') {
site.autoFillCredentials = this.checked;
} else if (this.name === 'autoFillTOTP') {
site.autoFillTOTP = this.checked;
}
}
}
@ -565,7 +571,7 @@ options.initSitePreferences = function() {
options.saveSettings();
};
const addNewRow = function(rowClone, newIndex, url, ignore, usernameOnly, improvedFieldDetection, allowIframes) {
const addNewRow = function(rowClone, newIndex, url, ignore, usernameOnly, improvedFieldDetection, allowIframes, autoSubmit, autoFillCredentials, autoFillTOTP) {
const row = rowClone.cloneNode(true);
row.setAttribute('url', url);
row.setAttribute('id', 'tr-scf' + newIndex);
@ -578,7 +584,13 @@ options.initSitePreferences = function() {
row.children[3].children['improvedFieldDetection'].addEventListener('change', checkboxClicked);
row.children[4].children['allowIframes'].checked = allowIframes;
row.children[4].children['allowIframes'].addEventListener('change', checkboxClicked);
row.children[5].addEventListener('click', removeButtonClicked);
row.children[5].children['autoSubmit'].checked = autoSubmit;
row.children[5].children['autoSubmit'].addEventListener('change', checkboxClicked);
row.children[6].children['autoFillCredentials'].checked = autoFillCredentials;
row.children[6].children['autoFillCredentials'].addEventListener('change', checkboxClicked);
row.children[7].children['autoFillTOTP'].checked = autoFillTOTP;
row.children[7].children['autoFillTOTP'].addEventListener('change', checkboxClicked);
row.children[8].addEventListener('click', removeButtonClicked);
$('#tab-site-preferences table tbody').append(row);
};
@ -638,7 +650,7 @@ options.initSitePreferences = function() {
const rowClone = $('#tab-site-preferences table tr.clone').cloneNode(true);
rowClone.classList.remove('clone', 'd-none');
addNewRow(rowClone, newIndex, value, IGNORE_NOTHING, false, false, false);
addNewRow(rowClone, newIndex, value, IGNORE_NOTHING, false, false, false, false, false, false);
$('#tab-site-preferences table tbody tr.empty').hide();
options.settings['sitePreferences'].push({
@ -665,6 +677,9 @@ options.initSitePreferences = function() {
site.usernameOnly,
site.improvedFieldDetection,
site.allowIframes,
site.autoSubmit,
site.autoFillCredentials,
site.autoFillTOTP,
);
++counter;
}