luci-base: ui.js: set `autocomplete="new-password"` for password fields
authorJo-Philipp Wich <[email protected]>
Wed, 7 Jun 2023 21:40:04 +0000 (23:40 +0200)
committerJo-Philipp Wich <[email protected]>
Wed, 7 Jun 2023 21:40:04 +0000 (23:40 +0200)
Attempt to prevent Firefox from randomly filling nonesense into arbitrary
password fields such as the WireGuard private key field by setting the
`autocomplete="new-password"` attribute on any password type fields.

Signed-off-by: Jo-Philipp Wich <[email protected]>
modules/luci-base/htdocs/luci-static/resources/ui.js

index 9ecadb0cf84a56ef9045a97d7a6b300031dbb2ff..2e697aa190071f71c97af9f3449e6c2c1fe58162 100644 (file)
@@ -374,6 +374,7 @@ var UITextfield = UIElement.extend(/** @lends LuCI.ui.Textfield.prototype */ {
                        'disabled': this.options.disabled ? '' : null,
                        'maxlength': this.options.maxlength,
                        'placeholder': this.options.placeholder,
+                       'autocomplete': this.options.password ? 'new-password' : null,
                        'value': this.value,
                });