1
0
Fork 0

No issue: Remove unneeded logic to adjust TP

master
Christian Sadilek 2020-03-13 11:57:04 -04:00 committed by Arturo Mejia
parent 74433ba27a
commit 63517a52e4
1 changed files with 0 additions and 15 deletions

View File

@ -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,