@ -30,6 +30,7 @@ import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
import org.mozilla.fenix.components.metrics.MozillaProductDetector
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.getPreferenceKey
import org.mozilla.fenix.settings.PhoneFeature
import org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataOnQuitType
@ -332,7 +333,7 @@ class Settings private constructor(
val useStrictTrackingProtection by booleanPreference (
appContext . getPreferenceKey ( R . string . pref _key _tracking _protection _strict _default ) ,
tru e
fals e
)
val useCustomTrackingProtection by booleanPreference (
@ -340,6 +341,24 @@ class Settings private constructor(
false
)
@VisibleForTesting ( otherwise = PRIVATE )
fun setStrictETP ( ) {
preferences . edit ( ) . putBoolean (
appContext . getPreferenceKey ( R . string . pref _key _tracking _protection _strict _default ) ,
true
) . apply ( )
preferences . edit ( ) . putBoolean (
appContext . getPreferenceKey ( R . string . pref _key _tracking _protection _standard _option ) ,
false
) . apply ( )
appContext ?. components ?. let {
val policy = it . core . trackingProtectionPolicyFactory
. createTrackingProtectionPolicy ( )
it . useCases . settingsUseCases . updateTrackingProtection . invoke ( policy )
it . useCases . sessionUseCases . reload . invoke ( )
}
}
val blockCookiesInCustomTrackingProtection by booleanPreference (
appContext . getPreferenceKey ( R . string . pref _key _tracking _protection _custom _cookies ) ,
true