mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-22 11:35:21 +01:00
add duckduckgo support
This commit is contained in:
parent
8cd3a21468
commit
6afccc2aea
@ -14,7 +14,7 @@ namespace Bit.Android.Autofill
|
||||
"com.opera.browser.beta","com.opera.mini.native","com.chrome.dev","com.chrome.canary",
|
||||
"com.google.android.apps.chrome","com.google.android.apps.chrome_dev","com.yandex.browser",
|
||||
"com.sec.android.app.sbrowser","com.sec.android.app.sbrowser.beta","org.codeaurora.swe.browser",
|
||||
"com.amazon.cloud9","org.mozilla.klar"
|
||||
"com.amazon.cloud9","org.mozilla.klar", "com.duckduckgo.mobile.android"
|
||||
};
|
||||
|
||||
private readonly AssistStructure _structure;
|
||||
@ -87,6 +87,11 @@ namespace Bit.Android.Autofill
|
||||
var node = _structure.GetWindowNodeAt(i);
|
||||
ParseNode(node.RootViewNode);
|
||||
}
|
||||
|
||||
if(!TrustedBrowsers.Contains(PackageName))
|
||||
{
|
||||
WebDomain = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void ParseNode(ViewNode node)
|
||||
@ -95,11 +100,11 @@ namespace Bit.Android.Autofill
|
||||
var isEditText = node.ClassName == "android.widget.EditText" || node?.HtmlInfo?.Tag == "input";
|
||||
if(isEditText || (hints?.Length ?? 0) > 0)
|
||||
{
|
||||
if(PackageName == null)
|
||||
if(string.IsNullOrWhiteSpace(PackageName))
|
||||
{
|
||||
PackageName = node.IdPackage;
|
||||
}
|
||||
if(WebDomain == null && TrustedBrowsers.Contains(node.IdPackage))
|
||||
if(string.IsNullOrWhiteSpace(WebDomain))
|
||||
{
|
||||
WebDomain = node.WebDomain;
|
||||
}
|
||||
@ -108,7 +113,7 @@ namespace Bit.Android.Autofill
|
||||
}
|
||||
else
|
||||
{
|
||||
if(WebDomain == null && TrustedBrowsers.Contains(node.IdPackage))
|
||||
if(string.IsNullOrWhiteSpace(WebDomain))
|
||||
{
|
||||
WebDomain = node.WebDomain;
|
||||
}
|
||||
|
@ -60,7 +60,8 @@ namespace Bit.Android
|
||||
new Browser("com.ksmobile.cb", "address_bar_edit_text"),
|
||||
new Browser("acr.browser.lightning", "search"),
|
||||
new Browser("acr.browser.barebones", "search"),
|
||||
new Browser("com.microsoft.emmx", "url_bar")
|
||||
new Browser("com.microsoft.emmx", "url_bar"),
|
||||
new Browser("com.duckduckgo.mobile.android", "omnibarTextInput")
|
||||
}.ToDictionary(n => n.PackageName);
|
||||
|
||||
private readonly IAppSettingsService _appSettings;
|
||||
|
Loading…
Reference in New Issue
Block a user