Closed Bug 1839916 Opened 1 year ago Closed 1 year ago

Implement Bounce Tracking Protection Core Detection Logic

Categories

(Core :: Privacy: Anti-Tracking, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: pbz, Assigned: pbz)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

This bug is for implementation of the core bounce tracking protection logic. This includes

  • BounceTrackingProtection: A singleton holding the user activation map and bounce tracker map.
  • BounceTrackingState: An object attached to each top level CanonicalBrowsingContexts which keeps track of the navigation flow and manages a BounceTrackingRecord.
  • BounceTrackingRecord: Used to hold metadata about extended navigations, such as initialHost, finalHost, bounce set, storage access set.

We can add these components under toolkit/components/antitracking/bouncetrackingprotection

For manual testing:

Enable the feature by setting privacy.bounceTrackingProtection.enabled to true. This requires an application restart.

You can observe the state of the two maps via the browser console like so:

 let btProtection = Cc[
    "@mozilla.org/bounce-tracking-protection;1"
  ].getService(Ci.nsIBounceTrackingProtection);

// Hosts of the maps are exposed via
btProtection.bounceTrackerCandidateHosts;
btProtection.userActivationHosts

Logging can be enabled by running with:

MOZ_LOG="BounceTrackingProtection:4"

4 = debug is quite noisy, you can also drop that to 3 = info

https://bounce-tracking-demo.glitch.me/ is a good demo site. After going through the redirect flows btProtection.bounceTrackerCandidateHosts should be populated. Note that you may have to wait 10 seconds (timeout) for the bounce tracking algorithm to kick in.

Attachment #9341523 - Attachment description: Bug 1839916 - Update CanonicalBrowsingContext to hold BounceTrackingState objects. r=bvandersloot! → Bug 1839916 - Update BrowsingContextWebProgress to hold BounceTrackingState objects. r=bvandersloot!
Attachment #9341522 - Attachment description: Bug 1839916 - Add a bounce tracking component under antitracking. r=bvandersloot! → Bug 1839916 - Add a bounce tracking component under antitracking. r=bvandersloot
Attachment #9341523 - Attachment description: Bug 1839916 - Update BrowsingContextWebProgress to hold BounceTrackingState objects. r=bvandersloot! → Bug 1839916 - Update BrowsingContextWebProgress to hold BounceTrackingState objects. r=bvandersloot!,nika!
Attachment #9341524 - Attachment description: Bug 1839916 - Add navigation callbacks for BounceTrackingState in DocumentLoadListener. r=bvandersloot! → Bug 1839916 - Add navigation callbacks for BounceTrackingState in DocumentLoadListener. r=bvandersloot!,smaug!
Pushed by pzuhlcke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fce071d0f22b
Add a bounce tracking component under antitracking. r=bvandersloot,anti-tracking-reviewers
https://hg.mozilla.org/integration/autoland/rev/44f32df69c08
Update BrowsingContextWebProgress to hold BounceTrackingState objects. r=bvandersloot,nika
https://hg.mozilla.org/integration/autoland/rev/39cbf84f51b7
Add navigation callbacks for BounceTrackingState in DocumentLoadListener. r=bvandersloot,smaug
https://hg.mozilla.org/integration/autoland/rev/3713d0250e5e
Extend ContentBlockingUserInteraction to call BounceTrackingProtection on user interaction. r=bvandersloot,anti-tracking-reviewers
https://hg.mozilla.org/integration/autoland/rev/062039e3c9ca
Add simple bounce tracking protection tests. r=bvandersloot,anti-tracking-reviewers

Backed out for causing build bustages in BounceTrackingRecord.cpp

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: /builds/worker/checkouts/gecko/toolkit/components/antitracking/bouncetrackingprotection/BounceTrackingRecord.cpp:54:10: error: local variable 'setStr' will be copied despite being returned by name [-Werror,-Wreturn-std-move]
Flags: needinfo?(pbz)

Huh, that's odd. This built fine locally and static-analysis passed too... Looking.

Pushed by pzuhlcke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1c459fb2b051
Add a bounce tracking component under antitracking. r=bvandersloot,anti-tracking-reviewers
https://hg.mozilla.org/integration/autoland/rev/aeab1abeef2f
Update BrowsingContextWebProgress to hold BounceTrackingState objects. r=bvandersloot,nika
https://hg.mozilla.org/integration/autoland/rev/815021dbe6fe
Add navigation callbacks for BounceTrackingState in DocumentLoadListener. r=bvandersloot,smaug
https://hg.mozilla.org/integration/autoland/rev/c4068176e8e1
Extend ContentBlockingUserInteraction to call BounceTrackingProtection on user interaction. r=bvandersloot,anti-tracking-reviewers
https://hg.mozilla.org/integration/autoland/rev/97b7c9d34869
Add simple bounce tracking protection tests. r=bvandersloot,anti-tracking-reviewers

Did another 3 try runs that all look green, including all the build targets. 🤞🏻

Flags: needinfo?(pbz)
Pushed by pzuhlcke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/30fabd692c21
Add a bounce tracking component under antitracking. r=bvandersloot,anti-tracking-reviewers
https://hg.mozilla.org/integration/autoland/rev/935dc69ac6dd
Update BrowsingContextWebProgress to hold BounceTrackingState objects. r=bvandersloot,nika
https://hg.mozilla.org/integration/autoland/rev/818295cb0381
Add navigation callbacks for BounceTrackingState in DocumentLoadListener. r=bvandersloot,smaug
https://hg.mozilla.org/integration/autoland/rev/7933f0be98d0
Extend ContentBlockingUserInteraction to call BounceTrackingProtection on user interaction. r=bvandersloot,anti-tracking-reviewers
https://hg.mozilla.org/integration/autoland/rev/ff623ceacdca
Add simple bounce tracking protection tests. r=bvandersloot,anti-tracking-reviewers
Blocks: btp-nightly
Blocks: 1867529
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: