mozilla-mobile / firefox-ios

Firefox for iOS
Mozilla Public License 2.0
12.14k stars 2.91k forks source link

Firefox can't autofill saved username if the user has more than one saved username for that website #19477

Open cpeterso opened 5 months ago

cpeterso commented 5 months ago

I discovered this bug when verifying the fix for bug https://github.com/mozilla-mobile/firefox-ios/issues/15207, where Firefox autofill was suggesting the wrong saved username.

Steps to reproduce

  1. Open a new private browsing tab.
  2. Load google.com.
  3. Tap the “Sign in” button.
  4. You are redirected from www.google.com to accounts.google.com.
  5. Tap the "Email or phone" field.
  6. Tap keyboard's "Passwords" button to open your list of saved usernames and passwords.
  7. Select a username to fill.

Expected behavior

Firefox should fill the selected username into the page's "Email or phone" field.

Actual behavior

Firefox does not fill the selected username into the page's "Email or phone" field. If you manually enter a username and proceed to Google's password page, Firefox can successfully fill in your selected password. So it seems as if something about Google's "Email or phone" field that is confusing Firefox's autofill.

Device & build information

┆Issue is synchronized with this Jira Task

afurlan-firefox commented 5 months ago

@cpeterso can you upload a video of this? Are you seeing this with the new feature? Thanks!

data-sync-user commented 5 months ago

➤ Norberto Andres Furlan commented:

Diana Andreea Barladeanu can you check this one? Thanks!

cpeterso commented 5 months ago

Here’s a screen recording.

https://github.com/mozilla-mobile/firefox-ios/assets/629193/adfba33a-aa53-4dec-9988-87fa188762a6

razvanlitianu commented 4 months ago

https://github.com/mozilla-mobile/firefox-ios/assets/26011662/bafcdf6c-14c5-4edc-b62b-eba7efde30eb

I've been looking at this and I encounter a weird issue. For third party browsers keychain does not offer the suggestion @cpeterso is seeing. I'm wondering why is this broken for me.

cpeterso commented 4 months ago

I also see this bug on twitter.com. I have multiple saved passwords for both Google and Twitter, so perhaps this username autofill problem is related to that (like https://github.com/mozilla-mobile/firefox-ios/issues/15207)? I tested some websites where I only have one saved password and username autofill works there.

razvanlitianu commented 4 months ago

hey @cpeterso. I did some investigation yesterday, not yet a fix but more questions appeared. Testing on a iPhone 15 Pro on 17.4.1 I was able to see the suggestion and as you can see I am able to tap and autofill, the issue is if I tap on the key to see a list of all available password and select a new password the autofill fails, and the keyboard suggestions also starts failing. Imo this is a iOS issue since we don't do anything to support the system autofill feature and it's different then our own custom implementation.

https://github.com/mozilla-mobile/firefox-ios/assets/26011662/5035c386-4b98-4591-a908-b01395ec7896

cpeterso commented 4 months ago

I can reproduce the flashing keyboard suggestions in your video if I attempt to autofill from the Passwords screen, but I think that is a separate problem. At time 0:11 in your video, autofill successfully filled your email address from the first keyboard suggestion into Google's email field, but that doesn't work for me.

data-sync-user commented 4 months ago

➤ Norberto Andres Furlan commented:

Chris Peterson in what version are you?

cpeterso commented 4 months ago

Chris Peterson in what version are you?

TestFlight Nightly build 9000 (41294)

I can still reproduce the username autofill problem, but I can no longer reproduce the flashing keyboard suggestions because when I test, tapping the "password for www.google.com" keyboard suggestion attempts to Face ID authenticate me so it can open the password manager.

data-sync-user commented 4 months ago

➤ Razvan Litianu commented:

Norberto Andres Furlan I took a look again at this and sadly there’s not much we can do since it’s about the iOS native autofill. It seems that for some versions of iOS it works for some it doesn’t so it might be something related either to the webkit not being able to find the field or the google website not marking correctly the fields.

cpeterso commented 4 months ago

there’s not much we can do since it’s about the iOS native autofill. It seems that for some versions of iOS it works for some it doesn’t so it might be something related either to the webkit not being able to find the field or the google website not marking correctly the fields.

FWIW, while using Firefox as my default system password manager, I can reproduce this autofill bug in Chrome on iOS, but it works fine in Safari.