Fix backup key and filter field being autofilled as logins #1200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Firefox misinterprets the backup key field on the settings page and the room filter field as a pair of username-password login fields. It then autofills a username in the filter field each time the settings page is opened.
The only working fix is to mark both fields as "autocomplete: new-password" because Firefox ignores all other directives. I still added the proper attributes to both fields just in case the major browsers will decide to follow the spec one day.
The "readonly" hack is included for completeness. It may improve compatibility with older browsers where one of the other tricks fails.
The same fix is intended in #616 but I think my code is more semantically correct in this case. What's even more important, #616 doesn't fix the issue on my end using Firefox 132 and older.
Fixes #380.
Fixes hydrogen-sailfishos/harbour-hydrogen#41.