2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-15 18:12:54 +00:00

Bug 1862425 - Allow to control QPS prefs using nimbus.

This commit is contained in:
Arturo Mejia 2023-11-02 21:35:07 -04:00 committed by mergify[bot]
parent d5e7d61e8d
commit 4f48bf646b
3 changed files with 83 additions and 4 deletions

View File

@ -232,7 +232,38 @@ features:
"jump-back-in-cfr": true,
}
}
query-parameter-stripping:
description: Features for query parameter stripping.
variables:
sections-enabled:
description: "This property provides a lookup table of whether or not the given section should be enabled."
type: Map<QueryParameterStrippingSection, String>
default:
{
"query-parameter-stripping": "0",
"query-parameter-stripping-pmb": "0",
"query-parameter-stripping-allow-list": "",
"query-parameter-stripping-strip-list": "",
}
defaults:
- channel: developer
value: {
"sections-enabled": {
"query-parameter-stripping": "0",
"query-parameter-stripping-pmb": "0",
"query-parameter-stripping-allow-list": "",
"query-parameter-stripping-strip-list": "",
}
}
- channel: nightly
value: {
"sections-enabled": {
"query-parameter-stripping": "0",
"query-parameter-stripping-pmb": "0",
"query-parameter-stripping-allow-list": "",
"query-parameter-stripping-strip-list": "",
}
}
cookie-banners:
description: Features for cookie banner handling.
variables:
@ -246,7 +277,7 @@ features:
"feature-setting-value-pbm": 0,
"feature-setting-detect-only": 0,
"feature-setting-global-rules": 0,
"feature-setting-global-rules-sub-frames": 0
"feature-setting-global-rules-sub-frames": 0,
}
defaults:
- channel: developer
@ -257,7 +288,7 @@ features:
"feature-setting-value-pbm": 0,
"feature-setting-detect-only": 0,
"feature-setting-global-rules": 0,
"feature-setting-global-rules-sub-frames": 0
"feature-setting-global-rules-sub-frames": 0,
}
}
- channel: nightly
@ -268,7 +299,7 @@ features:
"feature-setting-value-pbm": 0,
"feature-setting-detect-only": 0,
"feature-setting-global-rules": 0,
"feature-setting-global-rules-sub-frames": 0
"feature-setting-global-rules-sub-frames": 0,
}
}
unified-search:
@ -478,6 +509,25 @@ types:
description: An integer either 0 or 1 indicating if cookie banner global rules sub-frames
should be enabled or disabled. 0 for setting to be disabled, and 1 for enabling the setting.
QueryParameterStrippingSection:
description: The identifiers for the options for the Query Parameter Stripping feature.
variants:
query-parameter-stripping:
description: An integer either 0 or 1 indicating if query parameter stripping
should be enabled or disabled in normal mode. 0 for setting to be disabled,
and 1 for enabling the setting.
query-parameter-stripping-pmb:
description: An integer either 0 or 1 indicating if query parameter stripping
should be enabled or disabled in private mode. 0 for setting to be disabled,
and 1 for enabling the setting.
query-parameter-stripping-allow-list:
description: An string separated by commas indicating the sites where should
from query stripping should be exempted.
query-parameter-stripping-strip-list:
description: An string separated by commas indicating the list of query params
to be stripped from URIs. This list will be merged with records
coming from RemoteSettings.
OnboardingPanel:
description: The types of onboarding panels in the onboarding page
variants:

View File

@ -121,6 +121,14 @@ object GeckoProvider {
context.settings().shouldEnableCookieBannerGlobalRules,
cookieBannerGlobalRulesSubFramesEnabled =
context.settings().shouldEnableCookieBannerGlobalRulesSubFrame,
queryParameterStripping =
context.settings().shouldEnableQueryParameterStripping,
queryParameterStrippingPrivateBrowsing =
context.settings().shouldEnableQueryParameterStrippingPrivateBrowsing,
queryParameterStrippingAllowList =
context.settings().queryParameterStrippingAllowList,
queryParameterStrippingStripList =
context.settings().queryParameterStrippingStripList,
),
)
.consoleOutput(context.components.settings.enableGeckoLogs)

View File

@ -46,6 +46,11 @@ import org.mozilla.fenix.nimbus.CookieBannersSection
import org.mozilla.fenix.nimbus.FxNimbus
import org.mozilla.fenix.nimbus.HomeScreenSection
import org.mozilla.fenix.nimbus.Mr2022Section
import org.mozilla.fenix.nimbus.QueryParameterStrippingSection
import org.mozilla.fenix.nimbus.QueryParameterStrippingSection.QUERY_PARAMETER_STRIPPING
import org.mozilla.fenix.nimbus.QueryParameterStrippingSection.QUERY_PARAMETER_STRIPPING_ALLOW_LIST
import org.mozilla.fenix.nimbus.QueryParameterStrippingSection.QUERY_PARAMETER_STRIPPING_PMB
import org.mozilla.fenix.nimbus.QueryParameterStrippingSection.QUERY_PARAMETER_STRIPPING_STRIP_LIST
import org.mozilla.fenix.settings.PhoneFeature
import org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataOnQuitType
import org.mozilla.fenix.settings.logins.SavedLoginsSortingStrategyMenu
@ -635,6 +640,18 @@ class Settings(private val appContext: Context) : PreferencesHolder {
val shouldEnableCookieBannerGlobalRulesSubFrame: Boolean
get() = cookieBannersSection[CookieBannersSection.FEATURE_SETTING_GLOBAL_RULES_SUB_FRAMES] == 1
val shouldEnableQueryParameterStripping: Boolean
get() = queryParameterStrippingSection[QUERY_PARAMETER_STRIPPING] == "1"
val shouldEnableQueryParameterStrippingPrivateBrowsing: Boolean
get() = queryParameterStrippingSection[QUERY_PARAMETER_STRIPPING_PMB] == "1"
val queryParameterStrippingAllowList: String
get() = queryParameterStrippingSection[QUERY_PARAMETER_STRIPPING_ALLOW_LIST].orEmpty()
val queryParameterStrippingStripList: String
get() = queryParameterStrippingSection[QUERY_PARAMETER_STRIPPING_STRIP_LIST].orEmpty()
/**
* Declared as a function for performance purposes. This could be declared as a variable using
* booleanPreference like other members of this class. However, doing so will make it so it will
@ -1473,6 +1490,10 @@ class Settings(private val appContext: Context) : PreferencesHolder {
get() =
FxNimbus.features.cookieBanners.value().sectionsEnabled
private val queryParameterStrippingSection: Map<QueryParameterStrippingSection, String>
get() =
FxNimbus.features.queryParameterStripping.value().sectionsEnabled
private val homescreenSections: Map<HomeScreenSection, Boolean>
get() =
FxNimbus.features.homescreen.value().sectionsEnabled