mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Fix password fill
This commit is contained in:
parent
0399c63f69
commit
9785b20d82
2 changed files with 4 additions and 11 deletions
|
|
@ -88,12 +88,12 @@ browser.runtime.onMessage.addListener(function(req, sender) {
|
|||
});
|
||||
|
||||
function _f(fieldId) {
|
||||
const inputs = document.querySelectorAll('input[data-kpxc-id=\'' + fieldId + '\']');
|
||||
const inputs = document.querySelectorAll(`input[data-kpxc-id='${fieldId}']`);
|
||||
return inputs.length > 0 ? inputs[0] : null;
|
||||
}
|
||||
|
||||
function _fs(fieldId) {
|
||||
const inputs = document.querySelectorAll('input[data-kpxc-id=\'' + fieldId + '\'], select[data-kpxc-id=\'' + fieldId + '\']');
|
||||
const inputs = document.querySelectorAll(`input[data-kpxc-id='${fieldId}'], select[data-kpxc-id='${fieldId}']`);
|
||||
return inputs.length > 0 ? inputs[0] : null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -267,15 +267,8 @@ kpxcPassword.copy = function(e) {
|
|||
kpxcPassword.fill = function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
let field = null;
|
||||
const inputs = document.querySelectorAll('input[type=\'password\']');
|
||||
for (const i of inputs) {
|
||||
if (i.getAttribute('data-kpxc-id')) {
|
||||
field = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Use the active input field
|
||||
const field = _f(kpxcPassword.dialog.getAttribute('kpxc-pwgen-field-id'));
|
||||
if (field) {
|
||||
const password = $('.kpxc-pwgen-input');
|
||||
if (field.getAttribute('maxlength')) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue