From ce34ace9c0f972e5391a6544e3f632bb2be35e81 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 7 Jun 2023 23:40:04 +0200 Subject: [PATCH] luci-base: ui.js: set `autocomplete="new-password"` for password fields 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 (cherry picked from commit 23a246e4b4d0a0959d16a1add3868361b78f3021) --- modules/luci-base/htdocs/luci-static/resources/ui.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index b35a51ce64..29810d5798 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -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, }); -- 2.30.2