Align content blocking flags from nsIWebProgressListener with ContentBlockingController
Categories
(GeckoView :: General, task, P2)
Tracking
(firefox129 fixed)
| Tracking | Status | |
|---|---|---|
| firefox129 | --- | fixed |
People
(Reporter: emz, Assigned: npoon)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, Whiteboard: [fxdroid][group4])
Attachments
(1 file)
Bug 1876736 adds STATE_PURGED_BOUNCETRACKER
Bug 1865707 added STATE_BLOCKED_SUSPICIOUS_FINGERPRINTING but didn't add it to GeckoView.
Updated•2 years ago
|
Comment 1•2 years ago
|
||
This would add android support for STATE_PURGED_BOUNCETRACKER (event for whenever we purge a bounce tracker, a security issue where third-party cookies are disabled) as well as STATE_BLOCKED_SUSPICIOUS_FINGERPRINTING. There’s more information in the patches from the privacy team.
Add these flags to the ContentBlockingController Events code link . Similar to the existing flags, they will be added to the LogEntry code link, BLOCKED_SUSPICIOUS_FINGERPRINTING would probably be added to the TrackingCategory.FINGERPRINTING (similar to BLOCKED_FINGERPRINTING_CONTENT).
We should look at Fenix code and see how tracking is propagated there. Also might not need any follow up in Fenix, depending on the answer to the below question. Otherwises, file another bug for that work. For additional context, here is a Fenix patch on exposing the Tracking categories.
Comment 2•2 years ago
|
||
Question for Paul or maybe Arturo: I'm not sure what category STATE_PURGED_BOUNCETRACKER would fall under. Here's the Tracking Categories that Android uses. What do you think?
| Reporter | ||
Comment 3•2 years ago
|
||
It doesn't really fit into either right now since those categories are for list based tracker blocking whereas bounce tracking protection uses heuristics to detect trackers and purges data periodically. it does not block trackers from loading or accessing cookies in the first place. Is it necessary to add it to those categories? What are they used for?
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 4•2 years ago
|
||
Comment 5•2 years ago
|
||
Thanks Paul for the info, they are used in the Android settings page to allow users to customize their tracking protection.
Nick, let's file a follow up to investigate how to propagate PURGED_BOUNCETRACKER to Fenix. I also see another category TrackingProtectionCategory (searchfox) as well that we should see where that is being used. What is the discrepancy between these categories and TrackingProtectionPolicy (searchfox).
| Reporter | ||
Comment 6•2 years ago
|
||
Ultimatively we want to ship Bounce Tracking Protection enabled by default, it would only be disabled if the user disabled ETP entirely. As a next step we're shipping it to ETP "strict" (See Bug 1898717). It would be nice sync that up with Android so it gets enabled as part of "strict" there too.
Comment 7•2 years ago
•
|
||
I think by adding these flags to GeckoView, purging bounce trackers are included in the default ETP on Android. Do you know of a way to manually check bounced trackers are being purged?
Updated•2 years ago
|
Comment 9•2 years ago
|
||
| bugherder | ||
| Reporter | ||
Comment 10•2 years ago
|
||
Here is how you can trigger the protection:
- go to about:config and ensure
privacy.bounceTrackingProtection.enabled=trueis set. Setprivacy.bounceTrackingProtection.bounceTrackingGracePeriodSec=0 - Visit https://bounce-tracking-demo.glitch.me/ and click on one of the bounce links
- After the browser navigated click on one of the bounce links again
- In the browser console execute the following code:
XPCOMUtils.defineLazyServiceGetter(
this,
"bounceTrackingProtection",
"@mozilla.org/bounce-tracking-protection;1",
"nsIBounceTrackingProtection"
);
await bounceTrackingProtection.testRunPurgeBounceTrackers();
It should give you an non-empty array of bounce trackers purged. At this point the purged trackers should have been reported via the ContentBlockingLog and they should show up in ETP tracker statistics for total trackers blocked.
Hope that answers your question!
Comment 11•2 years ago
|
||
Thanks Paul!
I tried on desktop just to see and I'm getting the following error:
XPCOMUtils.defineLazyServiceGetter(
this,
"bounceTrackingProtection",
"@mozilla.org/bounce-tracking-protection;1",
"nsIBounceTrackingProtection"
);
await bounceTrackingProtection.testRunPurgeBounceTrackers();
Uncaught (in promise) NS_ERROR_XPC_GS_RETURNED_FAILURE: ServiceManager::GetService returned failure code:
defineLazyServiceGetter resource://gre/modules/XPCOMUtils.sys.mjs:140
<anonymous> debugger eval code:3
<anonymous> debugger eval code:4
getEvalResult resource://devtools/server/actors/webconsole/eval-with-debugger.js:306
evalWithDebugger resource://devtools/server/actors/webconsole/eval-with-debugger.js:218
evaluateJS resource://devtools/server/actors/webconsole.js:953
evaluateJSAsync resource://devtools/server/actors/webconsole.js:846
makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
XPCOMUtils.sys.mjs:140
defineLazyServiceGetter resource://gre/modules/XPCOMUtils.sys.mjs:140
<anonymous> debugger eval code:3
<anonymous> debugger eval code:4
getEvalResult resource://devtools/server/actors/webconsole/eval-with-debugger.js:306
evalWithDebugger resource://devtools/server/actors/webconsole/eval-with-debugger.js:218
evaluateJS resource://devtools/server/actors/webconsole.js:953
evaluateJSAsync resource://devtools/server/actors/webconsole.js:846
makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
| Reporter | ||
Comment 12•2 years ago
|
||
Did you test this on Nightly? Please also double check that you set the prefs from comment 10. It's odd because the exact same command works on my machine.
I'm also curious if getting the service like this will give us a more meaningful error code:
let bounceTrackingProtection = Cc["@mozilla.org/bounce-tracking-protection;1"]
.getService(Ci.nsIBounceTrackingProtection);
Comment 13•2 years ago
|
||
Thanks for the quick response, I wasn't on the latest Nightly. I see Array [ "bounce-tracking-demo-tracker-server.glitch.me" ] now, and will check on mobile.
Description
•