Commit 63517a52 authored by Christian Sadilek's avatar Christian Sadilek Committed by Arturo Mejia
Browse files

No issue: Remove unneeded logic to adjust TP

parent 74433ba2
......@@ -14,7 +14,6 @@ import mozilla.components.concept.engine.request.RequestInterceptor
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.isOnline
import org.mozilla.fenix.ext.settings
class AppRequestInterceptor(private val context: Context) : RequestInterceptor {
override fun onLoadRequest(
......@@ -23,7 +22,6 @@ class AppRequestInterceptor(private val context: Context) : RequestInterceptor {
hasUserGesture: Boolean,
isSameDomain: Boolean
): RequestInterceptor.InterceptionResponse? {
adjustTrackingProtection(context, engineSession)
var result: RequestInterceptor.InterceptionResponse? = null
// WebChannel-driven authentication does not require a separate redirect interceptor.
......@@ -41,19 +39,6 @@ class AppRequestInterceptor(private val context: Context) : RequestInterceptor {
return result
}
private fun adjustTrackingProtection(context: Context, session: EngineSession) {
val trackingProtectionEnabled = context.settings().shouldUseTrackingProtection
if (!trackingProtectionEnabled) {
session.disableTrackingProtection()
} else {
val core = context.components.core
val policy = core.trackingProtectionPolicyFactory
.createTrackingProtectionPolicy(normalMode = true)
core.engine.settings.trackingProtectionPolicy = policy
session.enableTrackingProtection(policy)
}
}
override fun onErrorRequest(
session: EngineSession,
errorType: ErrorType,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment