File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed
app/src/main/java/com/duckduckgo/app/browser
common/common-utils/src/main/java/com/duckduckgo/common/utils
cookies/cookies-impl/src/main/java/com/duckduckgo/cookies/impl Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ class DuckDuckGoIndexedDBManager @Inject constructor(
9191 val host = it.name.split(" _" ).getOrNull(1 ) ? : return @filter false
9292 val isAllowed = allowedDomains.any { domain -> sameOrSubdomain(host, domain) }
9393
94- if (clearDuckAiData && sameOrSubdomain (host, DUCKDUCKGO_DOMAIN )) {
94+ if (clearDuckAiData && isFromDuckAiDomain (host)) {
9595 false
9696 } else {
9797 isAllowed
@@ -100,7 +100,11 @@ class DuckDuckGoIndexedDBManager @Inject constructor(
100100 .map { it.name }
101101 }
102102
103+ private fun isFromDuckAiDomain (domain : String ): Boolean {
104+ return DUCKDUCKGO_DOMAINS .any { sameOrSubdomain(domain, it) }
105+ }
106+
103107 companion object {
104- const val DUCKDUCKGO_DOMAIN = " duckduckgo.com"
108+ val DUCKDUCKGO_DOMAINS = listOf ( " duckduckgo.com" , " duck.ai " )
105109 }
106110}
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ class DuckDuckGoWebLocalStorageManager @Inject constructor(
8181 if (domainForMatchingAllowedKey == null ) {
8282 db.delete(entry.key)
8383 logcat { " WebLocalStorageManager: Deleted key: $key " }
84- } else if (settingsDataStore.clearDuckAiData && domainForMatchingAllowedKey == DUCKDUCKGO_DOMAIN ) {
84+ } else if (settingsDataStore.clearDuckAiData && DUCKDUCKGO_DOMAINS .contains( domainForMatchingAllowedKey) ) {
8585 if (keysToDelete.any { key.endsWith(it) }) {
8686 db.delete(entry.key)
8787 logcat { " WebLocalStorageManager: Deleted key: $key " }
@@ -105,7 +105,7 @@ class DuckDuckGoWebLocalStorageManager @Inject constructor(
105105 }
106106
107107 companion object {
108- const val DUCKDUCKGO_DOMAIN = " duckduckgo.com"
108+ val DUCKDUCKGO_DOMAINS = listOf ( " duckduckgo.com" , " duck.ai " )
109109 }
110110}
111111
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class AppUrl {
2727 const val ABOUT = " https://$HOST /about"
2828 const val PIXEL = " https://improving.duckduckgo.com"
2929 const val EMAIL_SEGMENT = " email"
30+ const val DUCK_AI = " https://duck.ai"
3031 }
3132
3233 object ParamKey {
Original file line number Diff line number Diff line change 1717package com.duckduckgo.cookies.impl
1818
1919import com.duckduckgo.common.utils.AppUrl
20+ import com.duckduckgo.common.utils.AppUrl.Url.DUCK_AI
2021import com.duckduckgo.common.utils.DispatcherProvider
2122import com.duckduckgo.cookies.api.CookieManagerProvider
2223import com.duckduckgo.cookies.api.DuckDuckGoCookieManager
@@ -90,6 +91,6 @@ class WebViewCookieManager @Inject constructor(
9091 }
9192
9293 companion object {
93- val DDG_COOKIE_DOMAINS = listOf (AppUrl .Url .COOKIES , AppUrl .Url .SURVEY_COOKIES )
94+ val DDG_COOKIE_DOMAINS = listOf (AppUrl .Url .COOKIES , AppUrl .Url .SURVEY_COOKIES , DUCK_AI )
9495 }
9596}
You can’t perform that action at this time.
0 commit comments