II. Telemetry Revocation Events
Extending the notification telemetry to track when users revoke permissions.
Bug 1998053 | D274203 | Reviewer: timhuang
New Metrics
Building on the initial telemetry work, I added two new events to track permission revocation:
| Event | Description |
|---|---|
permission_revoked_toolbar | User revokes via toolbar panel (X button) |
permission_revoked_preferences | User revokes via Firefox preferences |
Implementation
Exporting getSiteCategory
The getSiteCategory function needed to be accessible from other modules:
// PermissionUI.sys.mjs
export function getSiteCategory(principal) {
// ... categorization logic
}Toolbar Revocation
In browser-sitePermissionPanel.js:
if (idNoSuffix === "desktop-notification") {
Glean.webNotificationPermission.permissionRevokedToolbar.record({
site_category: PermissionUI.getSiteCategory(gBrowser.contentPrincipal),
});
}Preferences Revocation
In sitePermissions.js:
if (this._type === "desktop-notification") {
for (let group of this._permissionsToDelete.values()) {
Glean.webNotificationPermission.permissionRevokedPreferences.record({
site_category: PermissionUI.getSiteCategory(group.principal),
});
}
}Complete Metrics Summary
With these additions, the full telemetry suite covers 7 events:
icon_shown— Permission icon appearsicon_clicked— User clicks the iconprompt_shown— Dialog displayed (script vs icon_click trigger)prompt_blocked— Auto-denied (no user gesture)prompt_interaction— User allows/blocks (with persistence tracking)permission_revoked_toolbar— Revoked via toolbarpermission_revoked_preferences— Revoked via preferences
This gives Firefox complete visibility into the notification permission lifecycle—from request to revocation.
Comments
Loading comments...