mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 18:38:27 +03:00
Support for multiple browser UriViewIds when extracting a uri (#713)
* Support for multiple browser UriViewIds when extracting a uri * Simplified
This commit is contained in:
parent
4b9cff2271
commit
179514ddf1
1 changed files with 12 additions and 3 deletions
|
@ -40,7 +40,7 @@ namespace Bit.Droid.Accessibility
|
||||||
new Browser("org.iron.srware", "url_bar"),
|
new Browser("org.iron.srware", "url_bar"),
|
||||||
new Browser("com.sec.android.app.sbrowser", "location_bar_edit_text"),
|
new Browser("com.sec.android.app.sbrowser", "location_bar_edit_text"),
|
||||||
new Browser("com.sec.android.app.sbrowser.beta", "location_bar_edit_text"),
|
new Browser("com.sec.android.app.sbrowser.beta", "location_bar_edit_text"),
|
||||||
new Browser("com.yandex.browser", "bro_omnibar_address_title_text",
|
new Browser("com.yandex.browser", "bro_omnibar_address_title_text,bro_omnibox_collapsed_title",
|
||||||
(s) => s.Split(new char[]{' ', ' '}).FirstOrDefault()), // 0 = Regular Space, 1 = No-break space (00A0)
|
(s) => s.Split(new char[]{' ', ' '}).FirstOrDefault()), // 0 = Regular Space, 1 = No-break space (00A0)
|
||||||
new Browser("org.mozilla.firefox", "url_bar_title"),
|
new Browser("org.mozilla.firefox", "url_bar_title"),
|
||||||
new Browser("org.mozilla.firefox_beta", "url_bar_title"),
|
new Browser("org.mozilla.firefox_beta", "url_bar_title"),
|
||||||
|
@ -115,8 +115,17 @@ namespace Bit.Droid.Accessibility
|
||||||
if(SupportedBrowsers.ContainsKey(root.PackageName))
|
if(SupportedBrowsers.ContainsKey(root.PackageName))
|
||||||
{
|
{
|
||||||
var browser = SupportedBrowsers[root.PackageName];
|
var browser = SupportedBrowsers[root.PackageName];
|
||||||
var addressNode = root.FindAccessibilityNodeInfosByViewId(
|
AccessibilityNodeInfo addressNode = null;
|
||||||
$"{root.PackageName}:id/{browser.UriViewId}").FirstOrDefault();
|
foreach(var uriViewId in browser.UriViewId.Split(","))
|
||||||
|
{
|
||||||
|
addressNode = root.FindAccessibilityNodeInfosByViewId(
|
||||||
|
$"{root.PackageName}:id/{uriViewId}").FirstOrDefault();
|
||||||
|
if(addressNode != null)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(addressNode != null)
|
if(addressNode != null)
|
||||||
{
|
{
|
||||||
uri = ExtractUri(uri, addressNode, browser);
|
uri = ExtractUri(uri, addressNode, browser);
|
||||||
|
|
Loading…
Reference in a new issue