Skip to content

Commit e914024

Browse files
author
Sami Vänttinen
authored
Merge pull request #1857 from keepassxreboot/fix/allow_fill_to_string_fields
Allow force-fill to String Fields even if readonly
2 parents 3b582ff + 474623e commit e914024

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

keepassxc-browser/content/fill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ kpxcFill.fillInStringFields = function(fields, stringFields) {
288288
const currentField = fields[i];
289289

290290
if (currentField && stringFieldValue[0]) {
291-
kpxc.setValue(currentField, stringFieldValue[0]);
291+
kpxc.setValue(currentField, stringFieldValue[0], true);
292292
filledInFields.push(currentField);
293293
}
294294
}

keepassxc-browser/content/keepassxc-browser.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ kpxc.setPasswordFilled = async function(state) {
643643
};
644644

645645
// Special handling for settings value to select element
646-
kpxc.setValue = function(field, value) {
646+
kpxc.setValue = function(field, value, forced = false) {
647647
if (field.matches('select')) {
648648
value = value.toLowerCase().trim();
649649
const options = field.querySelectorAll('option');
@@ -658,12 +658,12 @@ kpxc.setValue = function(field, value) {
658658
return;
659659
}
660660

661-
kpxc.setValueWithChange(field, value);
661+
kpxc.setValueWithChange(field, value, forced);
662662
};
663663

664664
// Sets a new value to input field and triggers necessary events
665-
kpxc.setValueWithChange = function(field, value) {
666-
if (field.readOnly) {
665+
kpxc.setValueWithChange = function(field, value, forced = false) {
666+
if (!forced && field.readOnly) {
667667
return;
668668
}
669669

0 commit comments

Comments
 (0)