This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Enhanced Tracking Protection * Updated naming to Enhanced Tracking protection and Standard
- Loading branch information
Showing
44 changed files
with
1,142 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
app/src/common/shared/org/mozilla/vrbrowser/browser/content/TrackingProtectionPolicy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package org.mozilla.vrbrowser.browser.content; | ||
|
||
import org.mozilla.geckoview.ContentBlocking; | ||
import org.mozilla.geckoview.ContentBlocking.AntiTracking; | ||
|
||
public class TrackingProtectionPolicy { | ||
|
||
private static final int RECOMMENDED = | ||
AntiTracking.AD | | ||
AntiTracking.ANALYTIC | | ||
AntiTracking.SOCIAL | | ||
AntiTracking.TEST | | ||
AntiTracking.STP | | ||
AntiTracking.CRYPTOMINING; | ||
private static final int STRICT = | ||
RECOMMENDED | AntiTracking.FINGERPRINTING; | ||
|
||
private int trackingPolicy; | ||
private int cookiePolicy; | ||
|
||
private TrackingProtectionPolicy() { | ||
trackingPolicy = AntiTracking.NONE; | ||
} | ||
|
||
/** | ||
* Strict policy. | ||
* Combining the [TrackingCategory.STRICT] plus a cookiePolicy of [ACCEPT_NON_TRACKERS] | ||
* This is the strictest setting and may cause issues on some web sites. | ||
*/ | ||
static TrackingProtectionPolicy strict() { | ||
TrackingProtectionPolicy policy = new TrackingProtectionPolicy(); | ||
policy.trackingPolicy = STRICT; | ||
policy.cookiePolicy = ContentBlocking.CookieBehavior.ACCEPT_NON_TRACKERS; | ||
return policy; | ||
} | ||
|
||
/** | ||
* Recommended policy. | ||
* Combining the [TrackingCategory.RECOMMENDED] plus a [CookiePolicy] of [ACCEPT_NON_TRACKERS]. | ||
* This is the recommended setting. | ||
*/ | ||
static TrackingProtectionPolicy recommended() { | ||
TrackingProtectionPolicy policy = new TrackingProtectionPolicy(); | ||
policy.trackingPolicy = RECOMMENDED; | ||
policy.cookiePolicy = ContentBlocking.CookieBehavior.ACCEPT_NON_TRACKERS; | ||
return policy; | ||
} | ||
|
||
static TrackingProtectionPolicy none() { | ||
TrackingProtectionPolicy policy = new TrackingProtectionPolicy(); | ||
policy.trackingPolicy = AntiTracking.NONE; | ||
policy.cookiePolicy = ContentBlocking.CookieBehavior.ACCEPT_ALL; | ||
return policy; | ||
} | ||
|
||
public boolean shouldBlockContent() { | ||
return trackingPolicy == STRICT; | ||
} | ||
|
||
public int getCookiePolicy() { | ||
return cookiePolicy; | ||
} | ||
|
||
public int getAntiTrackingPolicy() { | ||
return trackingPolicy; | ||
} | ||
|
||
} |
Oops, something went wrong.