passforios
passforios copied to clipboard
Make Distinction between ‘username’ and ‘email’ in AutoFill
Currently, when using AutoFill, for an input
element of type text
or email
, the matching entry’s field username
is filled in.
For my entries I make a distinction between username
and email
. Sometimes, a login only requires an email and no username. Such an entry would lool like this:
<super-secret-password>
email: [email protected]
URL: website.com
When I use AutoFill on website.com
, the e-mail field stays empty.
I’d propose to use the username
field if available and fall back to email
otherwise.
Unfortunately, I have almost no experience with neither Swift nor iOS development, but I’m willing to look into it.
I think passExtension/Controllers/ExtensionViewController.swift
and passExtension/passProcessor.js
are good starting points, though.
I’m happy about any further hint! :)
On a different note, many services also allow logging in with a phone number. Maybe checking for an input
element of type tel
and filling it with an appropriate field (like tel
, or phone
) might make sense too.
An interesting question would be how to be compatible with the existing logic.
public func getUsernameForCompletion() -> String {
username ?? login ?? nameFromPath ?? ""
}
I'd really like to see this feature. I might miss something, but I cannot see any downsides in adding more fields to the existing logic, e.g.
public func getUsernameForCompletion() -> String {
username ?? login ?? id ?? email ?? mail ?? tel ?? phone ?? nameFromPath ?? ""
}
(disclaimer: I use mail
😉 )
nameFromPath
is in my experience usually wrong, that's why I would put the other fields before.
A different approach could be similar to what passff does and make it configurable: https://github.com/passff/passff/blob/master/src/modules/preferences.js#L69 But that's probably much more complicated to implement.