Closed Bug 2010368 Opened 3 months ago Closed 1 month ago

Implement privacy metrics widget data service and IPC layer

Categories

(Firefox :: Protections UI, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
firefox150 --- fixed

People

(Reporter: jhan, Assigned: jhan)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Create the backend foundation for collecting and serving tracking protection statistics. This includes:

  • PrivacyMetricsService that wraps TrackingDBService to query weekly block counts by category (trackers, fingerprinters, cookies, etc.)
  • PrivacyMetrics JSWindowActor pair for cross-process communication (parent process has data, content process needs it)
  • Basic unit tests for service logic and actor communication
Assignee: nobody → jhan
Summary: Implement privacy metrics data service and IPC layer → Implement privacy metrics widget data service and IPC layer
Blocks: 2010369
Priority: -- → P2

This adds a new PrivacyMetricsService that wraps TrackingDBService to provide
weekly tracking protection statistics with 30-minute caching. The service
aggregates data by category (trackers, cookies, fingerprinters, cryptominers,
social trackers) for display in the privacy metrics widget.

Includes comprehensive xpcshell tests covering empty stats, aggregation,
multi-day data, caching behavior, and 7-day window filtering.

Attachment #9538401 - Attachment description: Bug 2010368 - Add PrivacyMetricsService for weekly tracking protection statistics. r?emz → Bug 2010368 - Add PrivacyMetricsService and JSWindowActor IPC layer for privacy metrics. r?emz

This patch adds backend infrastructure for the privacy metrics widget:

PrivacyMetricsService wraps TrackingDBService to provide weekly tracking
protection stats aggregated by category (trackers, cookies, fingerprinters,
cryptominers, social trackers).

JSWindowActor IPC layer provides PrivacyMetricsParent/Child for content pages
to access the service. Registered in DesktopActorRegistry for about:protections
with an enablePreference gate. The service is also accessible via RPMSendQuery
from AboutProtectionsParent.

The actor throws an error for private browsing contexts (callers should check
PBM status themselves via PrivateBrowsingUtils).

Includes xpcshell tests for the service and browser tests for the actors.

Attachment #9540733 - Attachment is obsolete: true

Revert for causing linting failures on privacy-metrics-card.css.
This is also causing bc failures like these: https://treeherder.mozilla.org/logviewer?job_id=553536646&repo=autoland&task=Gld_H9muSZSdgOcdNRGAHQ.0&lineNumber=2935

Flags: needinfo?(jhan)
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
QA Whiteboard: [qa-triage-done-c151/b150]
Flags: needinfo?(jhan)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: