Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): prevent password manager autofill on filename inputs #357

Merged
merged 2 commits into from
Dec 15, 2024

Conversation

s0up4200
Copy link
Contributor

@s0up4200 s0up4200 commented Oct 27, 2024

The filename input fields do not contain sensitive information and should not be managed by password managers or browser autofill. This PR adds multiple attributes to prevent unwanted autofill behavior:

  • data-1p-ignore: Prevents 1Password autofill
  • data-lpignore: Prevents LastPass autofill
  • data-bwignore: Prevents Bitwarden autofill
  • autocomplete="off": Prevents browser native autofill

These changes improve the user experience by ensuring filename inputs remain clean and unaffected by password management tools.

https://developer.1password.com/docs/web/compatible-website-design/
https://community.bitwarden.com/t/where-is-the-developer-information/31547/3
https://stackoverflow.com/questions/20954944/stop-lastpass-filling-out-a-form

The bug:
image

The fix:
image

@thomiceli
Copy link
Owner

Nice idea, but is there an attribute common to all password managers ? Some standard or whatever ?

@s0up4200
Copy link
Contributor Author

s0up4200 commented Oct 31, 2024

Thanks for the reply!

I believe these are the common ones after some research. We've seen little effect of the autocomplete=off for 1Password in our own projects.

1Password
data-1p-ignore

LastPass
data-lpignore

Bitwarden
data-bwignore

General use
autocomplete="off"

- Add autocomplete="off" to prevent browser autofill
- Add data-lpignore for LastPass compatibility
- Add data-bwignore for Bitwarden compatibility
@s0up4200 s0up4200 changed the title feat(web): add data-1p-ignore attribute to ignore fields feat(web): prevent password manager autofill on filename inputs Dec 6, 2024
@s0up4200
Copy link
Contributor Author

s0up4200 commented Dec 6, 2024

Added the rest now. These are the most common ones, and believe most other managers respect the autocomplete="off" attribute.

@thomiceli thomiceli merged commit 00951bf into thomiceli:master Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants