From 6ffba9f7ff5b3549cbcef51515089e931086c796 Mon Sep 17 00:00:00 2001 From: Michael Abon Date: Fri, 18 Oct 2024 12:24:07 -0500 Subject: [PATCH] Stop password managers from autofilling address fields I am a 1Password user (and employee). Whenever I am editing a local business's details in iD, I am frustrated that the 1Password browser extension offers to fill out my personal address instead of the business's address. I don't work on our browser extension, I could not tell you why every password manager has their own custom data attribute when autocomplete=off exists. But, for fairness, I am including other major password managers' custom data attributes to stop them as well from autofilling address fields. I was very pleased to find out that there was already a well-used utility function to disable autocomplete/autocorrect/autocapitalize. Fixes #10507 --- modules/util/util.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/util/util.js b/modules/util/util.js index 1dfd007e09..84d328dcf6 100644 --- a/modules/util/util.js +++ b/modules/util/util.js @@ -509,6 +509,10 @@ export function utilNoAuto(selection) { .attr('autocomplete', 'new-password') .attr('autocorrect', 'off') .attr('autocapitalize', 'off') + .attr('data-1p-ignore', 'true') // 1Password + .attr('data-bwignore', 'true') // Bitwarden + .attr('data-form-type', 'other') // Dashlane + .attr('data-lpignore', 'true') // LastPass .attr('spellcheck', isText ? 'true' : 'false'); }