Skip to content

Commit 57fb933

Browse files
committed
Bug 1865790 - Part 1: Aggregate suspicious fingerprinter number to fingerprinter category on the protection dashboard. r=anti-tracking-reviewers,pbz
This patch makes the protection dashboard recognize the suspicious fingerprinter ID in the ContentBlockingLog and aggregate the number to the fingerprinter category. Differential Revision: https://phabricator.services.mozilla.com/D194863
1 parent 9177114 commit 57fb933

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

browser/actors/AboutProtectionsParent.sys.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ let idToTextMap = new Map([
3535
[Ci.nsITrackingDBService.TRACKING_COOKIES_ID, "cookie"],
3636
[Ci.nsITrackingDBService.CRYPTOMINERS_ID, "cryptominer"],
3737
[Ci.nsITrackingDBService.FINGERPRINTERS_ID, "fingerprinter"],
38+
// We map the suspicious fingerprinter to fingerprinter category to aggregate
39+
// the number.
40+
[Ci.nsITrackingDBService.SUSPICIOUS_FINGERPRINTERS_ID, "fingerprinter"],
3841
[Ci.nsITrackingDBService.SOCIAL_ID, "social"],
3942
]);
4043

@@ -393,8 +396,11 @@ export class AboutProtectionsParent extends JSWindowActorParent {
393396
let count = result.getResultByName("count");
394397
let type = result.getResultByName("type");
395398
let timestamp = result.getResultByName("timestamp");
396-
dataToSend[timestamp] = dataToSend[timestamp] || { total: 0 };
397-
dataToSend[timestamp][idToTextMap.get(type)] = count;
399+
let typeStr = idToTextMap.get(type);
400+
dataToSend[timestamp] = dataToSend[timestamp] ?? { total: 0 };
401+
let currentCnt = dataToSend[timestamp][typeStr] ?? 0;
402+
currentCnt += count;
403+
dataToSend[timestamp][typeStr] = currentCnt;
398404
dataToSend[timestamp].total += count;
399405
// Record the largest amount of tracking events found per day,
400406
// to create the tallest column on the graph and compare other days to.

browser/components/protections/content/protections.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,11 @@ document.addEventListener("DOMContentLoaded", e => {
244244
"privacy.trackingprotection.cryptomining.enabled",
245245
false
246246
);
247-
let fingerprintingEnabled = RPMGetBoolPref(
248-
"privacy.trackingprotection.fingerprinting.enabled",
249-
false
250-
);
247+
let fingerprintingEnabled =
248+
RPMGetBoolPref(
249+
"privacy.trackingprotection.fingerprinting.enabled",
250+
false
251+
) || RPMGetBoolPref("privacy.fingerprintingProtection", false);
251252
let tpEnabled = RPMGetBoolPref("privacy.trackingprotection.enabled", false);
252253
let socialTracking = RPMGetBoolPref(
253254
"privacy.trackingprotection.socialtracking.enabled",

toolkit/modules/RemotePageAccessManager.sys.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ export let RemotePageAccessManager = {
196196
RPMGetBoolPref: [
197197
"browser.contentblocking.report.lockwise.enabled",
198198
"browser.contentblocking.report.monitor.enabled",
199+
"privacy.fingerprintingProtection",
199200
"privacy.socialtracking.block_cookies.enabled",
200201
"browser.contentblocking.report.proxy.enabled",
201202
"privacy.trackingprotection.cryptomining.enabled",

0 commit comments

Comments
 (0)