Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
fenix
Commits
63517a52
Commit
63517a52
authored
Mar 13, 2020
by
Christian Sadilek
Committed by
Arturo Mejia
Mar 13, 2020
Browse files
No issue: Remove unneeded logic to adjust TP
parent
74433ba2
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/mozilla/fenix/AppRequestInterceptor.kt
View file @
63517a52
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment