[KnownUsernameField] Compatibility with more browsers (#1000)

This commit is contained in:
Contribucious 2020-07-01 16:31:12 +02:00 committed by GitHub
parent b9e5fc604b
commit 1bb678e455
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -308,11 +308,13 @@ namespace Bit.Droid.Accessibility
public static AccessibilityNodeInfo GetUsernameEditText(string uriString, public static AccessibilityNodeInfo GetUsernameEditText(string uriString,
IEnumerable<AccessibilityNodeInfo> allEditTexts) IEnumerable<AccessibilityNodeInfo> allEditTexts)
{ {
string uriAuthority = null;
string uriKey = null; string uriKey = null;
string uriLocalPath = null; string uriLocalPath = null;
if (Uri.TryCreate(uriString, UriKind.Absolute, out var uri)) if (Uri.TryCreate(uriString, UriKind.Absolute, out var uri))
{ {
uriKey = uri.Authority; uriAuthority = uri.Authority;
uriKey = uriAuthority.StartsWith("www.") ? uriAuthority.Substring(4) : uriAuthority;
uriLocalPath = uri.LocalPath; uriLocalPath = uri.LocalPath;
} }